Metadata-Version: 2.1
Name: dataclass-deser
Version: 0.1.0a2
Summary: A simple deserialization library, based on dataclasses and type-hints
Author: Techcable
License: MIT License
Project-URL: Bug Tracker, https://github.com/Techcable/dataclass-deser/issues
Project-URL: Source Code, https://github.com/Techcable/dataclass-deser
Keywords: dataclasses,config,serialize,json,toml
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: typing_extensions>=4.5
Provides-Extra: dev
Requires-Dist: test; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Provides-Extra: mypy
Requires-Dist: mypy>=1; extra == "mypy"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"

# dataclass-deser ![PyPI - Version](https://img.shields.io/pypi/v/dataclass-deser)
A simple deserialization library for python based on dataclasses and type hints.

I've written this code repeatedly across several of my scripts,
so I've decided to publish it to PyPi for reuse.

## Basic Example
```python
@dataclass
class Nested:
    foo: int

@dataclass
class Foo:
    bar: int
    baz: list[int]
    nested: Nested

raw_json = """{
    "bar": 3,
    "baz": [1, 2, 8],
    "nested": {"foo": 42}
}"""
expected = Foo(
    bar=3,
    baz=[1, 2, 8],
    nested=Nested(foo=42)
)

ctx = dataclass_deser.DeserContext()
assert expected == ctx.deser(Foo, json.loads(raw_json))
```

## Status
**WARNING**: This library is **ALPHA qUaLitY**

- [x] Basic primitive deserialization
   - [ ] Support lossless numeric conversions (int -> float)
   - [ ] Support lossy numeric conversion
- [ ] Support for optional types
- [ ] Support for union types (int | str | bytes)
- [ ] Configuration options
   - [x] Allow unused keys
- [ ] Extensibility
   - [ ] Field options via dataclass field.metadata
   - [ ] Newtype wrappers
- [ ] Support more collections
   - [ ] Dictionaries
   - [ ] Tuples
   - [ ] Sets
- [ ] Support enumerations

