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.1.0.tar.gz (9.4 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.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sery-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e7fe14161d548c09d15cde3e3080717a96a34aaffdde84896fddee0205ab5c5
MD5 445c0f16c7654cf7dcc47db443b1396f
BLAKE2b-256 d4744cdd9883f59ae406547a80e6ecf1be656db2e66d24ba2dc7b4ac6e3a5dbf

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for sery-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 525d53433e00e5209137dfdb08165af4813ee055c447b8f8cc9f8ad550482857
MD5 6690aa028ac0418c8d4f9e578b1d3a02
BLAKE2b-256 4f85670b818f78a937f9aa3c7d4f3b8ccd30708ddc1f8bc191778f8ebd0ad6e8

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