Skip to main content

Python client for Sery — query your private data mesh by sery:// address.

Project description

Sery Python SDK

Query your private data mesh by sery:// address — one SQL statement, run on whichever machine holds the data. Raw data never moves through Sery; only result rows come back.

pip install sery          # core
pip install sery[pandas]  # + .to_pandas()

Quick start

import sery

client = sery.Client(api_key="sery_...")  # from app.sery.ai → Settings → API Keys

df = client.query("""
    SELECT customer, SUM(amount) AS total
    FROM 'sery://sam-laptop/local/sales/orders.parquet'
    GROUP BY customer
    ORDER BY total DESC
""").to_pandas()

Addresses

Sources are addressed as sery://<machine>/<protocol>/<path>:

  • <machine> — a machine's stable id or its name (e.g. sam-laptop)
  • <protocol>local, s3, or https
  • <path> — the file path / bucket key

Discover what's addressable with the catalog:

for src in client.catalog():
    print(src.sery_uri, "—", src.machine, src.file_format)
    # sery://sam-laptop/local/sales/orders.parquet — sam-laptop parquet

Pass any sery_uri straight into query().

Results

result = client.query("SELECT * FROM 'sery://my-mac/local/data.parquet' LIMIT 5")

result.columns          # ['id', 'name', ...]
result.rows             # [[1, 'a'], [2, 'b'], ...]
for row in result:      # iterate as dicts
    print(row["name"])
result.to_pandas()      # DataFrame (needs pandas)

result.incomplete       # True if a machine didn't respond
result.warnings         # human-readable warnings to surface

When incomplete is True, one or more machines were offline — check warnings before trusting an aggregate (a SUM/COUNT may undercount).

Errors

Every failure is a typed exception (sery.errors):

Exception When
AuthError missing / invalid API key (401)
QueryError no sery:// refs, bad address, unsupported protocol (400)
MachineNotFound unknown machine (404)
AmbiguousMachine a name matched >1 machine — .candidates lists machine_ids (409)
CrossMachineJoinUnsupported the query spans machines — .machines (422)
MachinesUnavailable every targeted machine offline — .failures (503)
import sery

try:
    client.query("SELECT * FROM 'sery://laptop/local/x.parquet'")
except sery.AmbiguousMachine as e:
    for c in e.candidates:
        print(c["label"], c["machine_id"])  # re-issue with the machine_id

Limitations (v1)

  • All sources in one query must live on the same machine — cross-machine joins raise CrossMachineJoinUnsupported.
  • Routable protocols: local, s3, https.

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

sery-0.2.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

sery-0.2.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sery-0.2.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sery-0.2.0.tar.gz
Algorithm Hash digest
SHA256 aac64810337ed8acba51cd1da7ae64471a39d57b18fed6065e8964c08cbb77b1
MD5 e3436debbe27500825081c635882a91b
BLAKE2b-256 977bd8906c57383a16c497a861bdea3824912d9d6ddb6723d8a29f323b9defda

See more details on using hashes here.

Provenance

The following attestation bundles were made for sery-0.2.0.tar.gz:

Publisher: publish.yml on seryai/sery-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: sery-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sery-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5aa9f77b57e3012384d8b9b82917f1c9daf13d38d3970dbd722920f38e3fe28
MD5 c5d60b7baa8388c581b87b129ea6052a
BLAKE2b-256 77cbb6425be1f8cba2b7f11d8ce5f9bac4d65edf147819283293c30c1816f921

See more details on using hashes here.

Provenance

The following attestation bundles were made for sery-0.2.0-py3-none-any.whl:

Publisher: publish.yml on seryai/sery-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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