A toolkit for working with nested data types
Project description
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.
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
Built Distribution
File details
Details for the file Aphid-0.1.1.tar.gz
.
File metadata
- Download URL: Aphid-0.1.1.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27113ade11977b097da8ca3ebdbe4b430179db729d7af1eb9fc0d6fe574436e5 |
|
MD5 | 9e340436071f89642d691f602ab9ca20 |
|
BLAKE2b-256 | effb7f8e0fbd7ef37476ef03ac10e77517836a5eb81f6518081169f83282c943 |
File details
Details for the file Aphid-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: Aphid-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdfbd0b0b21b88a9e58f3ae87d7225f2221b00f30354d1bb9b1341497a7b4a53 |
|
MD5 | a33f069a52ac744b75e685644a5f88dd |
|
BLAKE2b-256 | 9bf5252aa1264b8c13df907b06f8efe0e3980e4233b01541fb4c0917b2915e1e |