Skip to content

giwa/td-client-python

 
 

Repository files navigation

Treasure Data API library for Python

Build Status Build status Coverage Status Code Health PyPI version

Treasure Data API library for Python

Requirements

td-client supports the following versions of Python.

  • Python 2.7+
  • Python 3.3+
  • PyPy

Install

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

Examples

Please see also the examples at Treasure Data Documentation.

Listing jobs

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)

Development

Running tests

Run tests.

$ python setup.py test

Running tests (tox)

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

Release to PyPI.

$ python setup.py sdist upload

Version History

See CHANGELOG.md.

License

Apache Software License, Version 2.0

About

Treasure Data API library for Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.0%
  • PowerShell 1.2%
  • Batchfile 0.8%