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
from nicHelper.exception import errorString
try:
error
except:
print(f'error is \n{errorString()}')
error is
Traceback (most recent call last):
File "<ipython-input-7-47ded3794279>", line 2, in <module>
error
NameError: name 'error' is not defined
Dict utilities
from nicHelper.dictUtil import printDict
printDict({'key':'sjfhdkljhafsdlkjhdfaslkjhkljfadshklhfa', 'nestedKey':{'nestedKey2':'938023840843', 'nested3':{'nested4':'hello'}}})
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-8-86df14b70186> in <module>
----> 1 from nicHelper.dictUtil import printDict
2 printDict({'key':'sjfhdkljhafsdlkjhdfaslkjhkljfadshklhfa', 'nestedKey':{'nestedKey2':'938023840843', 'nested3':{'nested4':'hello'}}})
ImportError: cannot import name 'printDict' from 'nicHelper.dictUtil' (/home/ec2-user/SageMaker/pip/nicHelper/nicHelper/dictUtil.py)
Metadata
Release files for nicHelper 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nicHelper-0.0.3.tar.gz | 10.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nicHelper-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.4 kB
Release files / nicHelper-0.0.3.tar.gz
| Download URL | nicHelper-0.0.3.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75f6bc2ae6736929b828124d5ee0b5ffab5e12ce0bd12d5bb465021e0e8d2587
|
|
BLAKE2b-256 checksum How to use checksums |
76de30bce55b515ecaebdf1baccb1269bade56ccae85057e98e42194b0c64671
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
|
Release files / nicHelper-0.0.3-py3-none-any.whl
| Download URL | nicHelper-0.0.3-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7c171158a4a5cbd20d65700d4e374fbc39df68f15ff7c97d203c495ff52671f
|
|
BLAKE2b-256 checksum How to use checksums |
600609b7bff295fea02fe59e8f6db9afff455eabca72b2a32d970609b3ba1c5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
|