A package to fetch function arguments from a Python module
Project description
get-params
this package allows you to fetch the arguments of a function from a simple search string, matching a function within a module.
usage
import pandas
loss_fn = find_fn(lib=pandas, module="dataframe")
get_required(loss_fn)
Output:
{'src': 'DataFrame.__init__',
'required': [],
'optional': ['data', 'index', 'columns', 'dtype', 'copy']}
installation
you can install the package using pip:
pip install get-params
or locally:
git clone <repo>
cd <repo>
pip install .
the package can be useful when you want to be flexible with arguments passed to e.g. a user interface, where you want to call a specific function.
it was developed to handle the many loss functions inside the sentence_transformers.losses.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
get-params-0.1.1.tar.gz
(2.8 kB
view details)
File details
Details for the file get-params-0.1.1.tar.gz.
File metadata
- Download URL: get-params-0.1.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78d601283a696742eaaa9f4b7184e901efb3aecca2a343555f5fb156532fd485
|
|
| MD5 |
e284d922a607e5f073e6e381710fc105
|
|
| BLAKE2b-256 |
3b350f4642331e2b124eaea5bcef167b04d5938c01d8f59118770214aa439878
|