PyOPath
Overview
PyOPath is a Python library designed to facilitate querying structures of objects within application space. Inspired by XPath, JSONPath, and ObjectPath, PyOPath extends the querying capabilities beyond traditional XML and JSON documents to include a broader range of data structures.
Key Features
-
Flexible Querying: PyOPath allows querying of any kind of model as long as it meets certain criteria, expanding beyond the limitations of XML and JSON documents.
-
Application Space Integration: Unlike traditional querying libraries, PyOPath enables querying directly within the application's data structures, leveraging Python's runtime introspection capabilities.
Getting Started
To begin using PyOPath in your project:
-
Install PyOPath via pip:
pip install pyopath
-
Import PyOPath into your Python script:
import pyopath
-
Start querying your application's data structures using PyOPath's compact syntax.
Example
# Assume we have a data structure 'my_data' representing a nested dictionary
my_data = {
"name": "John",
"age": 30,
"address": {
"city": "New York",
"zipcode": "10001"
},
"pets": [
{"type": "dog", "name": "Buddy"},
{"type": "cat", "name": "Whiskers"}
]
}
# Querying the data structure with PyOPath
result = pyopath.query(my_data, "/address/city")
print(result) # Output: "New York"
Roadmap
Currently, PyOPath is focused on building a robust XPath AST. Future plans include expanding query capabilities and enhancing integration with various data structures and application models.
Contributing
Contributions to PyOPath are welcome! Feel free to submit bug reports, feature requests, or pull requests via GitHub.
License
PyOPath is licensed under the MIT License. See the LICENSE file for details.
Notes and links
ply docs https://github.com/dabeaz/ply/blob/master/doc/ply.md https://ply.readthedocs.io/en/latest/ply.html
good parser review https://tratt.net/laurie/blog/2020/which_parsing_approach.html
another xpathy thing using ply https://github.com/emory-libraries/eulxml/blob/master/eulxml/xpath/__init__.py
parsing c with ply https://github.com/dabeaz/ply/blob/master/example/ansic/cparse.py
Sanxion documentation https://www.saxonica.com/documentation12/index.html#!expressions
xpath language reference https://www.w3.org/TR/xpath-31/#doc-xpath31-PostfixExpr
Metadata
Release files for PyOPath 0.0.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 | Provenance | Actions |
|---|---|---|---|---|
| pyopath-0.0.1.tar.gz | 21.8 kB | Without provenance | Details for pyopath-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| PyOPath-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for PyOPath-0.0.1-py3-none-any.whl |
Total release size: 40.4 kB
Release files / pyopath-0.0.1.tar.gz
| Download URL | pyopath-0.0.1.tar.gz |
|---|---|
| Size | 21.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
594143cb9d6eec5140e75e816ac5b5896a20f2306b55ba5e7f47daffd37c776e
|
|
BLAKE2b-256 checksum How to use checksums |
a511e707b885e82e1e68fb69eb05e1e14141e20a7deeb5fa128a3bd8f43790ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.9
|
Release files / PyOPath-0.0.1-py3-none-any.whl
| Download URL | PyOPath-0.0.1-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3772f4d654a9ff34b532ece5c6c891dffc5c260b0b84d04f848f7abe7b540b2a
|
|
BLAKE2b-256 checksum How to use checksums |
c9fb3187fb9e26070ba2753f52b46f0acef113bcd1690157e2aad1d05c3d7077
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.9
|
Security for PyOPath 0.0.1
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.