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.1.0.tar.gz (4.9 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.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aggarage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 13311922eabfc3df557c1ed3bfabe0517be63bff5aa31c2ced4920d7ab791897
MD5 0db25c7a2ad67a95423de212bc3ba129
BLAKE2b-256 16ee40a5a05c01c39881ac4b2916c2f29f759e68f5833a743ea6a7cf45ccd750

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aggarage-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67774c2d229e5fad2eb6cd5823e0b70b568c1792abfee97c4ecedbe90c0151d4
MD5 1a3d74f880cd63579acbc8158c26f8e6
BLAKE2b-256 1ec7c1316048f51d69ef84fd24adc49eddd7a49221ac70f8ad42be449c4542a5

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