From 432945cf18901dd430b394d15ed13d3c16335810 Mon Sep 17 00:00:00 2001 From: Daniel Sanchez Date: Wed, 11 Sep 2024 10:17:29 +0200 Subject: [PATCH] Cleanup and versioning update for 2.0.0 (#23) --- README.md | 31 ------------------------------- setup.py | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/README.md b/README.md index e84d89f..111ba6c 100644 --- a/README.md +++ b/README.md @@ -74,37 +74,6 @@ if __name__ == "__main__": You can find more examples in the `/examples` folder. -## Pydantic -Option and Result are fully compatible with [pydantic](https://pydantic-docs.helpmanual.io/) models - -```python -import pydantic -from rusty_results import Option, Some, Empty - - -class MyData(pydantic.BaseModel): - name: Option[str] - phone: Option[int] - - -if __name__ == "__main__": - import json - # serialize to json - json_data = MyData(name=Some("Link"), phone=Empty()).json() - print(json_data) - # deserialize json data - data = MyData(**json.loads(json_data)) - print(data) - -``` - -prints out: - -```shell -{"name": {"Some": "Link"}, "phone": {}} -name=Some(Some='Link') phone=Empty() -``` - ## Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. diff --git a/setup.py b/setup.py index 72341ef..5474fc0 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="rusty-results", - version="1.1.1", + version="2.0.0", author="Daniel Sanchez Quiros, Antonio Jose Checa Bustos", author_email="sanchez.quiros.daniel@gmail.com, antonio.checa.bustos@gmail.com", description="Rust inspired Result and Option types",