Skip to main content

Python SDK for interacting with Sammler GraphQL API

Project description

Sammler Python SDK

The official Python SDK for interacting with the Sammler GraphQL API.

This SDK is async-first, type-safe, and powered by httpx and pydantic. It allows developer-tier Sammler users to programmatically manage, query, and update their personal collections.

Features

  • Async/Await Support: Built on top of httpx for efficient, non-blocking network calls.
  • Type Safety: All responses are fully parsed into Pydantic models for auto-completion and compile-time checks.
  • Developer Profile Integration: Direct access to your collections, items, and profile details using your Sammler API key.

Installation

Install the package via pip from PyPI:

pip install sammler-sdk

Quick Start

To use the SDK, you need a Sammler API Key. Once you have it, you can instantiate the client as an async context manager:

import asyncio
from sammler import SammlerClient

async def main():
    # Initialize the client with your API key
    async with SammlerClient(api_key="your_sammler_api_key") as client:
        # Retrieve all of your collections
        collections = await client.get_collections()
        
        print(f"Found {len(collections)} collection(s):")
        for collection in collections:
            print(f"- {collection.name}: {collection.description or 'No description'}")

if __name__ == "__main__":
    asyncio.run(main())

Available SDK Methods

The SammlerClient exposes high-level async methods matching the Sammler API:

  • get_current_user(): Retrieve the authenticated developer user's profile info (ID, name, email, tier, etc.).
  • get_collections(): Retrieve all collections belonging to the authenticated user.
  • get_collection(id: str): Retrieve a specific collection by its ID, including all items inside it.
  • get_items(): Retrieve all collection items across all collections.
  • get_item(id: str): Retrieve a single item by its ID, including details about its parent collection.

Raw client access

If you need direct access to the underlying raw queries/operations without wrapper methods, you can use client.raw_client.

Code Generation & Development

If you want to modify queries or develop/contribute to the SDK:

  1. Clone the repository and set up a virtual environment:
    python3 -m venv .venv
    source .venv/bin/activate
    
  2. Install the package in editable mode with development dependencies:
    pip install -e .
    pip install "ariadne-codegen[http]"
    
  3. Update queries in graphql/operations.graphql and run codegen:
    ariadne-codegen
    

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

sammler_sdk-1.1.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

sammler_sdk-1.1.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file sammler_sdk-1.1.1.tar.gz.

File metadata

  • Download URL: sammler_sdk-1.1.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sammler_sdk-1.1.1.tar.gz
Algorithm Hash digest
SHA256 10960d08f2798bf7e6bddcccccfedcfb24b9e2a50da0c68e8fc278fdb59f9323
MD5 ea75b43f01a718713821b3b3a31851dc
BLAKE2b-256 039f952629885c3802c726b4f3c98d46ccc1e097ce58fffbf411220b15115494

See more details on using hashes here.

Provenance

The following attestation bundles were made for sammler_sdk-1.1.1.tar.gz:

Publisher: release-and-publish.yml on beverts312/sammler-sdk

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

File details

Details for the file sammler_sdk-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: sammler_sdk-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sammler_sdk-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8d814f30d4a938a7ec13992de10e91dbbc7690217ca70002cf8028990d8b8b7e
MD5 31400b7cba20fc71b03bdd1b0bb02966
BLAKE2b-256 fb708c8903cdaea90b21ae98519ea5079553173e48fbdf4d26d73935731fd8ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for sammler_sdk-1.1.1-py3-none-any.whl:

Publisher: release-and-publish.yml on beverts312/sammler-sdk

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