Python package allowing manipulation of data by graph pathfinding.
## usage example
(see more in [tests](graffunc/test/) and [examples](examples/))
from graffunc import graffunc, InconvertibleError
def my_a_to_b_converter(a):
b = a.upper()
return {'b': b}
def my_b_to_c_converter(b):
c = 'payload: ' + b + '/payload'
return {'c': c}
def my_a_to_c_converter(a):
raise InconvertibleError()
# creation of the main object
grfc = graffunc({
('a',): {('b',): my_a_to_b_converter},
})
# dynamic modification of the object
grfc.add(my_b_to_c_converter, sources={'b'}, targets={'c'})
grfc.add(my_a_to_c_converter, sources={'a'}, targets={'c'})
assert {'a', 'b', 'c'} == grfc.reachables_types(sources={'a'})
assert {'b', 'c'} == grfc.reachables_types(sources={'b'})
assert {'c'} == grfc.reachables_types(sources={'c'})
assert {'b': 'HELLO'} == grfc.convert(sources={'a': 'hello'}, targets={'b'})
assert {'c': 'payload: HELLO/payload'} == grfc.convert(sources={'a': 'hello'}, targets={'c'})
## installation
pip install graffunc
## links
[github](http://github.com/aluriak/graffunc) and [pypi](http://pypi.python.org/pypi/graffunc)
Metadata
Release files for graffunc 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| graffunc-0.2.2.tar.gz | 22.4 kB | Without provenance | Details for graffunc-0.2.2.tar.gz |
Release files / graffunc-0.2.2.tar.gz
| Download URL | graffunc-0.2.2.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c9e9eede25f567ada0c55d29f715eb6f36343c4e35d5156262d28646532996b
|
|
BLAKE2b-256 checksum How to use checksums |
a744aed1c910f7bba3f855e75a6c649a0e70adf6b1b12969adf5f94deafea088
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for graffunc 0.2.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.