Skip to main content

An open-source python package with multiple python tools.

Project description

AgGarage

An open-source python package with multiple python tools.

Installation

pip install aggarage

Usage

from aggarage import *

@blitz # Example of a decorator from the package, it optimizes heavy calculations
def heavy_calc(x):
    total = 0
    for i in range(x):
        total += i ** 2
    return total

print(heavy_calc(10_000_000))

Timed Variables

AgGarage allows you to store variables over time and retrieve past values.

from aggarage import create_timed_variable, get_value_of_timed_variable, clear_all_timed_variables

create_timed_variable("score", 100)
create_timed_variable("score", 200)

print(get_value_of_timed_variable("score"))       # latest value
print(get_value_of_timed_variable("score", "-1m")) # value 1 minute ago

clear_all_timed_variables()  # removes all timed variable data

Utilities

AgGarage also provides common utility functions:

fib(n) – Fibonacci number factorial(n) / factorial_recursive(n) – Factorial is_prime(num) – Prime check gcd(a, b) / lcm(a, b) – Greatest/common divisors reverse_string(s) / is_palindrome(s) – String utilities sum_of_squares(n) – Sum of squares printf(text, color="red") – Colored terminal output

Notes

Timed variables are stored with second-level precision and automatically prune entries older than 30 minutes. The @blitz decorator uses JIT compilation if available or threads as a fallback to speed up computations.

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

aggarage-0.2.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

aggarage-0.2.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file aggarage-0.2.0.tar.gz.

File metadata

  • Download URL: aggarage-0.2.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for aggarage-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b6bcd650a94e2ef0e7164466124f64b6f8a52c53a5937a36af3b52741b3d222e
MD5 46c3545088354e0085b7363a2aba8216
BLAKE2b-256 a860996caaef1339c6264d30b5c95b2374e2bb9b511ed885a983cab48dff6347

See more details on using hashes here.

File details

Details for the file aggarage-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: aggarage-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for aggarage-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd0e4e490c6fe28e06c0d38bc1516a2498e97298d4ec46f51bbac9808bd3fc7d
MD5 e185644f339b6accbd3789cc67aa851b
BLAKE2b-256 589aa71072040f85296e9b5643e3ddc765d0d9686f1bbc403c1d57da3fc93748

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