Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup and versioning update for 2.0.0 publishing #23

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected], [email protected]",
description="Rust inspired Result and Option types",
Expand Down
Loading