Skip to main content

Helpers

various helpers from nic gist

from nicHelper.wrappers import add_method

Install

pip install nicHelper

How to use

method module

add method to a class

class A:
  pass
@add_method(A)
def printHello(self):
  print('hello')

A().printHello()
hello

Dict utilities

from nicHelper.dictUtil import printDict
printDict({'key':'sjfhdkljhafsdlkjhdfaslkjhkljfadshklhfa', 'nestedKey':{'nestedKey2':'938023840843', 'nested3':{'nested4':'hello'}}})
key : sjfhdkljha
nestedKey
 nestedKey2 : 9380238408
 nested3
  nested4 : hello

Exception module

from nicHelper.exception import errorString
try:
  error
except:
  print(f'error is \n{errorString()}')
error is 
Traceback (most recent call last):
  File "<ipython-input-5-86083feec525>", line 3, in <module>
    error
NameError: name 'error' is not defined

Image utils

from nicHelper.images import imageFromUrl, imageToS3, showImgS3, resizeImage
from s3bz.s3bz import S3
## test variables
key = 'testCat.png'
path = '/tmp/testCat.png'
bucket = 'villa-remove-bg-small-output'
url = 'https://sites.google.com/site/funnycatmeawww/_/rsrc/1422326075261/home/6997052-funny-cat.jpg?height=675&width=1200'

Resize images

resizeImage(url, 400)

png

load image from url

img = imageFromUrl(url)
type(img)
PIL.JpegImagePlugin.JpegImageFile

save Image to S3

imageToS3(img, bucket, key)
S3.exist(key,bucket)
saving image to villa-remove-bg-small-output/testCat.png





True

display image from s3

## full test
showImgS3(bucket, key)

png

Metadata

Release files for nicHelper 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nicHelper 0.0.4
File Size Uploaded Provenance Actions
nicHelper-0.0.4.tar.gz 12.4 kB Without provenance Details for nicHelper-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nicHelper 0.0.4
File Interpreter ABI Platform Actions
nicHelper-0.0.4-py3-none-any.whl Python 3 none any Details for nicHelper-0.0.4-py3-none-any.whl

Total release size: 25.1 kB

Release files / nicHelper-0.0.4.tar.gz

Download URL nicHelper-0.0.4.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7c6e5ea3ff5a79dc58f6d1f1ac3917efca845fc5e193f3be366cd4a3aa3f56ff
BLAKE2b-256 checksum
How to use checksums
cf5adfd323d33396e27d14e1b634d9af32362546efb23ea1efbaff393e8e37dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

Release files / nicHelper-0.0.4-py3-none-any.whl

Download URL nicHelper-0.0.4-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9483e57d89a03df51506023e86eaa00a5589db593faf1948e276890479cf08a6
BLAKE2b-256 checksum
How to use checksums
f9c0faf627ba7542c10f442cfc9ef4ef38b4e10e39f1687c9808e87bf064d1b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

Security for nicHelper 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page