Skip to main content

Python SDK for the opendata.best data API

Project description

opendata-sdk — Python

Official Python SDK for the opendata.best data API.

Installation

pip install opendata-sdk

Quick Start

from opendata import OpenData

client = OpenData(api_key="pk_live_xxx")

# List products
products = client.products.list()

# Search
page = client.products.search("us_sec", q="Tesla", limit=50)
print(page.meta.total)  # total results
for item in page.data:
    print(item)

# Auto-paginate
for record in client.products.search_all("us_sec", q="Tesla"):
    print(record)

# Export
data = client.products.export("us_sec", format="json", limit=5000)

# Groups
groups = client.groups.list()
results = client.groups.search("us_compliance", q="bank")

# Quota info
print(client.quota)

Async

from opendata import AsyncOpenData

async with AsyncOpenData(api_key="pk_live_xxx") as client:
    products = await client.products.list()

    async for item in client.products.search_all("us_sec", q="Tesla"):
        print(item)

Error Handling

from opendata import OpenData
from opendata import AuthenticationError, NotFoundError, RateLimitError

client = OpenData(api_key="pk_live_xxx")

try:
    product = client.products.get("unknown")
except NotFoundError as e:
    print(f"Not found: {e.message}")
except RateLimitError as e:
    print(f"Quota exceeded ({e.quota_type}), retry after {e.retry_after}s")
except AuthenticationError as e:
    print(f"Auth failed: {e.message}")

License

MIT

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

opendata_sdk-0.1.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opendata_sdk-0.1.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file opendata_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: opendata_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for opendata_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 698f1be76a8b5bf283be6cb6a1d6728f929cfaee74ebac562907757ac21da1f2
MD5 b294458b7be02e9c02383745b85ab274
BLAKE2b-256 48f1af6e346ab167c8fca30ccf26d3d0eae4a298a2395e04980e4cab5ca767d8

See more details on using hashes here.

File details

Details for the file opendata_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: opendata_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for opendata_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 daa7c01649e40c76937f7af29a4a034fa0f93b7aaaef6877a7c190e7d195cd9d
MD5 0d5e55f3c7903d1673245373373aa863
BLAKE2b-256 0d81ce3150492752c89470d1ed095701face25b70bce1e098be51c9edb80891f

See more details on using hashes here.

Supported by

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