Name | databind-core2 JSON |
Version |
4.2.2
JSON |
| download |
home_page | |
Summary | Databind is a library inspired by jackson-databind to de-/serialize Python dataclasses. Compatible with Python 3.7 and newer. |
upload_time | 2023-01-26 13:10:16 |
maintainer | |
docs_url | None |
author | Niklas Rosenstein |
requires_python | >=3.6.3,<4.0.0 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# databind.core
`databind.core` provides a jackson-databind inspired framework for data de-/serialization in Python. Unless you
are looking to implement support for de-/serializing new data formats, the `databind.core` package alone might
not be what you are looking for (unless you want to use `databind.core.dataclasses` as a drop-in replacement to
the standard library `dataclasses` module, for that check out the section at the bottom).
### Known implementations
* [databind.json](https://pypi.org/project/databind.json)
### Dataclass extension
The standard library `dataclasses` module does not allow to define non-default arguments after default arguments.
You can use `databind.core.dataclasses` as a drop-in replacement to get this feature. It behaves exactly like the
standard library, only that non-default arguments may follow default arguments. Such arguments can be passed to
the constructor as positional or keyword arguments.
```py
from databind.core import dataclasses
@dataclasses.dataclass
class A:
value1: int = 42
@dataclasses.dataclass
class B(A):
value2: str
print(B(0, 'Hello, World!'))
print(B(value2='Answer to the universe'))
```
---
<p align="center">Copyright © 2020 – Niklas Rosenstein</p>
Raw data
{
"_id": null,
"home_page": "",
"name": "databind-core2",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6.3,<4.0.0",
"maintainer_email": "",
"keywords": "",
"author": "Niklas Rosenstein",
"author_email": "rosensteinniklas@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/17/dd/a573c2a184bde42b071cf2ca4fdab81ba81334c3f79bfe248422b5ed48f7/databind_core2-4.2.2.tar.gz",
"platform": null,
"description": "# databind.core\n\n`databind.core` provides a jackson-databind inspired framework for data de-/serialization in Python. Unless you\nare looking to implement support for de-/serializing new data formats, the `databind.core` package alone might\nnot be what you are looking for (unless you want to use `databind.core.dataclasses` as a drop-in replacement to\nthe standard library `dataclasses` module, for that check out the section at the bottom).\n\n### Known implementations\n\n* [databind.json](https://pypi.org/project/databind.json)\n\n### Dataclass extension\n\nThe standard library `dataclasses` module does not allow to define non-default arguments after default arguments.\nYou can use `databind.core.dataclasses` as a drop-in replacement to get this feature. It behaves exactly like the\nstandard library, only that non-default arguments may follow default arguments. Such arguments can be passed to\nthe constructor as positional or keyword arguments.\n\n```py\nfrom databind.core import dataclasses\n\n@dataclasses.dataclass\nclass A:\n value1: int = 42\n\n@dataclasses.dataclass\nclass B(A):\n value2: str\n\nprint(B(0, 'Hello, World!'))\nprint(B(value2='Answer to the universe'))\n```\n\n---\n\n<p align=\"center\">Copyright © 2020 – Niklas Rosenstein</p>\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Databind is a library inspired by jackson-databind to de-/serialize Python dataclasses. Compatible with Python 3.7 and newer.",
"version": "4.2.2",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "10808f308255e5b21a67df25e28395fa21e905f5778b8f31880e6e27f81c3485",
"md5": "26d6ebb820fd10c4ce8ed161a485b38b",
"sha256": "dbdadca665c9892edcbb5b465d6a63ca3d12bbd4fccb798118a10ffea4affcea"
},
"downloads": -1,
"filename": "databind_core2-4.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "26d6ebb820fd10c4ce8ed161a485b38b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6.3,<4.0.0",
"size": 27001,
"upload_time": "2023-01-26T13:10:14",
"upload_time_iso_8601": "2023-01-26T13:10:14.281406Z",
"url": "https://files.pythonhosted.org/packages/10/80/8f308255e5b21a67df25e28395fa21e905f5778b8f31880e6e27f81c3485/databind_core2-4.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "17dda573c2a184bde42b071cf2ca4fdab81ba81334c3f79bfe248422b5ed48f7",
"md5": "1d8813f7bb5b7a42be5be0065cc9b2c6",
"sha256": "dfc963930a557351be62f7cff8278088187ff778647370d5d7c661c7fab9b76d"
},
"downloads": -1,
"filename": "databind_core2-4.2.2.tar.gz",
"has_sig": false,
"md5_digest": "1d8813f7bb5b7a42be5be0065cc9b2c6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.3,<4.0.0",
"size": 23521,
"upload_time": "2023-01-26T13:10:16",
"upload_time_iso_8601": "2023-01-26T13:10:16.088952Z",
"url": "https://files.pythonhosted.org/packages/17/dd/a573c2a184bde42b071cf2ca4fdab81ba81334c3f79bfe248422b5ed48f7/databind_core2-4.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-26 13:10:16",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "databind-core2"
}