From c0bc328aff36bfd4fb27b9c4943fa551f8b90b0e Mon Sep 17 00:00:00 2001 From: Vadim Suharnikov Date: Thu, 18 Jan 2024 16:39:32 +0000 Subject: [PATCH] Update readme and some common package info --- README.md | 16 +++++++++++++--- pyproject.toml | 6 ++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 88efb76..99c2c56 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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. ``` diff --git a/pyproject.toml b/pyproject.toml index 8c1fc35..024345d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [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 = "vsuharnikov@gmail.com"}, ] @@ -9,8 +9,10 @@ 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"]