python-ulid v1.0.0 Release Notes
Release Date: 2020-04-30 // almost 4 years ago-
โ Added
* โ Added type annotations * Added the named constructors :meth:`.ULID.from_datetime`, :meth:`.ULID.from_timestamp` and :meth:`.ULID.from_hex`. ๐ Changed
- โฌ๏ธ Dropped support for Python 2. Only Python 3.6+ is supported.
- ๐ The named constructor :meth:
.ULID.new
has been removed. Use one of the specifc named constructors instead. For a new :class:.ULID
created from the current timestamp use the standard constructor.
.. code-block:: python
# old ulid = ULID.new() ulid = ULID.new(time.time()) ulid = ULID.new(datetime.now()) # new ulid = ULID() ulid = ULID.from_timestamp(time.time()) ulid = ULID.from_datetime(datetime.now())
- ๐ The :meth:
.ULID.str
and :meth:.ULID.int
methods have been removed in favour of the more Pythonic special dunder-methods. Usestr(ulid)
andint(ulid)
instead. - โ Added the property :meth:
.ULID.hex
that returns a hex representation of the :class:.ULID
.
.. code-block:: python
>>> ULID().hex '0171caa5459a8631a6894d072c8550a8'
- Equality checks and ordering now also work with
str
-instances. - ๐ฆ The package now has no external dependencies.
- โ The test-coverage has been raised to 100%.
.. _1.1.0: https://github.com/mdomke/python-ulid/compare/1.0.3...1.1.0 .. _1.0.3: https://github.com/mdomke/python-ulid/compare/1.0.2...1.0.3 .. _1.0.0: https://github.com/mdomke/python-ulid/compare/0.2.0...1.0.0
.. _PEP-0561: https://www.python.org/dev/peps/pep-0561/#packaging-type-information