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
Async Python client for Stash GraphQL API.
🔗 Quick Links
- 📦 PyPI Package - Install via pip
- 📚 Documentation - Full API reference and guides
- 🎬 Stash Project - Upstream media server this client connects to
- 📝 Changelog - Version history and release notes
- 🤝 Contributing - Development guide and contribution guidelines
- 🔒 Security Policy - Vulnerability reporting and security best practices
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=80syntax instead of building complex GraphQL filter objects. - Async-first architecture: Built for
async/awaitthroughout 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
- 📚 Full Documentation - Complete guides and API reference
- 🎯 Getting Started Guide - Step-by-step tutorials
- 💡 Usage Patterns - Common recipes and best practices
- 🏗️ Architecture Overview - Design decisions and comparisons
- 🔍 API Reference - Complete API documentation
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
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 stash_graphql_client-0.10.6.tar.gz.
File metadata
- Download URL: stash_graphql_client-0.10.6.tar.gz
- Upload date:
- Size: 185.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
238cd8d6bdf0b6e5eae384c038668ad27dc944e0212e51bdeb9dae48d27ccec3
|
|
| MD5 |
7516d6da6f0c4253c9240a36d1e0ff0d
|
|
| BLAKE2b-256 |
7267e6d694217bc4d35a788267bb3df41644ee605a40b1baf4ed7256d7fb8b8b
|
Provenance
The following attestation bundles were made for stash_graphql_client-0.10.6.tar.gz:
Publisher:
publish.yml on Jakan-Kink/stash-graphql-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stash_graphql_client-0.10.6.tar.gz -
Subject digest:
238cd8d6bdf0b6e5eae384c038668ad27dc944e0212e51bdeb9dae48d27ccec3 - Sigstore transparency entry: 812943770
- Sigstore integration time:
-
Permalink:
Jakan-Kink/stash-graphql-client@86fdf636b401e6a3f0f8f5b6fac4d1f19c85cf0a -
Branch / Tag:
refs/tags/v0.10.6 - Owner: https://github.com/Jakan-Kink
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@86fdf636b401e6a3f0f8f5b6fac4d1f19c85cf0a -
Trigger Event:
push
-
Statement type:
File details
Details for the file stash_graphql_client-0.10.6-py3-none-any.whl.
File metadata
- Download URL: stash_graphql_client-0.10.6-py3-none-any.whl
- Upload date:
- Size: 228.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fba3cb35d41fb6dddcfc7b260a89853e19f4ee87240c519c9687df9dd15e102
|
|
| MD5 |
508fb1b241712180672f53053bc68201
|
|
| BLAKE2b-256 |
be679d03c158bb973a52366e6a9282f5d47e67de0c34cdc24c3e58c8c0fbe4a4
|
Provenance
The following attestation bundles were made for stash_graphql_client-0.10.6-py3-none-any.whl:
Publisher:
publish.yml on Jakan-Kink/stash-graphql-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stash_graphql_client-0.10.6-py3-none-any.whl -
Subject digest:
0fba3cb35d41fb6dddcfc7b260a89853e19f4ee87240c519c9687df9dd15e102 - Sigstore transparency entry: 812943774
- Sigstore integration time:
-
Permalink:
Jakan-Kink/stash-graphql-client@86fdf636b401e6a3f0f8f5b6fac4d1f19c85cf0a -
Branch / Tag:
refs/tags/v0.10.6 - Owner: https://github.com/Jakan-Kink
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@86fdf636b401e6a3f0f8f5b6fac4d1f19c85cf0a -
Trigger Event:
push
-
Statement type: