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.2.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.2-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sammler_sdk-1.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 83f41a8f1cb89d30240cecb17c48793dddcc24fd621db862a8988cdb1812702b
MD5 cd26df543fde3b63c91342d42066662a
BLAKE2b-256 c4c85bc63b69c5c656cac4fbf4a46585c66c98e7947e7eb3b27e581577b16803

See more details on using hashes here.

Provenance

The following attestation bundles were made for sammler_sdk-1.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: sammler_sdk-1.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ced089ed729c38640deb9f904a496c9f794cc78cdad030615377e1c87a17d77e
MD5 0ecc2f5e5c4802d492dff105935104dc
BLAKE2b-256 874c23f7292d63a93dac26c1591508d58a85063adbd0ee5e2f8fe8072a0a8cbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for sammler_sdk-1.1.2-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