Skip to content

Commit

Permalink
Update readme and some common package info
Browse files Browse the repository at this point in the history
  • Loading branch information
vadim-su committed Jan 18, 2024
1 parent 1419d56 commit c0bc328
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# FBEnum

Enhance your enums with robust classes that gracefully handle unknown values
through a fallback mechanism, fully compatible with Pydantic.
Library provides fallback enum functionality. Fully compatible with pydantic.

It can be helpful to have a fallback value for enums, so that unknown values can be
handled gracefully. This is especially useful when working with external data sources
Expand All @@ -23,7 +22,7 @@ pip install fbenum
### Class mixin

Class mixin can be used to enhance any enum class with fallback functionality.
It

```python
from enum import Enum
from fbenum.enum import FallbackEnum
Expand Down Expand Up @@ -155,6 +154,17 @@ if __name__ == '__main__':
# on user cretion status always will be known

users = get_users()
# user == [
# UserResponse(
# name='John Doe',
# email='test@emaik',
# status=1,
# ),
# UserResponse(
# name='Jane Doe',
# email='test2@emaik',
# status=3, # unknown status
# ]
# on users_getting status can be unknown, so using fallback wrapper for response
# model will be a good idea to handle unknown values gracefully.
```
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[project]
name = "fbenum"
version = "1.0.0"
description = "Enhance your enums with robust classes that gracefully handle unknown values through a fallback mechanism, fully compatible with Pydantic."
version = "1.0.1"
description = "Library provides fallback enum functionality. Fully compatible with pydantic."
authors = [
{name = "Vadim Suharnikov", email = "[email protected]"},
]
dependencies = [
"pydantic-core>=2.14.6",
]
requires-python = ">=3.12"
homepage="https://github.com/vadim-su/fbenum"
readme = "README.md"
license = {text = "MIT"}
keywords = ["enum", "pydantic"]

[build-system]
requires = ["pdm-backend"]
Expand Down

0 comments on commit c0bc328

Please sign in to comment.