Skip to main content

The module consists of two layers:

  • ShardProxy class that just manages connections.

  • ops module that implements helper classes for parallelism and result processing.

ShardProxy

Initialize:

SHARD_URLS = [
    "postgresql+asyncpg://server/shard0",
    "postgresql+asyncpg://server/shard1",
]
proxy = ShardProxy(SHARD_URLS)

Process request:

async def fetch_user(user_id: UUID):
    async with proxy.connect(user_id) as conn:
        async with conn.begin():
            stmt = select(User).where(User.id == user_id)
            res = await conn.execute(stmt)
            return res.all()

Operations

Select bunch of IDs:

UserRow = Row[tuple[User]]

class SelectManyUsers(RunOnKeysOperation[UserRow]):
    async def process(
        self, conn: AsyncConnection, keys: list[UUID]
    ) -> ResultRows[UserRow]:
        stmt = select(User).where(User.id.in_(keys))
        res = await conn.execute(stmt)
        return res.all()

users = await SelectManyUsers().run(proxy)

Metadata

Release files for shardproxy 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shardproxy 1.0.0
File Size Uploaded Provenance
shardproxy-1.0.0.tar.gz 4.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for shardproxy 1.0.0
File Interpreter ABI Platform
shardproxy-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / shardproxy-1.0.0.tar.gz

Download URL shardproxy-1.0.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3946037adb640e9ce6bc03021de536fc63ca8eb2b2b8f0c2ce6ca14af77ef5ce
BLAKE2b-256 checksum
How to use checksums
563913b7eb3adf2c631f18ae2cca79d0744b0dfb9c23f457047174195a360efe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.

Transparency log

Release files / shardproxy-1.0.0-py3-none-any.whl

Download URL shardproxy-1.0.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c41ca7470ec3aeaae9a6f92c415bdd6dae473b73e7d2d07715c659307c24e35d
BLAKE2b-256 checksum
How to use checksums
0abc2c6f2b8c13879b5712b6b695f5a3f3806a4605fcdcc7f5d9ac937c6b2299
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.

Transparency log

Security for shardproxy 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for shardproxy-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page