Skip to main content

A utilities module made for personal use, has small snippets which I use in many projects.

Project description

pypers



PyPI CI (pip) PyPI - Wheel Supported Python Versions Downloads

Package with helper scripts.

Contains some helper function which make up its name: python+helpers = pypers.

Usage:

pypers.mongo_helpers:

from pypers.mongo_helpers import AsyncMongoDB

db = AsyncMongoDB('localhost:27017', 'pypers')
db.collection = "test"

await db.insert_one({'name': 'pypers'})
results = await db.find_one({'name': 'pypers'})
print(results)
await db.delete_one({'name': 'pypers'})

pypers.namespace:

from pypers.namespace import Namespace

ns = Namespace(
    a=1,
    b=2,
    c=Namespace(
        d=3,
        e=4,
    ),
)

print(ns.a)
print(ns.b)
print(ns.c.d)
print(ns.c.e)

pypers.url_helpers:

from pypers.url_helpers import UrlHelpers

new_url = await UrlHelpers.shorten_url('https://www.google.com')
print(new_url)

pypers.image_tools:

from pypers.image_tools import ImageTools

new_img = ImageTools.compress_image('/path/to/image.jpg', quality=50)
print(new_img)

pypers.formatters:

from pypers.formatters import Formatters

humanbytes_size = Formatters.humanbytes(1024*1024)
print(humanbytes_size)

human_time = Formatters.time_formatter(15000)
print(human_time)

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

pypers-1.0.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

pypers-1.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file pypers-1.0.0.tar.gz.

File metadata

  • Download URL: pypers-1.0.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Darwin/21.4.0

File hashes

Hashes for pypers-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a4894f83ac0b8c749c666d5f5aed271dcc357c166f6aea33838e9a3a5c5a6413
MD5 1166f3c779ec3b3afdf2780a5ff3cfdc
BLAKE2b-256 cc28f8848b5e96b8313730dce3c346119b3ff15d28d2b5a730b70e5d76260cc7

See more details on using hashes here.

File details

Details for the file pypers-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pypers-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Darwin/21.4.0

File hashes

Hashes for pypers-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92263787903f56053df8cfded24a3155156db20e1a2b9d7c7654b8e7081b127e
MD5 8fc726891815ce7895b1bc9e27d7a982
BLAKE2b-256 383abbc920fa91ecc532aa7ecb0a882e76b191bb5690bc49c4fc1b11db617b6e

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