Overview
stash-graphql-client is a modern, type-safe Python library for interacting with Stash media serverβs GraphQL API. Built with async-first architecture and comprehensive Pydantic type definitions, it provides a robust foundation for automating and extending your Stash instance.
Key Features
- π Async-first: Built on
gqlwithHTTPXAsyncTransportandWebsocketsTransport - π Fully Typed: All Stash GraphQL schema objects as Pydantic v2 models
- π Complete CRUD: Operations for scenes, galleries, performers, studios, tags, and more
- βοΈ Job Management: Metadata scanning, generation, and real-time job status tracking
- π‘ Subscriptions: GraphQL subscription support for live updates
- π― Identity Map: Built-in caching for efficient object reuse and relationship navigation
- π Fuzzy Dates: First-class support for Stash v0.30.0+ partial date formats
Quick Example
What Makes This Different?
Identity Map Pattern
Same entity IDs return the same object reference across all queries, ensuring data consistency:UNSET Sentinel
Distinguish between unqueried fields, null values, and actual data:Fuzzy Date Support
Work with partial dates just like Stash v0.30.0+:Who Should Use This?
This library is perfect for:- Automation: Build scripts to organize and manage your Stash library
- Integration: Connect Stash with other tools and services
- Extensions: Create custom workflows and plugins
- Analysis: Extract and analyze metadata from your collection
- Testing: Programmatically interact with Stash for testing purposes
Next Steps
UNSET Pattern
Learn core concepts and patterns
API Docs
Comprehensive API documentation
Date Utilities
Work with partial dates
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