Skip to main content

Avi's Python toolkit including async function manager, variable database, and terminal utilities.

Project description

README.md

# avi_tools

**avi_tools** is a modular Python toolkit by Avi Twil that includes:

- Asynchronous function management
- A folder-based variable database
- Terminal utilities including colors, monoid operations, infix expressions, and file helpers

This toolkit is designed to be lightweight, simple to use, and helpful for scripting, automation, and educational purposes.

## Installation

```bash
pip install avi_tools

Modules Overview

  • avi_tools.async_funcs_manager: Manage async functions with wrappers and async runners.
  • avi_tools.variabledb: Lightweight file-based key-value store.
  • avi_tools.twillkit: Functional tools including Monoid, Infix, terminal colors, file helpers, and more.

Usage Examples

1. Async Function Manager

from avi_tools.async_funcs_manager import CapsFunc, FuncsToAsync, AsyncRunner

def hello(name):
    print(f"Hello, {name}")

def add(a, b):
    return a + b

caps_hello = CapsFunc("hello", hello, "Twill")
caps_add = CapsFunc("add", add, 3, 4)

funcs = FuncsToAsync([caps_hello, caps_add])
runner = AsyncRunner(funcs)
runner.run_all()

2. Variable Database

from avi_tools.variabledb import VariableDB

db = VariableDB("my_db")
db.save("counter", 42)
value = db.load("counter")
print(value)  # 42
print("counter" in db)  # True

3. Terminal Colors

from avi_tools.twillkit import Colors

print(f"{Colors.RED}This is red text{Colors.ENDC}")
print(f"{Colors.GREEN}This is green text{Colors.ENDC}")

4. Monoid and Infix Operators

from avi_tools.twillkit import Monoid, Infix

m = Monoid(1, 2, 3)
n = Monoid(4, 5)
combined = m + n
print(combined)  # Monoid(1, 2, 3, 4, 5)

# Filter by type
print(m.of_type(int))

# Infix usage
@Infix
def is_evenly_divisible(a, b):
    return a % b == 0

print(10 |is_evenly_divisible| 2)  # True

Project Structure

avi_tools/
├── async_funcs_manager/
├── variabledb/
├── twillkit/

License

MIT License

Author

Avi Twil

GitHub: https://github.com/avitwil/avi_tools PyPI: https://pypi.org/project/avi_tools/


---


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

avi_tools-1.0.9.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

avi_tools-1.0.9-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file avi_tools-1.0.9.tar.gz.

File metadata

  • Download URL: avi_tools-1.0.9.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.4

File hashes

Hashes for avi_tools-1.0.9.tar.gz
Algorithm Hash digest
SHA256 64624c93975de99d714bd2cea87cdd7607ee6b55dd38be232c89b1b8feeee485
MD5 54687e9d7ad5b5dbddcf50c725beee4a
BLAKE2b-256 5f4526d75b4462533fcd89405c8ee47246301367b780ed5fc973009a7cd1f617

See more details on using hashes here.

File details

Details for the file avi_tools-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: avi_tools-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.4

File hashes

Hashes for avi_tools-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 7dc64caadbadf5d357c4a2de1111b0c4206f41ee6721eaeb3009e90fb2406d3d
MD5 b017a998d0f206f1b5b5f55052b67a5e
BLAKE2b-256 fcf39861738bab1bafe34c32b3393cb4029cb4edf13926ef1df112f041194330

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