https://github.com/alexferl/xid
Globally unique identifier generator library. A Python port of https://github.com/rs/xid
https://github.com/alexferl/xid
guid guid-generator xid
Last synced: about 1 month ago
JSON representation
Globally unique identifier generator library. A Python port of https://github.com/rs/xid
- Host: GitHub
- URL: https://github.com/alexferl/xid
- Owner: alexferl
- License: mit
- Created: 2020-08-13T02:07:44.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-17T09:32:03.000Z (about 1 year ago)
- Last Synced: 2025-03-16T17:42:45.597Z (about 1 month ago)
- Topics: guid, guid-generator, xid
- Language: Python
- Homepage:
- Size: 26.4 KB
- Stars: 19
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xid [](https://codecov.io/gh/alexferl/xid)
A Python 3.8+ port of [https://github.com/rs/xid](https://github.com/rs/xid).
# Install
```shell script
pip install py-xid
```# Usage
```python
from xid import XIDguid = XID()
print(guid.string())
# Output: bsqo1inf38q5alkk85a0print(guid.machine())
# Output: b'\xef\x1a4'print(guid.pid())
# Output: 21846print(guid.time())
# Output: 1597341898print(guid.counter())
# Output: 9716052print(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')
```