TeaserPaste Python SDK
Official Python SDK for TeaserPaste API. Simple, typed, and ready for the Teaserverse.
Installation
# Using uv (Recommended)
uv add tp-sdk
# Using pip
pip install tp-sdk
Quick Start
Standard (Sync)
import tp
# Context Manager (Recommended for connection pooling)
with tp.TeaserPaste("YOUR_API_KEY") as api:
# Create a new paste
note = api.paste(tp.SnippetInput(
title="Teaserverse Logs",
content="System status: All green.",
expires=tp.Expiry.HOUR_1
))
print(f"Created: {note.id}")
# Get a paste
data = api.get(note.id)
print(data.content)
Async (AsyncIO)
import asyncio
import tp
async def main():
async with tp.AsyncTeaserPaste("YOUR_API_KEY") as api:
note = await api.get("xyz_123")
print(note.title)
asyncio.run(main())
Features
Connection Pooling
The SDK now supports Context Manager usage (using with statement) to reuse HTTP connections, significantly improving performance for multiple requests.
Type Hints & Enums
Improved type safety for arguments and Models.
# Use Enum for expiry
from tp import Expiry
api.paste(tp.SnippetInput(..., expires=Expiry.WEEK_1))
# Explicit arguments for edit (IDE autocompletion enabled)
api.edit(snippet_id, title="New Title", visibility="private")
Iteration Helpers
Iterate through your snippets (single page only).
# Iterate snippets
for snippet in api.ls_iter(include_deleted=True):
print(snippet.title)
API Reference
"One-word" API's. Both Sync and Async clients support these methods.
api.paste(input)— Create a new snippet.api.get(id, pwd=None)— Get a snippet.api.edit(id, title=..., ...)— Update a snippet.api.kill(id)— Soft delete a snippet.api.live(id)— Restore a deleted snippet.api.fork(id)— Copy a snippet to your account.api.star(id, on=True)— Star (or unstar) a snippet.api.ls(limit=20, include_deleted=False)— List your snippets.api.ls_iter(limit=20, include_deleted=False)— Iterator for listing snippets (single page).api.user(uid)— List another user's public snippets.api.find(q)— Search snippets.api.find_iter(q)— Iterator for searching snippets (single page).api.me()— Get your account info.
Configuration
You can configure the base URL via environment variable TP_BASE_URL or passing base_url to the constructor.
Development
# Install dependencies
uv sync
# Build
uv build
License
Metadata
Release files for tp-sdk 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tp_sdk-0.2.1.tar.gz | 24.2 kB | With provenance | Details for tp_sdk-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tp_sdk-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for tp_sdk-0.2.1-py3-none-any.whl |
Total release size: 32.0 kB
Release files / tp_sdk-0.2.1.tar.gz
| Download URL | tp_sdk-0.2.1.tar.gz |
|---|---|
| Size | 24.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
876b69a01dc87f3c3224273588ae3d1faf43c345ed65aad60f42baa86d8a5547
|
|
BLAKE2b-256 checksum How to use checksums |
6d6051f884cc308f7479502442c203ed87f6791eda41f7a1d4f284c90b6f965d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.
Transparency logRelease files / tp_sdk-0.2.1-py3-none-any.whl
| Download URL | tp_sdk-0.2.1-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3590966d1bf137b37bdd06164847493737e7cb5ecaf1dc21d61cbda65e4e062
|
|
BLAKE2b-256 checksum How to use checksums |
1860837ca7fc0d73579a6fa7f6ef835f2fe20196a8e4bf58242e4bfa325db7f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.
Transparency logSecurity for tp-sdk 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for tp_sdk-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.