Skip to main content

Async Python client for Stash GraphQL API

Reason this release was yanked:

Keeping latest version of 0.10.x / 0.11.x lines (0.10.14 / 0.11.2)

Project description

stash-graphql-client

PyPI version Python 3.12+ License: AGPL-3.0 codecov

Async Python client for Stash GraphQL API.

🔗 Quick Links

Features

  • ORM-like interface for GraphQL: Use .save(), .delete(), and relationship helpers instead of writing mutations manually.
  • Identity map with Pydantic v2 wrap validators: Same entity ID = same Python object reference. Nested objects with IDs are automatically separated into the identity map. Caching integrated at model construction—no separate cache layer needed.
  • Smart partial updates: UNSET pattern sends only changed fields in mutations. Update one field without affecting others.
  • Type-safe with Pydantic v2: Full runtime validation, IDE autocomplete, and error detection at development time.
  • Django-style filtering: Familiar rating100__gte=80 syntax instead of building complex GraphQL filter objects.
  • Async-first architecture: Built for async/await throughout with native support for concurrent operations.
  • Full Stash API coverage: Complete CRUD operations for all entity types, job management, metadata operations, and real-time subscriptions.

Quick Example

from stash_graphql_client import StashContext
from stash_graphql_client.types import Scene, UNSET

async with StashContext(conn={"Host": "localhost", "Port": 9999}) as client:
    # Find and update a scene
    scene = await client.find_scene("scene-id")
    scene.rating100 = 95
    scene.details = UNSET  # Don't touch this field
    await scene.save(client)  # Only sends rating100

    # Django-style filtering
    from stash_graphql_client import StashEntityStore
    store = StashEntityStore(client)
    top_rated = await store.find(Scene, rating100__gte=90)

Learn More


Installation

From PyPI (Recommended)

pip install stash-graphql-client

With Poetry

poetry add stash-graphql-client

From Source

git clone https://github.com/Jakan-Kink/stash-graphql-client.git
cd stash-graphql-client
poetry install

Requirements: Python 3.12+ • Poetry (for development)


Connection Options

conn = {
    "Scheme": "http",      # or "https"
    "Host": "localhost",   # Stash server host
    "Port": 9999,          # Stash server port
    "ApiKey": "...",       # Optional API key
}

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-or-later).

See LICENSE for the full license text.

This license ensures:

  • ✅ Open source code sharing
  • ✅ Network use requires source disclosure
  • ✅ Compatible with Stash (also AGPL-3.0)
  • ✅ Derivative works must also be AGPL-3.0

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stash_graphql_client-0.10.0.tar.gz (181.5 kB view details)

Uploaded Source

Built Distribution

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

stash_graphql_client-0.10.0-py3-none-any.whl (224.6 kB view details)

Uploaded Python 3

File details

Details for the file stash_graphql_client-0.10.0.tar.gz.

File metadata

  • Download URL: stash_graphql_client-0.10.0.tar.gz
  • Upload date:
  • Size: 181.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for stash_graphql_client-0.10.0.tar.gz
Algorithm Hash digest
SHA256 40e0b12c5044b4c2c2bcf76e1fbc45a987b615325a08c651d34abe973f19f108
MD5 9a740559a55a7a6ca30fd59ec4f2aef8
BLAKE2b-256 82c2b4d672902c1a527de3213115eab6278d3414db7f4b97cf9ab700909e76fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for stash_graphql_client-0.10.0.tar.gz:

Publisher: publish.yml on Jakan-Kink/stash-graphql-client

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

File details

Details for the file stash_graphql_client-0.10.0-py3-none-any.whl.

File metadata

File hashes

Hashes for stash_graphql_client-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6537a6b53d2c61f166da257a4bf890a6bbd85dfb645278355f275036209924aa
MD5 315f2eaff45193332531fab1b22bc8e4
BLAKE2b-256 76bf64ed4d7309cce6b1e072a56c7c1cfd82a5527f8835d4887c5e7b1b89dc35

See more details on using hashes here.

Provenance

The following attestation bundles were made for stash_graphql_client-0.10.0-py3-none-any.whl:

Publisher: publish.yml on Jakan-Kink/stash-graphql-client

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