Skip to content

monty-dev/tuuid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tuuid

tuuid is a Python library for generating unique identifers that are:

  • Small (only 13 characters)
  • URL safe
  • Guaranteed to be unique (see below)
  • Able to be decoded to a datetime.datetime or timestamp

Internally, a threading.Lock mutex is used to ensure unique values across the system.

Installation

Use the package manager pip to install foobar.

pip install tuuid

Usage

import tuuid

tuuid.random()
# returns 'gJD9zjQwq4AkD'

tuuid.decode('gJD9zjQwq4AkD')
# returns 'datetime.datetime(2022, 3, 13, 3, 11, 11)'

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT. You can freely use tuuids in open source projects and commercial products.