Skip to content
/ sdk.py Public

A modern Python SDK for interacting with S.EE service.

License

Notifications You must be signed in to change notification settings

sdotee/sdk.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SEE Python SDK

Python Version License Code style: black Type checked: mypy

A modern Python SDK for SEE Content Sharing services (Short URL, Text, File, etc.), featuring async support, full type safety, and Python 3.11+ capabilities.

Features

  • 🚀 Modern Python: Built with Python 3.11+ features (type hints, pattern matching, dataclasses)
  • 🔄 Async First: Fully async API based on asyncio and httpx
  • 📝 Type Safe: 100% type annotated with mypy strict mode support
  • 🛡️ Reliable: Built-in retry mechanism, error handling, and rate limiting
  • 🧪 Well Tested: Comprehensive test suite with pytest
  • 📦 Standard Compliant: Follows PEP 517/518 with pyproject.toml

Requirements

  • Python 3.11+
  • httpx >= 0.27.0

Installation

pip install see-sdk

or you can visit PyPI page for more options.

Install from source:

git clone https://github.com/sdotee/sdk.py see-python-sdk
cd see-python-sdk && pip install -e .

Quick Start

Environment Setup

Set your API key as an environment variable:

export SEE_API_KEY="your-api-key-here"

Basic Usage

See examples/quickstart.py for a simple example of how to create a short URL.

Examples

The examples directory contains comprehensive usage examples for all features:

Development

Setup

git clone https://github.com/yourusername/see-sdk.git
cd see-sdk

python -m venv venv
source venv/bin/activate  # Linux/macOS

pip install -e ".[dev]"
pre-commit install

Testing

pytest
pytest --cov=see --cov-report=html
pytest tests/test_client.py

Code Quality

black src/ tests/
ruff check src/ tests/
mypy src/

API Reference

SeeClient

Main client class for API interactions.

Methods

  • create_short_url(request) - Create short URL
  • update_short_url(request) - Update short URL
  • delete_short_url(request) - Delete short URL
  • get_domains() - Get available domains
  • get_tags() - Get available tags

Models

CreateShortUrlRequest

@dataclass
class CreateShortUrlRequest:
    domain: str
    target_url: str
    title: str
    custom_slug: str | None = None
    expire_at: int | None = None
    tag_ids: list[int] | None = None

Exceptions

  • SeeError - Base exception
  • APIError - API error
  • AuthenticationError - Authentication error
  • ValidationError - Validation error
  • RateLimitError - Rate limit error
  • NotFoundError - Not found error

Contributing

Contributions are welcome! See CONTRIBUTING.md for details.

License

MIT License - see LICENSE file.

About

A modern Python SDK for interacting with S.EE service.

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •