Aphid Toolkit
Toolkit for dealing with nested data types in python. Supports working with any datatype with key:value attributes. Use it to find, substitute, and get the path to nested data. Supports searching via string, regex, list, and tuple. The OO layout also makes it easy to subclass and customize exactly what happens when a match is found, or how comparisons are handled. The syntax itself is very similar to the built in regular expression module re.
-
Aphid on Github:
-
Aphid on PyPi:
py -m pip install Aphid
How it works:
In sum it works based on recursive iteration. When a function is called it creates an instance of the appropriate class. The function then returns an attribute of that instance, and the instance is garbage collected immediately. I whent for a class based approach over a function based approach based on added functionality such as the StackTracker and Debugger which would be hard to implement without globals. The whole time the method is running the StackTracker is keeping track of the depth of recursion. This is two fold; in debug mode it allows the levels to be printed out, and it allows for the max_depth key word to to used reliably.
Why I started this project:
We all share in the frustration of working with new API's who never stop coming up with 'great' ways to structure their json responses. This module aims to make it a bit easier to find the data you need. Another goal of this project was to help accelerate the learning curve that comes with a new package. Finding out exactly where openpyxl stores that title text for your bar chart is tedious. With Aphid you can simply search the instance with a regex and get a mapped path in seconds.
Metadata
Release files for Aphid 0.1.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 | |
|---|---|---|---|
| Aphid-0.1.1.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Aphid-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.7 kB
Release files / Aphid-0.1.1.tar.gz
| Download URL | Aphid-0.1.1.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27113ade11977b097da8ca3ebdbe4b430179db729d7af1eb9fc0d6fe574436e5
|
|
BLAKE2b-256 checksum How to use checksums |
effb7f8e0fbd7ef37476ef03ac10e77517836a5eb81f6518081169f83282c943
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
|
Release files / Aphid-0.1.1-py3-none-any.whl
| Download URL | Aphid-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fdfbd0b0b21b88a9e58f3ae87d7225f2221b00f30354d1bb9b1341497a7b4a53
|
|
BLAKE2b-256 checksum How to use checksums |
9bf5252aa1264b8c13df907b06f8efe0e3980e4233b01541fb4c0917b2915e1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
|