Installation
Install the SDK using pip:
pip install tinytoken-sdk
Requirements
- Python 3.7 or higher
- requests >= 2.20.0
Quick Start
First, get your API key from tinytoken.org. Here's how to use the SDK:
import tinytoken
# Using the client class with API key
client = tinytoken.TinyToken("your-api-key-here")
result = client.compress("Your text here")
print(result)
# Using environment variables (recommended for security)
import os
client = tinytoken.TinyToken(os.getenv("TINYTOKEN_API_KEY"))
result = client.compress("Your text here")
print(result)
Response Format
The compress method returns a compressed string.
Version
Current version: 0.1.2