# jobject
[![pypi version](https://img.shields.io/pypi/v/jobject.svg)](https://pypi.org/project/jobject) ![MIT License](https://img.shields.io/pypi/l/jobject.svg)
jobject: A dictionary replacement that gives additional access to data using C struct notation, just like JavaScript Objects
## Installation
```bash
pip install jobject
```
## Import
```python
from jobject import jobject
my_dict = jobject({'one': 1, 'two': 2, 'three': 3})
print(my_dict.three) # prints '3'
```
## Inheritance
Because jobject extends dict it can be dropped into any code that requires
dict notation or iteration. Because of this, jobject makes sure any dictionary
instances that are passed to it are also converted into jobjects
```python
from jobject import jobject
my_dict = jobject({
'one': {
'two': {
'three': 123
}
}
})
print(my_dict.one.two.three) # prints '123'
```
It will even follow lists to make sure everything under it is converted to a
jobject
```python
from jobject import jobject
my_dict = jobject({
'array': [
{'one': 1},
{'two': 2},
{'three': 3}
]
})
print(my_dict[2].three) # prints '3'
```
This even includes data set after the fact
```python
from jobject import jobject
my_dict = jobject()
my_dict.test = {
'one': [
{'two': 2}
]
}
print(my_dict.test.one[0].two) # prints '2'
print(my_dict['test']['one'][0]['two']) # prints '2'
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ouroboroscoding/jobject",
"name": "jobject",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "javascript,object,struct",
"author": "Chris Nasr - Ouroboros Coding Inc.",
"author_email": "chris@ouroboroscoding.com",
"download_url": "https://files.pythonhosted.org/packages/1d/dc/c92a9dd48d6027c10a406e33ebcc879377ca834ea5d93f0bd2c215841bca/jobject-1.0.2.tar.gz",
"platform": null,
"description": "# jobject\n\n[![pypi version](https://img.shields.io/pypi/v/jobject.svg)](https://pypi.org/project/jobject) ![MIT License](https://img.shields.io/pypi/l/jobject.svg)\n\njobject: A dictionary replacement that gives additional access to data using C struct notation, just like JavaScript Objects\n\n## Installation\n```bash\npip install jobject\n```\n\n## Import\n```python\nfrom jobject import jobject\n\nmy_dict = jobject({'one': 1, 'two': 2, 'three': 3})\n\nprint(my_dict.three) # prints '3'\n```\n\n## Inheritance\nBecause jobject extends dict it can be dropped into any code that requires\ndict notation or iteration. Because of this, jobject makes sure any dictionary\ninstances that are passed to it are also converted into jobjects\n\n```python\nfrom jobject import jobject\n\nmy_dict = jobject({\n\t'one': {\n\t\t'two': {\n\t\t\t'three': 123\n\t\t}\n\t}\n})\n\nprint(my_dict.one.two.three) # prints '123'\n```\n\nIt will even follow lists to make sure everything under it is converted to a\njobject\n\n```python\nfrom jobject import jobject\n\nmy_dict = jobject({\n\t'array': [\n\t\t{'one': 1},\n\t\t{'two': 2},\n\t\t{'three': 3}\n\t]\n})\n\nprint(my_dict[2].three) # prints '3'\n```\n\nThis even includes data set after the fact\n\n```python\nfrom jobject import jobject\n\nmy_dict = jobject()\n\nmy_dict.test = {\n\t'one': [\n\t\t{'two': 2}\n\t]\n}\n\nprint(my_dict.test.one[0].two) # prints '2'\nprint(my_dict['test']['one'][0]['two']) # prints '2'\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "jobject: A dictionary replacement that gives additional access to data using C struct notation, just like JavaScript Objects",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/ouroboroscoding/jobject",
"Source": "https://github.com/ouroboroscoding/jobject",
"Tracker": "https://github.com/ouroboroscoding/jobject/issues"
},
"split_keywords": [
"javascript",
"object",
"struct"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1ddcc92a9dd48d6027c10a406e33ebcc879377ca834ea5d93f0bd2c215841bca",
"md5": "faa850c1b4dd46dde04f46bd672f6ca6",
"sha256": "4474a0360420623265b53c6bd1beb6a4bc1d0e94331f6a2e23ccfc2b312c382c"
},
"downloads": -1,
"filename": "jobject-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "faa850c1b4dd46dde04f46bd672f6ca6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 4222,
"upload_time": "2023-08-24T11:13:44",
"upload_time_iso_8601": "2023-08-24T11:13:44.483402Z",
"url": "https://files.pythonhosted.org/packages/1d/dc/c92a9dd48d6027c10a406e33ebcc879377ca834ea5d93f0bd2c215841bca/jobject-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-24 11:13:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ouroboroscoding",
"github_project": "jobject",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "jobject"
}