A library that provides snowflake features to python, including Client and Server.
This is extend of https://github.com/koblas/pysnowflake with Client adding.
cd pysnowflake
pip install .snowflake_start_server [--dc=DC_ID] [--worker=WORKER_ID] [--address=ADDRESS] [--port=PORT] [--num_processes=NUM_PROC]or
python -m snowflake.server [--dc=DC_ID] [--worker=WORKER_ID] [--address=ADDRESS] [--port=PORT] [--num_processes=NUM_PROC]With configuration default value:
dc(int, 2 bit): be searched in environment PSF_DC first, if not found, get the 0 value.worker(int, 8 bit): be searched in environment PSF_WORKER first, if not found, get the 0 value.address(domain, inet): default is localhost.port(int): default is 8910.num_processes(int): default is 1.
All APIs through http GET method.
/: Get/Generate the ID/stats: Get the information and statistic for this worker
import snowflake.client
# One time only initialization
snowflake.client.setup(host, port)
# Then get the ID whenever you need
snowflake.client.get_guid()
# See the stats if you want
snowflake.client.get_stats()- Fix syntax errors with python 2.7