Skip to main content

A tag identifier library based on https://github.com/j5pr/souvenir

Project description

souvenir python

Translated souvenir to python.

A structured ID generation and parsing library using prefixes.

This library primariy provides the Id class, which stores a 128-bit identifier with its corresponding type (tag). The string representation of an Id is the type's tag and the 128-bit value encoded into a variant of Crockford Base 32.

Release

Found on PyPI

Setup

User

  1. Installation

    pip install souvenir-python
    
  2. Using the library

    from souvenir import random_id
    
    class Story(Base):
        __tablename__ = "stories"
        id = Column(Text, primary_key=True, default=lambda: str(random_id(Story)))
    
        @staticmethod
        def prefix():
            return "ethosStory"
    

Dev

pip install ".[dev]"

License

This project is licensed under the MIT License.

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

souvenir_python-0.0.3.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

souvenir_python-0.0.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file souvenir_python-0.0.3.tar.gz.

File metadata

  • Download URL: souvenir_python-0.0.3.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.2

File hashes

Hashes for souvenir_python-0.0.3.tar.gz
Algorithm Hash digest
SHA256 37bab0ff29be5f75c46a74fcb036ebd77f4680a5eecb957e133d6bf19bade12c
MD5 6c218ff6480d894483cadde8bab20202
BLAKE2b-256 9f7e97f8aa353161e3a72b0abb85bbe01d63a530a06402cd98c6f5b3e96b3775

See more details on using hashes here.

File details

Details for the file souvenir_python-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for souvenir_python-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 13b2a3a09a51084360e66b68bc6139b404b644d21253742893b852f28acfe1ba
MD5 ce247ccdc36fa4ebbebf1b07b40e7720
BLAKE2b-256 18ac98ea698aa00cabde706541d0e95a70c12f6ac5132748931f501236080926

See more details on using hashes here.

Supported by

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