{ "info": { "author": "Manikandan Sundararajan", "author_email": "me@tsmanikandan.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "# py-ulid - A ULID Implementation in Python\n\n![ulid logo](https://raw.githubusercontent.com/tsmanikandan/py-ulid/master/logo.png)\n\n[![Documentation Status](https://readthedocs.org/projects/py-ulid/badge/?version=latest)](https://py-ulid.readthedocs.io/en/latest/?badge=latest)\n\nThe py-ulid library is a minimal and self-contained implementation of the ULID (Universally Unique Lexicographically Sortable Identifier) specification in Python.\nFor more information, please refer to the [official specification](https://github.com/ulid/spec).\n\nUUID can be suboptimal for many uses-cases because:\n\n- It isn't the most character efficient way of encoding 128 bits of randomness\n- UUID v1/v2 is impractical in many environments, as it requires access to a unique, stable MAC address\n- UUID v3/v5 requires a unique seed and produces randomly distributed IDs, which can cause fragmentation in many data structures\n- UUID v4 provides no other information than randomness which can cause fragmentation in many data structures\n\nInstead, herein is proposed ULID:\n\n- 128-bit compatibility with UUID\n- 1.21e+24 unique ULIDs per millisecond\n- Lexicographically sortable!\n- Canonically encoded as a 26 character string, as opposed to the 36 character UUID\n- Uses Crockford's base32 for better efficiency and readability (5 bits per character)\n- Case insensitive\n- No special characters (URL safe)\n- Monotonic sort order (correctly detects and handles the same millisecond)\n\n## Installation\n\nYou can install the py-ulid library from [PyPi](https://pypi.org/project/py-ulid)\n\n```shell\npip install py-ulid\n```\n\nThe py-ulid library can be used in any version of python >= 3.5 and does not require any additional packages or modules.\n\n## How to use\n\nTo generate a ULID, simple run the generate() function\n\n```python\nfrom ulid import ULID\n\n#Instantiate the ULID class\nulid = ULID()\nulid.generate() #01BX5ZZKBKACTAV9WEVGEMMVRZ\n```\n\n### Seeding Time\n\nYou can instantiate the instance of the ULID class with a seed time which will output the same string for the time component. This could be useful when migrating to ulid\n\n```python\nfrom ulid import ULID\n\n#Instantiate the ULID class\nulid = ULID(1469918176385)\nulid.generate() #01ARYZ6S41TSV4RRFFQ69G5FAV\n```\n\n### Monotonic ULIDs\n\n```python\nfrom ulid import Monotonic\n\n#Instantiate the Monotonic Class\nulid = Monotonic()\n\n# Same timestamp when calls are made within the same\n# millisecond and least-significant random bit is incremented by 1\nulid.generate() #01DC8Y7RBV4RSXX0437Z1RQR11\nulid.generate() #01DC8Y7RBV4RSXX0437Z1RQR12\nulid.generate() #01DC8Y7RBV4RSXX0437Z1RQR13\nulid.generate() #01DC8Y7RBV4RSXX0437Z1RQR14\nulid.generate() #01DC8Y7RBV4RSXX0437Z1RQR15\nulid.generate() #01DC8Y7RBV4RSXX0437Z1RQR16\nulid.generate() #01DC8Y7RBV4RSXX0437Z1RQR17\nulid.generate() #01DC8Y7RBV4RSXX0437Z1RQR18\nulid.generate() #01DC8Y7RBV4RSXX0437Z1RQR19\n```\n\n## Prior Art\n\nPartly inspired by:\n\n- [Instagram](http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram)\n- [Firebase](https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tsmanikandan/py-ulid", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "py-ulid", "package_url": "https://pypi.org/project/py-ulid/", "platform": "", "project_url": "https://pypi.org/project/py-ulid/", "project_urls": { "Homepage": "https://github.com/tsmanikandan/py-ulid" }, "release_url": "https://pypi.org/project/py-ulid/1.0.3/", "requires_dist": null, "requires_python": "", "summary": "Python library that provides an implementation of the ULID Specification", "version": "1.0.3" }, "last_serial": 5532195, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "ba5659181e49ef792c8e1c90b45910e2", "sha256": "4ee6e72d84a6613a876ed51bcae76bd3c9a5f6edf71557d85312d368402fa377" }, "downloads": -1, "filename": "py_ulid-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ba5659181e49ef792c8e1c90b45910e2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5008, "upload_time": "2019-05-31T02:03:59", "url": "https://files.pythonhosted.org/packages/a1/b5/bf97928ac4aed33820f02b33d92dc578c650e51c466206f15f2c8537cf6c/py_ulid-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1a327689d6030a6e4585a5b6189a757b", "sha256": "e7e0d759acb0c527bbe8823fc496d09163f5368618277bf97c48d1ba121350c1" }, "downloads": -1, "filename": "py-ulid-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1a327689d6030a6e4585a5b6189a757b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3876, "upload_time": "2019-05-31T02:04:01", "url": "https://files.pythonhosted.org/packages/cf/f0/a4279b0fc42c383af66df8b801ff909ad3be2437a90fbdcf09ad56406cca/py-ulid-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "09725fb3cfb8a96a5a25a6892e8af49e", "sha256": "934f803f661e678899b2da91dee63abf4891086ca585982d83fe38c8f8898f6d" }, "downloads": -1, "filename": "py-ulid-1.0.1.tar.gz", "has_sig": false, "md5_digest": "09725fb3cfb8a96a5a25a6892e8af49e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3868, "upload_time": "2019-05-31T04:06:42", "url": "https://files.pythonhosted.org/packages/65/80/26f9b7157ae50e2940c8eb1dcc91279f0ad6958bba534794c70d0336b758/py-ulid-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "70eef56f7699e7c308d43d5bda77b7c6", "sha256": "74ade626af6d775dcc4695b5e85cfb1b655c272af8cadb2a28f376f557e1472b" }, "downloads": -1, "filename": "py-ulid-1.0.2.tar.gz", "has_sig": false, "md5_digest": "70eef56f7699e7c308d43d5bda77b7c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5433, "upload_time": "2019-06-01T09:16:55", "url": "https://files.pythonhosted.org/packages/31/4e/2e1277395369fc86c4fb39e11fb4385d284191604d5a85b62f7760681a20/py-ulid-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "95b885e5a7b9dd9a713496f34f802d93", "sha256": "e30fcd14386fb6568efe6345b4656cb79bf5b9f54b83822d2e36ca728fe0a661" }, "downloads": -1, "filename": "py-ulid-1.0.3.tar.gz", "has_sig": false, "md5_digest": "95b885e5a7b9dd9a713496f34f802d93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5410, "upload_time": "2019-07-14T22:05:43", "url": "https://files.pythonhosted.org/packages/0d/11/995c21b3fad440b6ca07c0ebca8aba7abe25e66c5027c02dae6cf1883068/py-ulid-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "95b885e5a7b9dd9a713496f34f802d93", "sha256": "e30fcd14386fb6568efe6345b4656cb79bf5b9f54b83822d2e36ca728fe0a661" }, "downloads": -1, "filename": "py-ulid-1.0.3.tar.gz", "has_sig": false, "md5_digest": "95b885e5a7b9dd9a713496f34f802d93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5410, "upload_time": "2019-07-14T22:05:43", "url": "https://files.pythonhosted.org/packages/0d/11/995c21b3fad440b6ca07c0ebca8aba7abe25e66c5027c02dae6cf1883068/py-ulid-1.0.3.tar.gz" } ] }