A python implementation of the Sno ID format.
This project is experimental - be careful!
This project is a fork of python_xid, with modifications to make it a sno rather than an xid implementation.
Currently this package is not available on pypi, however, you can install it from git, e.g.
pip install -e git+https://github.com/mishka-scan/python_sno.git@master
from sno import Sno
>>> Sno.new()
<Sno '7f48ri5q25rum222'>
>>> str(Sno.new())
'7f48ri5q25rum222'
>>> Sno.from_string('7f48ri5q25rum222').datetime
datetime.datetime(2021, 10, 11, 15, 45, 43, 152000)See the Sno class in sno.py for all interface methods.
The tick-tocking bit is always 0 in this implementation
The partition is set to be the process id (via os.getpid())
- Investigate supporting tick-tocking from Sno (currently this bit is always 0)
- Support setting the partition
All source code is licensed under the MIT License.