snipp-gg/snipp
snipp
Installation
requests.
Getting started
Methods
get_user(user_id, include_posts=None, posts_limit=None)
Fetch a user by ID. Pass "@me" for the authenticated user.
| Parameter | Type | Description |
|---|---|---|
user_id | str | User ID or "@me". |
include_posts | bool | None | Include the user’s public uploads. |
posts_limit | int | None | Number of posts to return (1-50). |
get_post(code)
Fetch a post by its share code.
| Parameter | Type | Description |
|---|---|---|
code | str | The share code of the post. |
upload(file, privacy="unlisted")
Upload a file. Accepts a file path string, bytes, or a file-like object.
| Parameter | Type | Description |
|---|---|---|
file | str | bytes | BinaryIO | File path, raw bytes, or file object. |
privacy | str | "public", "unlisted", or "private". |
list_uploads()
List the authenticated user’s recent uploads.
edit_upload(code, title=None, description=None, privacy=None)
Edit an existing upload’s title, description, or privacy.
| Parameter | Type | Description |
|---|---|---|
code | str | The share code of the upload. |
title | str | None | New title (max 30 chars). Empty string to clear. |
description | str | None | New description (max 200 chars). Empty string to clear. |
privacy | str | None | "public", "unlisted", or "private". |
delete_upload(filename)
Delete an upload by its filename.
discover()
Browse public uploads from the community.
list_blocks()
List the users you have blocked.
block_user(target_id)
Block a user by their ID.
unblock_user(target_id)
Unblock a user by their ID.
Error handling
All API errors raise aSnippError with status and message attributes.

