pprog: Python Programming Tools
Install
It can be installed with pip.
pip install --upgrade pprog
It works in both Python 2 and Python 3.
Extension of importlib
imputil.reload(obj, update_global=True, update_local=True)provides advanced module and object reloading capabilities for Python, so that developer can modify code without restarting the interpreter.
This function solves key limitations of Python's built-in reloading functionality by:
- Supporting all import styles:
import X,from A import X, andfrom A import B as X - Automatically updating references without requiring reassignment
- Offering granular control over namespace updates (global and/or local namespace)
- Compatible to both Python 2.6+ and Python 3.1+
Examples:
# Direct import
from mymodule import myfunction
imputil.reload(myfunction)
# Aliased import
from mymodule import myfunction as myfunction1
imputil.reload(myfunction1)
# Module import
import mymodule
imputil.reload(mymodule)
# Module by name
imputil.reload("mymodule")
Example: Automatically updates references without reassignment:
from mymodule import myfunction
imputil.reload(myfunction) # Modify myfunction in mymodule.py
print(myfunction([3,1,2])) # Uses new version
Example: Function Reload with Aliases
from mymodule import myfunction as myfunction1, myfunction as myfunction2
# ... modify myfunction implementation ...
imputil.reload(myfunction1) # Updates both myfunction1 and myfunction2
Example: Selective Namespace Update
myfunction = None # Global reference
def f():
global myfunction
from mymodule import myfunction
imputil.reload(myfunction, update_local=False) # Only update global reference
def f():
from mymodule import myfunction
# ... modify calculator ...
imputil.reload(myfunction, update_global=False) # Update only the local calc reference
Extension of operator
pprog.argchecker(*keys, *, default)instantiates a callable object that checks whether position arguments and/or keyword arguments are all present, with optional default value for missing arguments.pprog.arggetter(*keys, *, default)instantiates a callable object that fetches position arguments and/or keyword arguments, with optional default value for missing arguments.pprog.attrchecker(*attrs, *, default)instantiates a callable object that checks whether the given attribute(s) are all present in its operand, with optional default value for missing attributes.pprog.attrgetter(*attrs, *, default)instantiates a callable object that fetches the given attribute(s) from its operand, with optional default value for missing attributes.pprog.constantcreator(value, /, *, copy=False)instantiates a callable object that returns the same constant when it is called.pprog.itemchecker(*items, *, default)instantiates a callable object that checks whether the given item(s) are all present in its operand, with muti-level keys and optional default value for missing items.pprog.itemgetter(*items, *, default)instantiates a callable object that fetches the given item(s) from its operand, with muti-level keys and optional default value for missing items.pprog.methodcaller(name, *args, **kwargs)instantiates a callable object that calls a method with the given name and arguments, supportingpandasaccessor.
Examples:
>>> from pprog import arggetter
>>> getter = arggetter(0) # get the first positional argument
>>> getter("value", "other_input", key="other_keyword_input")
'value'
>>> from pprog import attrgetter
>>> getter = attrgetter("upper")
>>> getter("test")
'TEST'
>>> from pprog import constantcreator
>>> creator = constantcreator("value")
>>> creator()
'value'
Release files for pprog 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 | |
|---|---|---|---|
| pprog-0.0.3.tar.gz | 8.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pprog-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.2 kB
Release files / pprog-0.0.3.tar.gz
| Download URL | pprog-0.0.3.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f333911e19d8886dc24d32cec2936dd162d8d0c3125bb29eac5e9cad807f58d5
|
|
BLAKE2b-256 checksum How to use checksums |
fffea369766a8e05f44aef23a8697914ec5e7f0ba360e38c51ca10e609fa239c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2025.
Transparency logRelease files / pprog-0.0.3-py3-none-any.whl
| Download URL | pprog-0.0.3-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a25d67b2df3e88d6ae269f34850b21db1dc9938cc7b922473467becdea054c53
|
|
BLAKE2b-256 checksum How to use checksums |
d753b89fa59a378d4204e6e7e6904adae14feb93ed7f14fb75001d4a4c8c8fed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2025.
Transparency log