Treasure Data API library for Python
td-client
supports the following versions of Python.
- Python 2.7+
- Python 3.3+
- PyPy
You can install the releases from PyPI.
$ pip install td-client
It'd be better to install certifi to enable SSL certificate verification.
$ pip install certifi
Please see also the examples at Treasure Data Documentation.
TreasureData API key will be read from environment variable TD_API_KEY
, if none is given via arguments to tdclient.Client
.
#!/usr/bin/env python
import os
import sys
import tdclient
with tdclient.Client() as td:
for job in td.jobs():
print(job.job_id)
Run tests.
$ python setup.py test
You can run tests against all supported Python versions. I'd recommend you to install pyenv to manage Pythons.
$ pyenv shell system
$ for version in $(cat .python-version); do [ -d "$(pyenv root)/versions/${version}" ] || pyenv install "${version}"; done
$ pyenv shell --unset
Install tox.
$ pip install tox
Then, run tox
.
$ tox
Release to PyPI.
$ python setup.py sdist upload
See CHANGELOG.md.
Apache Software License, Version 2.0