# Object To Dictionary
`obj-todict` is a simple utility to recursively convert objects to dictionaries. This can be particularly useful for serializing complex nested objects into JSON-compatible dictionaries.
## Features
- Recursively converts objects, including nested lists and dictionaries, into dictionaries.
- Handles custom objects by converting their `__dict__` attributes.
## Installation
You can install the package using pip:
```bash
pip install obj-todict
```
# Usage
Here's a quick example to get you started:
```python
from obj_todict import todict
class Example:
def __init__(self, name, value):
self.name = name
self.value = value
example = Example('example', [1, 2, {'key': 'value'}])
print(todict(example))
```
# License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/neural-blade/obj-todict/tree/main?tab=MIT-1-ov-file#MIT-1-ov-file) file for more details.
Raw data
{
"_id": null,
"home_page": "https://github.com/neural-blade/obj-todict",
"name": "obj-todict",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "to_dict, object to dict, recursive, serialization, utility, dictionary",
"author": "neural-blade",
"author_email": "carmeloscaccianoce@icloud.com",
"download_url": "https://files.pythonhosted.org/packages/b8/1a/00a8c9db2a425650e2d9e53b17b4321ffafcb811f8a5daccca6a441e4ed3/obj_todict-0.1.0.tar.gz",
"platform": null,
"description": "# Object To Dictionary\n\n`obj-todict` is a simple utility to recursively convert objects to dictionaries. This can be particularly useful for serializing complex nested objects into JSON-compatible dictionaries.\n\n## Features\n\n- Recursively converts objects, including nested lists and dictionaries, into dictionaries.\n- Handles custom objects by converting their `__dict__` attributes.\n\n## Installation\n\nYou can install the package using pip:\n\n```bash\npip install obj-todict\n```\n\n# Usage\n\nHere's a quick example to get you started:\n\n```python\nfrom obj_todict import todict\n\nclass Example:\n def __init__(self, name, value):\n self.name = name\n self.value = value\n\nexample = Example('example', [1, 2, {'key': 'value'}])\nprint(todict(example))\n```\n\n# License\n\nThis project is licensed under the MIT License. See the [LICENSE](https://github.com/neural-blade/obj-todict/tree/main?tab=MIT-1-ov-file#MIT-1-ov-file) file for more details.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "It is a simple utility to recursively convert objects to dictionaries",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/neural-blade/obj-todict",
"Repository": "https://github.com/neural-blade/obj-todict"
},
"split_keywords": [
"to_dict",
" object to dict",
" recursive",
" serialization",
" utility",
" dictionary"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6d7d878ec80eb935fa6d71ada876ec5998b492b711350e2bdfcfdf3c8413d14a",
"md5": "4c2d22c46c57176f4532ddf0d0f54702",
"sha256": "5a332453ec9fed92ace80f79a2eef44ebce9b3b4d662ccfbfd3b1c04d24b03e9"
},
"downloads": -1,
"filename": "obj_todict-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4c2d22c46c57176f4532ddf0d0f54702",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 2956,
"upload_time": "2024-07-25T21:53:48",
"upload_time_iso_8601": "2024-07-25T21:53:48.791559Z",
"url": "https://files.pythonhosted.org/packages/6d/7d/878ec80eb935fa6d71ada876ec5998b492b711350e2bdfcfdf3c8413d14a/obj_todict-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b81a00a8c9db2a425650e2d9e53b17b4321ffafcb811f8a5daccca6a441e4ed3",
"md5": "3d4b49b0c03f73cd8b2419f9eae06033",
"sha256": "46b514fdf2e4d030a42d63bbafee2f80a71bc25026c07e94f833c099f5b76710"
},
"downloads": -1,
"filename": "obj_todict-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "3d4b49b0c03f73cd8b2419f9eae06033",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 2422,
"upload_time": "2024-07-25T21:53:50",
"upload_time_iso_8601": "2024-07-25T21:53:50.523906Z",
"url": "https://files.pythonhosted.org/packages/b8/1a/00a8c9db2a425650e2d9e53b17b4321ffafcb811f8a5daccca6a441e4ed3/obj_todict-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-25 21:53:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "neural-blade",
"github_project": "obj-todict",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "obj-todict"
}