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

Uploaded Python 3

File details

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

File metadata

  • Download URL: sammler_sdk-1.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 0085451c436460a6713ca76f1b8043eebfe1a155a9ac90a2d4475ebf358ea85f
MD5 6d28bdca1cf06522399d814c2887a9a2
BLAKE2b-256 1c55e5513d7a21e5f87c310bbe527d53f907470ef21645278e4555f915fd5e5f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sammler_sdk-1.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74d9e679d2696b1d77468cf9230668863b621d140fd90b2f364e10f359f7d494
MD5 dd09948e8d5b25d98cdd1cb408f8db4f
BLAKE2b-256 bf902f554ce551137ab2d2c67d12bafd7938a9040731bbcae3fe6104d7e34ede

See more details on using hashes here.

Provenance

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