Python client for reading and writing MyCorr table data via Apache Arrow
Project description
pymycorr
Python client for reading and writing table data on the MyCorr API using Apache Arrow for efficient data transfer.
Note: The production API is coming soon. Set
MYCORR_API_URLto 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"])
# Create a new table in a model from a DataFrame (requires a write-scoped token)
result = client.create_table("model-id", df, name="My Table", primary_key="id")
print(result["table_id"])
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 toMYCORR_API_URLenv var, then default.token: Authentication token (Bearer token from MyCorr UI). Falls back toMYCORR_API_TOKENenv var or.envfile.env_file: Path to custom.envfile (optional).progress: Show download progress.Truealways shows,Falsenever 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.
create_table(model_id, data, *, name, primary_key=None)
Create a new table in a model from tabular data. Encodes data as an Arrow IPC
stream and uploads it to the write API; the server persists the table and adds
it to the model. Requires a write-scoped token with edit access to the model.
model_id: The model the table is created in.data: A pandas/polars DataFrame or a pyarrowTable/RecordBatch.name: Name for the new table.primary_key: Primary-key column name(s) — a single name or a sequence for a composite key. Marking a key here is what lets the table be diff-synced later.- Returns: Dictionary with the created
model_idandtable_id.
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:
- Copy
.env.exampleto.env - Set
MYCORR_API_URLto your local/dev base URL (no path segments) - SSL verification is automatically disabled for
localhostand127.0.0.1URLs
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymycorr-0.3.0.tar.gz.
File metadata
- Download URL: pymycorr-0.3.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61a2182a311b04a9f1256eb05da1b31e4867355969e5187b4c96d45d8d9ceba7
|
|
| MD5 |
a2313dc80e0b9b9c1293b30877a90160
|
|
| BLAKE2b-256 |
e6daa346daad846b4a4a4abef9ce43886a339b0aae2a28a622de8e0ebbbc88be
|
Provenance
The following attestation bundles were made for pymycorr-0.3.0.tar.gz:
Publisher:
publish.yml on Recons-Ltd/pymycorr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymycorr-0.3.0.tar.gz -
Subject digest:
61a2182a311b04a9f1256eb05da1b31e4867355969e5187b4c96d45d8d9ceba7 - Sigstore transparency entry: 2084782949
- Sigstore integration time:
-
Permalink:
Recons-Ltd/pymycorr@388f6e5eadfb202450e5cc9dc6b1e6cc2076bdb3 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/Recons-Ltd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@388f6e5eadfb202450e5cc9dc6b1e6cc2076bdb3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pymycorr-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pymycorr-0.3.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd47ac0f3aa19bb3d480984e07cee30a40b29aed7dde5915967055863cd16339
|
|
| MD5 |
eb233b33a4d87760201dc795c1242c8a
|
|
| BLAKE2b-256 |
4ce8373ae77139e9561c27e3de4c826bc4c38bed9f0b16309663af344828449d
|
Provenance
The following attestation bundles were made for pymycorr-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on Recons-Ltd/pymycorr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymycorr-0.3.0-py3-none-any.whl -
Subject digest:
bd47ac0f3aa19bb3d480984e07cee30a40b29aed7dde5915967055863cd16339 - Sigstore transparency entry: 2084782959
- Sigstore integration time:
-
Permalink:
Recons-Ltd/pymycorr@388f6e5eadfb202450e5cc9dc6b1e6cc2076bdb3 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/Recons-Ltd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@388f6e5eadfb202450e5cc9dc6b1e6cc2076bdb3 -
Trigger Event:
release
-
Statement type: