Retrieve gym names from a compatible API
- Python3.8+, Docker images are built against 3.11
- Already set up MAD DB with gyms with unknown names.
pip3 install namepull
# Get python-poetry:
curl -sSL https://install.python-poetry.org | python -
# install deps in a venv:
poetry install
# and run:
poetry run namepull
- API specific
--apiendpoint &--tokenvalues - DB specific
--db_user&--db_pass(and optionally--db_host)
--verbositysets the amount of output provided. By defaultINFOlevel data is printed (value of0). Set to-1to suppressINFOand only print found new names.--batchsizewill be used to batch API queries. By default 5 but your API provider may recommend a specific value.--loop_intervalwill cause the tool to query continuously every N hours defined by this parameter. By default only a single query is made.
- The API will not be queried unless missing names are found.
- If missing names are found,
--batchsizewill be used to batch API queries. Your API provider may recommend a specific value. - See
sample.flagsfor a sample set of mandatory flags. A flagfile such as the sample is the simplest way to run;namepull --flagfile=sample.flags
You can also use env variables to provide flag values. This can be handy for the docker image to provide secrets in a safe manner:
- NAMEPULL_API
- NAMEPULL_TOKEN
- NAMEPULL_DB
- NAMEPULL_DB_HOST
- NAMEPULL_DB_PASS
- NAMEPULL_DB_USER
- NAMEPULL_BATCHSIZE
- NAMEPULL_LOOP_INTERVAL
- You can specify an optional
--loop_intervalvalue in hours. - The value will receive a random jitter addition up to a max of +5%.