Skip to main content

Cross-platform OAuth integrations SDK for NoSpoon applications

Project description

NoSpoon Integrations - Python SDK

Cross-platform OAuth integrations SDK for NoSpoon applications.

Installation

pip install nospoon-integrations

# With Supabase support
pip install nospoon-integrations[supabase]

Quick Start

The IntegrationClient constructor takes storage plus one keyword argument per provider you want to enable (each with its provider-specific config).

import os
from nospoon_integrations import IntegrationClient, ProviderConfig
from nospoon_integrations.storage import SupabaseTokenStorage

# Initialize storage
storage = SupabaseTokenStorage(
    supabase_url=os.environ["SUPABASE_URL"],
    supabase_key=os.environ["SUPABASE_SERVICE_ROLE_KEY"],
)

# Initialize client with the providers you need (flat keyword arguments)
integrations = IntegrationClient(
    storage=storage,
    google=ProviderConfig(
        client_id=os.environ["GOOGLE_CLIENT_ID"],
        client_secret=os.environ["GOOGLE_CLIENT_SECRET"],
        scopes=["https://www.googleapis.com/auth/gmail.compose"],
    ),
    hubspot=ProviderConfig(
        client_id=os.environ["HUBSPOT_CLIENT_ID"],
        client_secret=os.environ["HUBSPOT_CLIENT_SECRET"],
    ),
)

# OAuth providers: redirect the user, then handle the callback
auth_url = integrations.google.get_auth_url("https://myapp.com/callback")
status = await integrations.google.get_connection_status(user_id)

Credential providers (WordPress, Sanity)

WordPress and Sanity authenticate with a user-supplied credential rather than OAuth. Enable them with their config, then call connect() with the credential — it is verified live and only stored on success.

from nospoon_integrations import IntegrationClient
from nospoon_integrations.providers import SanityConfig, SanityConnectInput
from nospoon_integrations.storage import MemoryTokenStorage

integrations = IntegrationClient(storage=MemoryTokenStorage(), sanity=SanityConfig())

# Verify + store the connection (raises CredentialVerificationError if invalid)
await integrations.sanity.connect(
    user_id,
    SanityConnectInput(project_id="abc123", dataset="production", token=os.environ["SANITY_TOKEN"]),
)

# Post a blog entry as a draft (HTML body is converted to Portable Text)
result = await integrations.sanity.create_post(
    user_id, title="Hello", body="<p>First post</p>", publish=True
)

Providers

  • Google — Gmail API, OAuth
  • HubSpot — CRM contacts, OAuth
  • Facebook — Graph API, Pages
  • LinkedIn — Posts, OAuth
  • X (Twitter) — Tweets, OAuth 2.0 + PKCE
  • WordPress — self-hosted REST API, credential-based (Application Passwords)
  • Sanity — Actions/Assets/Query APIs, credential-based (robot token); includes a dependency-free html_to_portable_text() converter

Documentation

See the main documentation for full usage details.

License

MIT

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

nospoon_integrations-0.12.0.tar.gz (53.7 kB view details)

Uploaded Source

Built Distribution

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

nospoon_integrations-0.12.0-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file nospoon_integrations-0.12.0.tar.gz.

File metadata

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

File hashes

Hashes for nospoon_integrations-0.12.0.tar.gz
Algorithm Hash digest
SHA256 bc1bc13acd82432d8975c148cb78f0ba05adde45418823b3169003fd922e8711
MD5 957e48bdd849179dd7cba3fdcd1ee473
BLAKE2b-256 ca06947d0ff30a06f2749892e82608095da4da3bb6210d48b3584c3f67c207b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for nospoon_integrations-0.12.0.tar.gz:

Publisher: publish-pypi.yml on nospoonai/nospoon-integrations

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

File details

Details for the file nospoon_integrations-0.12.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nospoon_integrations-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e23cfea66691e93814f62ecf0c67eb2f64bd6b352f1e3da8f2750a09b394d5dc
MD5 7022e061d557e0f4f3293f00eeb6bb5a
BLAKE2b-256 cbeea76e4d8660bc2899e49313f5edde048af0455248331fd8392625b2f5a2f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for nospoon_integrations-0.12.0-py3-none-any.whl:

Publisher: publish-pypi.yml on nospoonai/nospoon-integrations

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