overscore
=========
Library for double underscore access notation
Overscore provides a way to retrieve (and store) multi-dimensional data using a single string
with double underscores.
Inspired by Django, the access string can be used as a routine argument or a URL parameter,
allowing for complex access within simple contexts::
import overscore
data = {
"things": {
"a": {
"b": [
{
"1": "yep"
}
]
}
}
}
overscore.get(data, "things__a__b__0____1")
# "yep"
All keys/indexes are separated by double underscores. Extra underscores dictate how to
parse that place in the path.
.. list-table:: Underscores and Behavior
:header-rows: 1
* - Underscores
- Following
- Meaning
- Example
- Equivalent
* - 2
- letters and numbers
- key
- a__b
- ["a"]["b"]
* - 2
- numbers
- index
- a__1
- ["a"][1]
* - 3
- numbers
- negative index
- a___2
- ["a"][-2]
* - 4
- numbers
- numerical key
- a____3
- ["a"]["3"]
* - 5
- numbers
- neagtive numerical key
- a_____4
- ["a"]["-4"]
Raw data
{
"_id": null,
"home_page": "https://overscore.readthedocs.io/en/0.1.2/",
"name": "overscore",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Gaffer Fitch",
"author_email": "overscore@gaf3.com",
"download_url": "https://files.pythonhosted.org/packages/1f/d3/ea9fc7e0865844a1c44877dc607c773d80034fe96993d7d55acd62fa28f5/overscore-0.1.2.tar.gz",
"platform": null,
"description": "overscore\n=========\n\nLibrary for double underscore access notation\n\nOverscore provides a way to retrieve (and store) multi-dimensional data using a single string\nwith double underscores.\n\nInspired by Django, the access string can be used as a routine argument or a URL parameter,\nallowing for complex access within simple contexts::\n\n import overscore\n\n data = {\n \"things\": {\n \"a\": {\n \"b\": [\n {\n \"1\": \"yep\"\n }\n ]\n }\n }\n }\n\n overscore.get(data, \"things__a__b__0____1\")\n # \"yep\"\n\nAll keys/indexes are separated by double underscores. Extra underscores dictate how to\nparse that place in the path.\n\n.. list-table:: Underscores and Behavior\n :header-rows: 1\n\n * - Underscores\n - Following\n - Meaning\n - Example\n - Equivalent\n * - 2\n - letters and numbers\n - key\n - a__b\n - [\"a\"][\"b\"]\n * - 2\n - numbers\n - index\n - a__1\n - [\"a\"][1]\n * - 3\n - numbers\n - negative index\n - a___2\n - [\"a\"][-2]\n * - 4\n - numbers\n - numerical key\n - a____3\n - [\"a\"][\"3\"]\n * - 5\n - numbers\n - neagtive numerical key\n - a_____4\n - [\"a\"][\"-4\"]\n",
"bugtrack_url": null,
"license": null,
"summary": "Double underscore access notation",
"version": "0.1.2",
"project_urls": {
"Download": "https://github.com/gaf3/overscore",
"Homepage": "https://overscore.readthedocs.io/en/0.1.2/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d14e05070ce30982fb412b63ee23cbe1121070b889ff405b95a0e2343eca2ab4",
"md5": "0ba03855cfeb16ca62a588bbe8597f03",
"sha256": "65f197611c39a9448f2cc82fbca404daff864100f05b8c2919fbf173d18c5a85"
},
"downloads": -1,
"filename": "overscore-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0ba03855cfeb16ca62a588bbe8597f03",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4714,
"upload_time": "2024-12-07T14:00:40",
"upload_time_iso_8601": "2024-12-07T14:00:40.200654Z",
"url": "https://files.pythonhosted.org/packages/d1/4e/05070ce30982fb412b63ee23cbe1121070b889ff405b95a0e2343eca2ab4/overscore-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1fd3ea9fc7e0865844a1c44877dc607c773d80034fe96993d7d55acd62fa28f5",
"md5": "43ea8965601257d82150c272e2d5b5d7",
"sha256": "2815b717c9a65443c41163e04781de91e6974d46aa25165b2dd90abd336dec5e"
},
"downloads": -1,
"filename": "overscore-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "43ea8965601257d82150c272e2d5b5d7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4804,
"upload_time": "2024-12-07T14:00:41",
"upload_time_iso_8601": "2024-12-07T14:00:41.725880Z",
"url": "https://files.pythonhosted.org/packages/1f/d3/ea9fc7e0865844a1c44877dc607c773d80034fe96993d7d55acd62fa28f5/overscore-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-07 14:00:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gaf3",
"github_project": "overscore",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "MarkupSafe",
"specs": [
[
"==",
"2.1.5"
]
]
},
{
"name": "sphinxter",
"specs": [
[
"==",
"0.1.7"
]
]
},
{
"name": "ptvsd",
"specs": [
[
"==",
"4.3.2"
]
]
},
{
"name": "coverage",
"specs": [
[
"==",
"6.4.2"
]
]
},
{
"name": "pylint",
"specs": [
[
"==",
"2.14.5"
]
]
}
],
"lcname": "overscore"
}