Skip to main content

pytrove 🛠️

PyPI version Python versions License: MIT

An Arabic translation is kept in README.ar.md; this English text is the reference when the two differ.

pytrove is a modern Python utilities library providing async-ready helpers for backend systems, databases, cryptography, and Telegram automation.

Upgrading? Every breaking change and how to migrate is in CHANGELOG.md.


✨ Features

  • ⚡ Async-first design built for modern asyncio applications
  • 🗄️ MongoDB utilities for cleaner and safer database operations
  • 🔐 Cryptography helpers (AES-GCM, secure key derivation)
  • 🤖 Telegram utilities using Kurigram integration
  • 📧 IMAP email utilities for fetching and parsing emails
  • 🌍 Country & phone utilities for region and number handling
  • 🧰 General utilities for parsing, validation, and data handling
  • 🧩 Fully typed codebase with strict type hints support

📦 Installation

Starting from v0.2.0, the library uses optional dependencies — install only what you need.

Minimal install (no optional dependencies)

pip install pytrove

Install specific features

Each feature has its own extra; full installs all of them. The list of extras and the packages each one installs is defined in [project.optional-dependencies] in pyproject.toml, which is the single source for it.

# Single feature
pip install "pytrove[crypto]"

# Multiple features
pip install "pytrove[crypto, mongo, phone]"

# Everything
pip install "pytrove[full]"

Note: If you try to use a feature without its required packages installed, you'll get a clear ImportError with the exact install command needed.

Install the latest version from GitHub

To install directly from the main branch (ahead of the latest PyPI release):

pip install git+https://github.com/eeeob/pytrove.git --force-reinstall

🔹 Without Deps

pip install git+https://github.com/eeeob/pytrove.git --force-reinstall --no-deps

🚀 Quick Start

🔐 Encryption example

pip install "pytrove[crypto]"
from pytrove import encrypt, decrypt

key = "my-secure-key"

encrypted = encrypt("secret data", key)
print(encrypted)

decrypted = decrypt(encrypted, key)
print(decrypted)

🗄️ MongoDB example

pip install "pytrove[mongo]"
from pytrove import MongoIndex

index = MongoIndex.from_dict({"key": {"field": 1}})

🤖 Telegram example

pip install "pytrove[tg]"
from pytrove import format_tg_username, mention_tg_user

username = format_tg_username("@myuser")
mention = mention_tg_user(123456789, "John")

🧪 Development Setup

The only prerequisite is uv; it provisions the interpreter and the environment from uv.lock.

git clone https://github.com/eeeob/pytrove.git
cd pytrove
make sync        # the locked environment with every extra
make test        # the suite; also: make lint, make typecheck, make test-doctest

CONTRIBUTING.md describes the workflow and every recipe; CI runs the same recipes on Python 3.10 through 3.14, with and without the optional extras.


📄 License

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


📬 Contact

Metadata

Release files for pytrove 2.0.0

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

Source distribution (sdist)

Source distribution for pytrove 2.0.0
File Size Uploaded Provenance Actions
pytrove-2.0.0.tar.gz 554.0 kB With provenance Details for pytrove-2.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 817.6 kB

Release files / pytrove-2.0.0.tar.gz

Download URL pytrove-2.0.0.tar.gz
Size 554.0 kB
Tags Source
SHA-256 checksum
How to use checksums
db3415abad7cfefd36d63e7579a6927ac975ff08a44cb3b3a3597176080292b4
BLAKE2b-256 checksum
How to use checksums
2f1aefd29bc7b95e92d72a71969ae1754ed6d8073696450d661ef621ead52ed2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / pytrove-2.0.0-py3-none-any.whl

Download URL pytrove-2.0.0-py3-none-any.whl
Size 263.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d6edf85400657e4e25347547d97f595c39f4187e1e00af1320ea8bc22329537
BLAKE2b-256 checksum
How to use checksums
c70de3ea8a841ada42b7d66ef2a588859056e0c498a0cd5fbd42555cfc10d39d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Security for pytrove 2.0.0

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.

Select from 2 files

Attestation for pytrove-2.0.0.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 Nov 1, 2026.

Transparency log

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.

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