Overview
The wonderparse project allows for easy cooperation between a main-function/an object that hold the central functions on the one side and argparse on the other.
Installation
To install wonderparse, you can use pip. Open your terminal and run:
pip install wonderparse
Usage
The code from the expit project.
import math as _math
import wonderparse as _wp
def function(x:float):
try:
p = _math.exp(-x)
except OverflowError:
p = float('+inf')
return 1 / (1 + p)
def main(args=None):
_wp.easymode.simple_run(
args=args,
program_object=function,
prog='expit',
)
Working example:
main([".4"])
### 0.598687660112452
Example with missing parameter.
main([])
### usage: expit [-h] x
### expit: error: the following arguments are required: x
### An exception has occurred, use %tb to see the full traceback.
Example with faulty typing.
main(["spam"])
### usage: expit [-h] x
### expit: error: argument x: invalid float value: 'spam'
### An exception has occurred, use %tb to see the full traceback.
The wonderparse project allows for parsing made easy.
License
This project is licensed under the MIT License.
Links
Credits
Author: Johannes
Thank you for using wonderparse!
Metadata
Release files for wonderparse 1.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wonderparse-1.4.1.tar.gz | 8.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wonderparse-1.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.1 kB
Release files / wonderparse-1.4.1.tar.gz
| Download URL | wonderparse-1.4.1.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d98cd92d6b79b8b62582c49f38a4b82c557122e174b27f767f60fa4a3cee97f
|
|
BLAKE2b-256 checksum How to use checksums |
6fe9da0dc8bd3298d8347c2019e31155f6104a61429edf9903b20161f1658f9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
|
Release files / wonderparse-1.4.1-py3-none-any.whl
| Download URL | wonderparse-1.4.1-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64c756999e78242a413c46e8315b147d5f8e2f1a474a28afbe90b4517a5b9d08
|
|
BLAKE2b-256 checksum How to use checksums |
51aa0ee2e1adb599bb55daa36a8e5925b199ecd40f78bffbab0fe77dd91fb284
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
|