Skip to content

Releases: danialkeimasi/python-registerer

Version 1.0.0

15 Sep 08:25
5683b52

Choose a tag to compare

Release Notes: v1.0.0 (from v0.7.0)

  • Breaking: Drop Python 3.7 and 3.8; require Python 3.9+.
  • Modernized type hints (PEP 585): list[...], dict[...], type[T].
  • Improved validator error message clarity.
  • CI/CD: Test on 3.9–3.13; auto-build and publish to PyPI on tags.

Full Changelog: v0.7.0...v1.0.0

Version 0.7.0

06 Feb 08:46

Choose a tag to compare

Update Notes

  • Just rename represent to attrs_as_tuples.

Full Changelog: v0.6.0...v0.7.0

Version 0.6.0

12 Jan 20:16

Choose a tag to compare

This version is backward compatible mostly and there is no breaking API changes.

Whats New

Introduced new methods on Registerer class:

represent(*args)
Use this to create a representation of registered items. You can use this to create choices for Django model field.
The input name of attrs you have on registered items. The output is a list of lists that represents the values of attrs.

registry = registerer.Registerer()

@registry.register()
class ContestStep:
    slug = "contest"
    name = "Contest"

@registry.register()
class CollegeStep:
    slug = "college"
    name = "College"

assert registry.represent("slug", "name") == [["contest", "Contest"], ["college", "College"]]

class Step(django.db.models.Model):
    step_slug = models.CharField(max_length=100, choices=registry.represent("slug", "name"))

unregister(registry_slug)
Unregister the item with given slug.

get(registry_slug, default=None)
Return the value for key if key is in the registry, else default.

Docs

The new docs are available now. For more information, check it out.

Full Changelog: v0.5.0...v0.6.0

Version 0.5.0

27 Oct 11:36

Choose a tag to compare

Full Changelog: v0.4.3...v0.5.0

Version 0.4.3

26 Oct 17:51

Choose a tag to compare

Full Changelog: v0.4.0...v0.4.3

Version 0.4.0

18 Sep 06:25

Choose a tag to compare

API Improvements.

Version 0.3.1

16 Sep 18:03

Choose a tag to compare

v0.3.1

Bump version 0.3.1

Version 0.3.0

14 Sep 20:15

Choose a tag to compare

  • Simplify API and make it more extensible by inheritance 86eb046
  • Drop python 3.6 and add poetry 1.2.0 to ci 1dea432

Version 0.2.1

06 May 11:55

Choose a tag to compare

  • Simplify interface of fast registry and add validators daa7006
  • Add examples and update README.md aaabf5f
  • Update README.md and bump version 0.2.1 137442a

Version 0.1.5

10 Apr 08:46

Choose a tag to compare

v0.1.5

Update README.md and Bump v0.1.5