An open API service indexing awesome lists of open source software.

https://github.com/oelin/valory

Validated dataclasses for Python.
https://github.com/oelin/valory

dataclasses python

Last synced: 3 months ago
JSON representation

Validated dataclasses for Python.

Awesome Lists containing this project

README

        

# Valory

Validated dataclasses for Python.

Installation
------------

```sh
pip install git+https://github.com/oelin/valory
```

Usage
-----

```python
from valory import dataclass

@dataclass
class User:
username: str
password: str

def validate(self) -> None:
assert isinstance(self.username, str)
assert isinstance(self.password, str)
```

```python
user = User('Alice', 1234) # Throws an exception.
```