Skip to main content

Snippets and utils for python projects

Project description

python‑purse

python‑purse is a library that collects a variety of snippets and utilities for both asynchronous and synchronous Python projects. Whether you're building bots, web applications, or other tools, this library provides ready-to-use code modules to speed up development.

Features

  • Dataclasses Utilities
    Enhance your work with Python dataclasses with extra helpers and shortcuts.

  • Datetime Helpers
    Tools for common datetime operations.

  • HTTP Clients
    Built-in support for multiple HTTP clients including httpx, requests, and builtin http module.

  • Framework Extensions

    • aiogram: Bootstrap modules, decorators, routers, and utilities for Telegram bots.
    • aiohttp: Simplified app creation and server utilities.
    • django: ASGI/WSGI handlers, repository patterns, and more for Django projects.
  • Logging
    Custom logging configurations and integrations (including Telegram-based logging).

    config = ConfigParser()
    config.read('config.ini')
    bot_config = config['bot']
      
    purse.logging.setup(
      telegram_setup=TelegramSetup(
          bot=logging.SimpleLoggingBot(token=bot_config.get('token')),
          log_chat_id=bot_config.get('log_chat_id'),
          send_delay=bot_config.getint('send_delay'),
          logger_level=bot_config.getint('logger_level'),
          service_name=bot_config.get('service_name'),
      ),
    )
    
  • Interfaces and Repositories
    Protocol definitions and in-memory repository implementations for fast prototyping.

  • JSON and Functional Helpers
    Utility functions to simplify JSON handling and functional programming patterns.

  • Additional Utilities
    Signal handling, system-level helpers, type utilities, and more.

Installation

If python‑purse is published on PyPI, you can install it via pip:

pip install python-purse

Or, with extras:

pip install python-purse[aiogram]

Contributing

Contributions are welcome! If you’d like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/my-feature).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push your branch (git push origin feature/my-feature).
  5. Open a pull request.

License

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

Contacts

email telegram

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_purse-1.0.25.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_purse-1.0.25-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

File details

Details for the file python_purse-1.0.25.tar.gz.

File metadata

  • Download URL: python_purse-1.0.25.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.10

File hashes

Hashes for python_purse-1.0.25.tar.gz
Algorithm Hash digest
SHA256 0bf62ccffbe687a4f4298a0fe65e476e673ec0af92b7a876a721480984cdcde0
MD5 d56d2dcd76cca61a26b68c7d6feda3eb
BLAKE2b-256 db99233295a05d7fadebc61ce59803c1c9ac1db9e5c0baef70593949a1f710f5

See more details on using hashes here.

File details

Details for the file python_purse-1.0.25-py3-none-any.whl.

File metadata

File hashes

Hashes for python_purse-1.0.25-py3-none-any.whl
Algorithm Hash digest
SHA256 12625616f129ca63c8cfca8a29ee84fbd50a07d9a07cf16cbc40a24d48ed12ed
MD5 71919d012194d5625d4f86332e9a1ad1
BLAKE2b-256 0711ae2521edd8a361a158267260c941693ce3131e26650ed2a5b48b36fe0baf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page