Skip to main content

Dynamic variables in Python

Project description

Upload Python Package

allowdynamic

Dynamic, callable-backed array-like access with optional caching.

🔧 Installation

pip install allowdynamic

🚀 Example

from allowdynamic import DynamicContainer

def fibonacci(n):
    if n <= 0: return 0
    elif n == 1: return 1
    a, b = 0, 1
    for _ in range(2, n + 1):
        a, b = b, a + b
    return b

fib = DynamicContainer(fibonacci)

print(fib[10])          # → 55
print(fib[5:10])        # → [5, 8, 13, 21, 34]
print(10 in fib)        # True, if already cached

📦 Features

  • Array-like access to any function (container[i])
  • Optional result caching (cacheMode)
  • Slice support (container[1:5])
  • Manual cache control (isCached, updateCache, removeFromCache, etc.)

📄 License

MIT License

(c) 2025 DiamondGotCat

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

allowdynamic-2.0.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

allowdynamic-2.0.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file allowdynamic-2.0.1.tar.gz.

File metadata

  • Download URL: allowdynamic-2.0.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for allowdynamic-2.0.1.tar.gz
Algorithm Hash digest
SHA256 99f4b3f0bd7fc04fd3c0946364c1fc99a45494ecd7c0ab23319dbe855e187a84
MD5 d8e479169d2bb87f5d5cfcfff19cf7b9
BLAKE2b-256 501ca7579f4e5bccb8e0143685bdd1f5e14071da0c20796df1c62da5446adcad

See more details on using hashes here.

Provenance

The following attestation bundles were made for allowdynamic-2.0.1.tar.gz:

Publisher: python-publish.yml on DiamondGotCat/allowdynamic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file allowdynamic-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: allowdynamic-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for allowdynamic-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a9bd0580f6fa35cfc54ff3377141caee23a0a01a13526ef05358a0bd94bd158
MD5 6f8e4819faa34b222b81225e58cea3a0
BLAKE2b-256 29cde436787e0df5246290dda60ad3dddfe00ce3b07d1808a71010768e0e06eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for allowdynamic-2.0.1-py3-none-any.whl:

Publisher: python-publish.yml on DiamondGotCat/allowdynamic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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