Skip to content

Utility functions for creating and melting Twitter snowflake ID's.

Notifications You must be signed in to change notification settings

falcondai/python-snowflake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

snowflake.py

Utility functions for creating and melting Twitter snowflake ID's.

Examples

import time
from snowflake import *

# using tweet id from https://twitter.com/falcondai/status/345063379196600321
snowflake_id = 345063379196600321
timestamp, data_center, worker, sequence = melt(snowflake_id)
print 'the tweet was created at %s' % local_datetime(timestamp)

# create a snowflake id for the current millisecond
print make_snowflake(time.time()*1000, 1, 0, 0)

License

MIT License

Author

Falcon Dai

About

Utility functions for creating and melting Twitter snowflake ID's.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages