Skip to content

Generate Snowflake IDs and parse them back with Python.

License

Notifications You must be signed in to change notification settings

junchen1992/py-snowflake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-snowflake

Generate Snowflake IDs and parse them back with Python.

ℹ️ This is a Python implementation of Twitter's Snowflake algorithm.

Install

pip install py-snowflake-id

Sample Usage

from snowflake import SnowflakeGenerator

# Create Snowflake instance
sf_gen = SnowflakeGenerator(
    instance=0,  # Instance iD
)

# Get next ID generated by Snowflake algorithm
next_sf_id = next(sf_gen)

Snowflake Algorithm Explained

Here is a list of useful resources for understanding this algorithm:

About

Generate Snowflake IDs and parse them back with Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages