Skip to main content

Read and insert data using the Twinfield API.

Project description

logo

Downloads Open Source Code style: black PyPI Latest release

Twinfield


Python package for reading Twinfield data using the Twinfield API.

Installation


pip install twinfield

Usage

for an extensive list of examples, please checkout the twinfield test suite.

from twinfield import TwinfieldApi

# logging in
tw = TwinfieldApi()

# sending browse request.
df = tw.query_by_year(code="030_1", year=2021)

# sending dimensions request
df = tw.dimensions(dim_type="CRD")

required environment variables

Twinfield works with OpenID Connect. OpenID Connect is a simple identity layer on top of the OAuth 2.0 protocol. In order to authenticate with the twinfield server, the following environment variables must be set. Please see the Twinfield webservice documentation on the walktrough how to obtain the refresh token and set the app registration.

"TWINFIELD_ORGANISATION"
"TWINFIELD_CLIENT_ID"
"TWINFIELD_CLIENT_SECRET"
"TWINFIELD_REFRESH_TOKEN"

How to set environment variables?


Link to the Twinfield API documentation.


For business inquiries concerning this package, contact us at:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twinfield-2.0.0.tar.gz (16.0 kB view hashes)

Uploaded Source

Built Distribution

twinfield-2.0.0-py3-none-any.whl (19.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page