Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Restic

PyPI version Python versions License: MIT

A modern, type-safe Python library for building robust REST API clients with automatic Pydantic validation, async support, and extensible route patterns.

Features

  • Type Safety: Full type hints and Pydantic model validation for requests and responses
  • Async Support: Both synchronous and asynchronous operations
  • Generic Routes: Reusable route classes for common REST operations (CRUD)
  • Error Handling: Comprehensive exception handling with detailed error messages
  • Flexible Configuration: Customizable timeouts, authentication, and headers
  • Extensible: Easy to extend with custom mixins and route logic

Installation

Requirements: Python 3.10+

pip install restic

Or with UV:

uv add restic

Dependencies

  • httpx: HTTP client for making requests
  • pydantic: Data validation and serialization
  • typing-extensions: Enhanced type hints for older Python versions

Usage & Examples

The package provides a ResticClient base class and reusable route mixins for building type-safe API clients. Routes are composed using mixins for different HTTP operations, with automatic request/response validation via Pydantic models.

See the examples/ directory for complete usage examples:

  • json_placeholder.py: Full example with JSONPlaceholder API

The code is simple enough that users can learn how to use it directly from the source code and examples.

Development

Setup

# Clone the repository
git clone https://github.com/tobasqo/restic.git
cd restic

# Install with UV
uv sync

Testing

# Run tests
uv run pytest

# Run linting
uv run ruff check .

# Run formatting
uv run ruff format .

# Run type checking
uv run mypy .

Building

# Build the package
uv build

License

This project is licensed under the MIT License - see the LICENSE file for details.

References

Packages

These libraries are not integrated into the package but are worth mentioning for those who want to extend functionality:

Other resources

Metadata

Release files for restic 0.1.0a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for restic 0.1.0a0
File Size Uploaded Provenance Actions
restic-0.1.0a0.tar.gz 6.4 kB Without provenance Details for restic-0.1.0a0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for restic 0.1.0a0
File Interpreter ABI Platform Actions
restic-0.1.0a0-py3-none-any.whl Python 3 none any Details for restic-0.1.0a0-py3-none-any.whl

Total release size: 15.4 kB

Release files / restic-0.1.0a0.tar.gz

Download URL restic-0.1.0a0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d04b492eeab73fbba2635b6ede82024c9c9253ab1315ff3dbcfcddfa6e3b228b
BLAKE2b-256 checksum
How to use checksums
b83ce46b28eead6fc0fc082a874bcb5583a54c8919ef2f355ea91f7d7f4a3490
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Release files / restic-0.1.0a0-py3-none-any.whl

Download URL restic-0.1.0a0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b743aa977b43099d808206512709a0f2039525275425bf6415fa9370982b4c5d
BLAKE2b-256 checksum
How to use checksums
a6becf270b59a01c116f4a4fff17e9c61c90346ee9cb7f702bea67f34ac73ef5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Security for restic 0.1.0a0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page