Skip to main content

Globally unique identifier generator library

Project description

xid codecov

A Python 3.8+ port of https://github.com/rs/xid.

Install

pip install py-xid

Usage

from xid import XID

guid = XID()

print(guid.string())
# Output: bsqo1inf38q5alkk85a0

print(guid.machine())
# Output:  b'\xef\x1a4'

print(guid.pid())
# Output: 21846

print(guid.time())
# Output: 1597341898

print(guid.counter())
# Output: 9716052

print(guid.bytes())
# Output: b'_5\x80\xca\xef\x1a4UV\x94AT'

print(XID("bsqo1inf38q5alkk85a0"))
# Output: XID('bsqo1inf38q5alkk85a0')

print(XID(b"_5\x80\xca\xef\x1a4UV\x94AT"))
# Output: XID('bsqo1inf38q5alkk85a0')

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

py-xid-1.0.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

py_xid-1.0.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file py-xid-1.0.0.tar.gz.

File metadata

  • Download URL: py-xid-1.0.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for py-xid-1.0.0.tar.gz
Algorithm Hash digest
SHA256 82e5bbdab92d104fcc2bcb95a169ecaf126e72f838f0da6900efd9a1323ed05f
MD5 f32b4a6120a8c9574a456c1a757a1956
BLAKE2b-256 1b3c17dfdf554ba119b313f1da475f46be2f4e85a1aa137e36e019fd831d2a4a

See more details on using hashes here.

File details

Details for the file py_xid-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: py_xid-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for py_xid-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 759375239460ff9bebbf277fb469b2147236049268295a3708280818b806476b
MD5 f66ab3a7228e149a65aac6597bdcd46f
BLAKE2b-256 218e113870495d82c4f190bf9b994b4895beee7abe507a68ceef0b3420004fef

See more details on using hashes here.

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