Python Ulid Versions Save

ULID implementation for Python

2.4.0

1 month ago

Added

  • ULID objects are now properly serialized when used as Pydantic types @Avihais12344 #21

Internal

  • Added proper links to PyPI page @simonw #19

2.3.0

1 month ago

Added

  • ULID objects can now be converted to bytes with bytes(ulid).
  • The Pydantic v2 protocol is now supported, so that the ULID class can be directly used as type annotations in Pydantic models

Changed

  • The type annotations have been adapted, so that the classmethod constructors properly reflect the type for ULID subclasses. Thanks to @johnpaulett #9
  • Use time.time_ns() when generating ULIDs for improved performance #16 #12

2.2.0

7 months ago

Added

  • Added a new flag --uuid4 to the CLI show command, that converts the provided ULID into an RFC 4122 compliant UUID.
  • The ulid build command allows the use of the special value - for all options to read its inputs from stdin. E.g.
  $ date --iso-8601 | python -m ulid build --from-datetime -
  01HAT9PVR02T3S13XB48S7GEHE

2.1.0

7 months ago

Added

  • The new method ULID.to_uuid4 can be used to create an RFC 4122 compliant UUID from an existing ULID #5.

Changed

  • The validate_types-decorator that is used for all ULID.from_*-methods to check type correctness at runtime has now better support for type hints. Thanks to @johnpaulett

2.0.0

7 months ago

Added

  • New command line interface to easily generate and inspect ULIDs from the terminal

      $ ulid build
      01HASJFZZ862S826DA2NJK4WMT
    
      $ ulid show 01HASJFZZ862S826DA2NJK4WMT
      ULID:      01HASJFZZ862S826DA2NJK4WMT
      Hex:       018ab327ffe830b28119aa156532729a
      Int:       2049398682679492051963931130707735194
      Timestamp: 1695222857.704
      Datetime:  2023-09-20 15:14:17.704000+00:00
    

    The CLI can also be invoked as a module python -m ulid. For more information see ulid --help.

  • Make ULID-instances hashable @bendykst #4 #3

  • Added support for Python 3.11.

Changed

  • Dropped support for Python 3.7 and 3.8.