Skip to main content

Create and transform ULIDs

Project description

Fast ULID transformations

CI Status Test coverage percentage

Poetry black pre-commit

PyPI Version Supported Python versions License

Create and transform ULIDs

This library will use the CPP implementation from https://github.com/suyash/ulid if cython is available, and will fallback to pure python if it is not.

Example

>>> import ulid_transform
>>> ulid_transform.ulid_hex()
'01869a2ea5fb0b43aa056293e47c0a35'
>>> ulid_transform.ulid_now()
'0001HZX0NW00GW0X476W5TVBFE'
>>> ulid_transform.ulid_at_time(1234)
'000000016JC62D620DGYNG2R8H'
>>> ulid_transform.ulid_to_bytes('0001HZX0NW00GW0X476W5TVBFE')
b'\x00\x00c\xfe\x82\xbc\x00!\xc0t\x877\x0b\xad\xad\xee'
>> ulid_transform.bytes_to_ulid(b"\x01\x86\x99?\xe8\xf3\x11\xbc\xed\xef\x86U.9\x03z")
'01GTCKZT7K26YEVVW6AMQ3J0VT'

Installation

Install this via pip (or your favourite package manager):

pip install ulid-transform

Contributors ✨

Thanks to https://github.com/suyash/ulid which provides the cython implementation guts.

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits

This package was created with Copier and the browniebroke/pypackage-template project template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ulid_transform-0.9.0.tar.gz (14.4 kB view hashes)

Uploaded Source

Built Distributions

ulid_transform-0.9.0-pp310-pypy310_pp73-win_amd64.whl (88.5 kB view hashes)

Uploaded PyPy Windows x86-64

ulid_transform-0.9.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (225.4 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

ulid_transform-0.9.0-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (89.6 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

ulid_transform-0.9.0-pp310-pypy310_pp73-macosx_11_0_x86_64.whl (87.6 kB view hashes)

Uploaded PyPy macOS 11.0+ x86-64

ulid_transform-0.9.0-cp312-cp312-win_amd64.whl (88.5 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

ulid_transform-0.9.0-cp312-cp312-win32.whl (88.5 kB view hashes)

Uploaded CPython 3.12 Windows x86

ulid_transform-0.9.0-cp312-cp312-musllinux_1_1_x86_64.whl (778.8 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

ulid_transform-0.9.0-cp312-cp312-musllinux_1_1_i686.whl (838.1 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

ulid_transform-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (225.4 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

ulid_transform-0.9.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (231.7 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

ulid_transform-0.9.0-cp312-cp312-macosx_11_0_x86_64.whl (87.6 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ x86-64

ulid_transform-0.9.0-cp311-cp311-win_amd64.whl (88.5 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

ulid_transform-0.9.0-cp311-cp311-win32.whl (88.5 kB view hashes)

Uploaded CPython 3.11 Windows x86

ulid_transform-0.9.0-cp311-cp311-musllinux_1_1_x86_64.whl (778.8 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

ulid_transform-0.9.0-cp311-cp311-musllinux_1_1_i686.whl (834.0 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

ulid_transform-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (225.4 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ulid_transform-0.9.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (227.8 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

ulid_transform-0.9.0-cp311-cp311-macosx_11_0_x86_64.whl (87.4 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ x86-64

ulid_transform-0.9.0-cp310-cp310-win_amd64.whl (88.5 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

ulid_transform-0.9.0-cp310-cp310-win32.whl (36.8 kB view hashes)

Uploaded CPython 3.10 Windows x86

ulid_transform-0.9.0-cp310-cp310-musllinux_1_1_x86_64.whl (729.2 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

ulid_transform-0.9.0-cp310-cp310-musllinux_1_1_i686.whl (778.6 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

ulid_transform-0.9.0-cp310-cp310-manylinux_2_31_x86_64.whl (179.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.31+ x86-64

ulid_transform-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (175.8 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ulid_transform-0.9.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (171.3 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

ulid_transform-0.9.0-cp310-cp310-macosx_11_0_x86_64.whl (37.7 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page