Skip to main content

Python API wrapper for Snipp

Project description

snipp

A Python wrapper for the Snipp API.

Features

  • Upload files from paths, bytes, or file objects
  • Manage uploads and browse public content
  • Simple error handling with SnippError

Requirements

Dependencies (automatically installed):

  • requests

Installation

pip install snipp

Or install from source:

pip install .

Quick Start

from snipp import SnippClient

client = SnippClient(api_key="YOUR_API_KEY")

# Get your own profile
me = client.get_user()

# Upload a file
result = client.upload("screenshot.png", privacy="unlisted")

# List your uploads
uploads = client.list_uploads()

# Delete an upload
client.delete_upload("a3f7b2c91d4e8f0612ab34cd56ef7890.png")

# Browse public uploads
public = client.discover()

API

SnippClient(api_key)

Create a client. The key is sent via the api-key header on every request.

get_user(user_id="@me", include_posts=None, posts_limit=None)

Fetch a user profile. Pass "@me" (default) for the authenticated user. Set include_posts=True and posts_limit (1--50) to include their posts.

user = client.get_user("@me", include_posts=True, posts_limit=10)

upload(file, privacy="unlisted")

Upload a file. file can be a path string, raw bytes, or an open file object. privacy must be "public", "unlisted", or "private".

result = client.upload("image.png", privacy="unlisted")
print(result["url"])

list_uploads()

List the authenticated user's recent uploads. Each item includes the upload URL, size metadata, the associated post code when one exists, and isAlbum for uploads that belong to an album post.

uploads = client.list_uploads()

delete_upload(filename)

Delete an upload by its filename.

client.delete_upload("a3f7b2c91d4e8f0612ab34cd56ef7890.png")

discover()

Browse public uploads.

feed = client.discover()

Error Handling

All API errors raise a SnippError with status and message attributes.

from snipp import SnippClient, SnippError

try:
    client.get_user("nonexistent")
except SnippError as err:
    print(err.status, err.message)

Contributing

We welcome suggestions and improvements:

License

MIT License © 2026 Snipp. See LICENSE for full details.

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

snipp-1.0.2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

snipp-1.0.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file snipp-1.0.2.tar.gz.

File metadata

  • Download URL: snipp-1.0.2.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for snipp-1.0.2.tar.gz
Algorithm Hash digest
SHA256 df364c4e528fd9c8804a6902c0222ea5c540a2e78c64d569938f524f0d90d637
MD5 a6f506aa0e4778b0f69434dca518c5cb
BLAKE2b-256 3c990e55fc9d94943bd0cc9175e4b4eb2517ceb8d6910ea1b3819e5f54fc238a

See more details on using hashes here.

File details

Details for the file snipp-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: snipp-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for snipp-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5b7433a27fcb92617022cd624c711272222193e14bc9bb4433fb8a327730798b
MD5 3342e26ca8ee3718f5fcb6e3d5f348a1
BLAKE2b-256 2f96d83ae16f519f5984d9a36015d4f3264af3e8d2e9c0b12fd1927784a95f49

See more details on using hashes here.

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