Skip to main content

Python utilities developed by Devpunks.

Project description

PUNKZ

This is a package developed by Devpunks that contains some utilities for our projects. At the moment it includes:

  • Cache System (local, AWS S3 bucket)
  • Processor Framework (very experimental)

Table of Contents

Installation

You can easily install this package using pip.

pip install punkz

Usage

There are many utilities contained in this package.

Cache System

Local Caching

Example Code for local caching.

from punkz.core import Cache, LocalCacheProvider
from punkz.packages import get_logger

logger = get_logger("cache_logger")
provider = LocalCacheProvider(".cache", logger=logger)
my_cache = Cache(
    provider=provider,
    cache_instance_id="test",
    expiration="1d",
    logger=logger
    )

@my_cache.cache
def my_func(x):
    return x + 1

print(my_func(99))

Note: not passing logger to the Cache or the Provider is possible and if done it will simply deactivate logging and printing.

Caching on AWS

Example Code for caching on an AWS S3 bucket.

from punkz.core import Cache, AWSS3CacheProvider
from punkz.packages import get_logger

logger = get_logger("cache_logger")
provider = AWSS3CacheProvider(
    bucket_name="your-bucket-name",
    access_key_id="your-access-key-id",
    secret_access_key="your-secret-access-key",
    logger=logger
    )
my_cache = Cache(
    provider=provider,
    cache_instance_id="test",
    expiration="1d",
    logger=logger
    )

@my_cache.cache
def my_func(x):
    return x + 1

print(my_func(99))

Processor Framework

This is still a work in progress functionality. Documentation will be added in future releases.

License

This package is released under MIT License.

Disclaimer

This package is highly experimental and it will be further expanded and refactored in the future.

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

punkz-0.0.6.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

punkz-0.0.6-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file punkz-0.0.6.tar.gz.

File metadata

  • Download URL: punkz-0.0.6.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for punkz-0.0.6.tar.gz
Algorithm Hash digest
SHA256 a93c5f940141240945072cc4b34d6d900f055ac1d6feca0dd08e9ec4db9fe1d5
MD5 182b469e5c51ed6a47762258bf73c0c3
BLAKE2b-256 04a3c431ff86603f3fb7cf1237294dbb595daff2aa9af8f39f0bc0d427d81c5d

See more details on using hashes here.

File details

Details for the file punkz-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: punkz-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for punkz-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 91e66f2c2dd2cea49939a97fb11113dfb95f75865fe27965edf35b881b602c86
MD5 7e6af00ddba2aeba77e88d489ae172bc
BLAKE2b-256 76a30d227ef433683e45609e6548cd38e9d379cec7b3f3e933aa59a61a281b8e

See more details on using hashes here.

Supported by

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