Name | PyOPath JSON |
Version |
0.0.1
JSON |
| download |
home_page | None |
Summary | Querying object structures neatly |
upload_time | 2024-04-15 23:20:09 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
license | MIT License Copyright (c) 2024 Pierre LeMoine Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
objpath
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
## PyOPath
Test-status: [](https://github.com/DrInfiniteExplorer/pyopath/actions/workflows/python-package.yml)
### 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:
1. Install PyOPath via pip:
```bash
pip install pyopath
```
2. Import PyOPath into your Python script:
```python
import pyopath
```
3. Start querying your application's data structures using PyOPath's compact
syntax.
### Example
```python
# 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
Raw data
{
"_id": null,
"home_page": null,
"name": "PyOPath",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "objpath",
"author": null,
"author_email": "Pierre LeMoine <pypi@luben.se>",
"download_url": "https://files.pythonhosted.org/packages/a5/11/e707b885e82e1e68fb69eb05e1e14141e20a7deeb5fa128a3bd8f43790ef/pyopath-0.0.1.tar.gz",
"platform": null,
"description": "## PyOPath\n\nTest-status: [](https://github.com/DrInfiniteExplorer/pyopath/actions/workflows/python-package.yml)\n\n\n### Overview\n\nPyOPath is a Python library designed to facilitate querying structures of\nobjects within application space. Inspired by XPath, JSONPath, and ObjectPath,\nPyOPath extends the querying capabilities beyond traditional XML and JSON\ndocuments to include a broader range of data structures.\n\n### Key Features\n\n- **Flexible Querying**: PyOPath allows querying of any kind of model as long\n as it meets certain criteria, expanding beyond the limitations of XML and\n JSON documents.\n \n- **Application Space Integration**: Unlike traditional querying libraries,\n PyOPath enables querying directly within the application's data structures,\n leveraging Python's runtime introspection capabilities.\n\n### Getting Started\n\nTo begin using PyOPath in your project:\n\n1. Install PyOPath via pip:\n\n ```bash\n pip install pyopath\n ```\n\n2. Import PyOPath into your Python script:\n\n ```python\n import pyopath\n ```\n\n3. Start querying your application's data structures using PyOPath's compact\n syntax.\n\n### Example\n\n```python\n# Assume we have a data structure 'my_data' representing a nested dictionary\n\nmy_data = {\n \"name\": \"John\",\n \"age\": 30,\n \"address\": {\n \"city\": \"New York\",\n \"zipcode\": \"10001\"\n },\n \"pets\": [\n {\"type\": \"dog\", \"name\": \"Buddy\"},\n {\"type\": \"cat\", \"name\": \"Whiskers\"}\n ]\n}\n\n# Querying the data structure with PyOPath\n\nresult = pyopath.query(my_data, \"/address/city\")\nprint(result) # Output: \"New York\"\n\n```\n\n### Roadmap\n\nCurrently, PyOPath is focused on building a robust XPath AST. Future plans\n include expanding query capabilities and enhancing integration with various\n data structures and application models.\n\n### Contributing\n\nContributions to PyOPath are welcome! Feel free to submit bug reports,\n feature requests, or pull requests via GitHub.\n\n### License\n\nPyOPath is licensed under the MIT License. See the LICENSE file for details.\n\n# Notes and links\n\nply docs\nhttps://github.com/dabeaz/ply/blob/master/doc/ply.md\nhttps://ply.readthedocs.io/en/latest/ply.html\n\ngood parser review\nhttps://tratt.net/laurie/blog/2020/which_parsing_approach.html\n\nanother xpathy thing using ply\nhttps://github.com/emory-libraries/eulxml/blob/master/eulxml/xpath/__init__.py\n\nparsing c with ply\nhttps://github.com/dabeaz/ply/blob/master/example/ansic/cparse.py\n\nSanxion documentation\nhttps://www.saxonica.com/documentation12/index.html#!expressions\n\nxpath language reference\nhttps://www.w3.org/TR/xpath-31/#doc-xpath31-PostfixExpr\n\n\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Pierre LeMoine Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Querying object structures neatly",
"version": "0.0.1",
"project_urls": null,
"split_keywords": [
"objpath"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c9fb3187fb9e26070ba2753f52b46f0acef113bcd1690157e2aad1d05c3d7077",
"md5": "da7bbf442514e98e350f09224093a68a",
"sha256": "3772f4d654a9ff34b532ece5c6c891dffc5c260b0b84d04f848f7abe7b540b2a"
},
"downloads": -1,
"filename": "PyOPath-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "da7bbf442514e98e350f09224093a68a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 18569,
"upload_time": "2024-04-15T23:20:07",
"upload_time_iso_8601": "2024-04-15T23:20:07.371569Z",
"url": "https://files.pythonhosted.org/packages/c9/fb/3187fb9e26070ba2753f52b46f0acef113bcd1690157e2aad1d05c3d7077/PyOPath-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a511e707b885e82e1e68fb69eb05e1e14141e20a7deeb5fa128a3bd8f43790ef",
"md5": "5f18948cbb6ef89aea9f4851d90d7ba3",
"sha256": "594143cb9d6eec5140e75e816ac5b5896a20f2306b55ba5e7f47daffd37c776e"
},
"downloads": -1,
"filename": "pyopath-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "5f18948cbb6ef89aea9f4851d90d7ba3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 21799,
"upload_time": "2024-04-15T23:20:09",
"upload_time_iso_8601": "2024-04-15T23:20:09.366254Z",
"url": "https://files.pythonhosted.org/packages/a5/11/e707b885e82e1e68fb69eb05e1e14141e20a7deeb5fa128a3bd8f43790ef/pyopath-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-15 23:20:09",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pyopath"
}