Skip to main content

Python client for fetching table data from the MyCorr API via Apache Arrow

Project description

pymycorr

PyPI version CI Python License

Python client for fetching table data from the MyCorr API using Apache Arrow for efficient data transfer.

Note: The production API is coming soon. Set MYCORR_API_URL to your endpoint if you have early access.

Installation

pip install pymycorr

Configuration

Set your API token and (optionally) the API URL as environment variables:

export MYCORR_API_TOKEN="your-api-token"

Or create a .env file in your project root:

MYCORR_API_TOKEN=your-api-token

The client automatically loads from environment variables and .env files.

Quick Start

from pymycorr import MyCorr

# Initialize client (loads token from MYCORR_API_TOKEN env var or .env file)
client = MyCorr()

# Fetch as pandas DataFrame
df = client.get_table("table-id")

# Fetch a specific version
df = client.get_table("table-id", version=2)

# Fetch using version alias
df = client.get_table("table-id", version="stable")

# Get table metadata without fetching data
info = client.get_table_info("table-id")
print(info["schema"])

Progress Display

Progress is shown automatically in interactive environments (terminals and notebooks). You can control this behavior:

# Always show progress
client = MyCorr(progress=True)

# Never show progress
client = MyCorr(progress=False)

# Override per-request
df = client.get_table("table-id", progress=False)

API Reference

MyCorr

__init__(url=None, token=None, env_file=None, progress="auto")

Initialize the client.

  • url: API base URL (optional). Falls back to MYCORR_API_URL env var, then default.
  • token: Authentication token (Bearer token from MyCorr UI). Falls back to MYCORR_API_TOKEN env var or .env file.
  • env_file: Path to custom .env file (optional).
  • progress: Show download progress. True always shows, False never shows, "auto" (default) shows in interactive environments.

get_table(table_id, version=None, engine="pandas", progress=None)

Fetch table data as a DataFrame.

  • table_id: Unique identifier for the table.
  • version: Version number (int) or alias (str like "latest", "stable").
  • engine: "pandas" (default) or "polars".
  • progress: Override client's progress setting for this request.
  • Returns: pandas or polars DataFrame.

get_table_info(table_id, version=None)

Get table schema and metadata.

  • table_id: Unique identifier for the table.
  • version: Version number (int) or alias (str).
  • Returns: Dictionary with table metadata including schema.

Exceptions

  • TableAPIError: Base exception for API errors.
  • TableNotFoundError: Table not found (404).
  • QuotaExceededError: Egress quota exceeded (429).
  • TableConversionError: Failed to convert Arrow data to DataFrame.
  • StreamingError: Error during data streaming or IPC parsing.

Development

See .env.example for environment variable configuration. For local development:

  1. Copy .env.example to .env
  2. Set MYCORR_API_URL to your local/dev base URL (no path segments)
  3. SSL verification is automatically disabled for localhost and 127.0.0.1 URLs

License

MIT License - see LICENSE for details.

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

pymycorr-0.2.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

pymycorr-0.2.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file pymycorr-0.2.0.tar.gz.

File metadata

  • Download URL: pymycorr-0.2.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pymycorr-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f129527225515167bf8f261503805136d5f08554f1b4ca08fa0f00c6dc953253
MD5 2086718bc3a0039bb79362210a1735cc
BLAKE2b-256 426091251f93f6ec93ca71b82e7273e1de2a17fe0131c9979d1c2ea191b9f7eb

See more details on using hashes here.

File details

Details for the file pymycorr-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pymycorr-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pymycorr-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2742be4e14a7d562b01f2e41d019c378c61869b2ce50e9003009630e0a18cb8
MD5 3ecc6d4fba12c81460b0aebb97f0792f
BLAKE2b-256 1e2dc0e56d4caf8c4bcd343e8149612a231e8f34b2f74842d836866b6480b013

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