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 hashes)