izxxr / oblate Goto Github PK
View Code? Open in Web Editor NEWPython library for data validation
Home Page: https://oblate.readthedocs.io
License: MIT License
Python library for data validation
Home Page: https://oblate.readthedocs.io
License: MIT License
This was a feature in 0.x version but was removed in 1.x rewrite due to various design constraints but with the introduction of contextual objects and various other features that resolves those design issues, this could be reconsidered.
fields.primitive.String
fields.primitive.Integer
fields.primitive.Float
fields.primitive.Boolean
fields.nesting.Object
fields.nesting.Partial
fields.types.Union
fields.types.Any
fields.types.Literal
fields.types.TypeExpr
fields.structs.Dict
fields.structs.TypedDict
fields.structs.List
fields.structs.Set
fields.structs.Tuple
fields.stdlib.Date
fields.stdlib.DateTime
fields.stdlib.Enum
fields.stdlib.UUID
fields.special.Email
fields.special.URL
fields.special.PhoneNumber
fields.special.PaymentCardNumber
fields.special.Color
fields.special.Coordinates
fields.special.FilePath
validate.Length
validate.RegEx
validate.Range
validate.Exclude
validate.Or
Allow using type annotations for registering the fields similar to how dataclasses and pydantic register fields.
This needs consideration on which standard type maps to which Oblate field along with several other design constraints such as dealing with PEP 563. Should be implemented before #6
F
: field mapping to some type
Standard (Python) type | Oblate Field |
---|---|
str |
fields.String |
int |
fields.Integer |
float |
fields.Float |
bool |
fields.Boolean |
oblate.Schema |
fields.Object |
list |
fields.List |
set |
fields.Set |
dict |
fields.Dict |
typing.TypedDict |
fields.TypedDict |
typing.Union |
fields.Union |
typing.Literal |
fields.Literal |
typing.Any |
fields.Any |
Type expressions [1] | fields.TypeExpr |
Optional[F] |
F(null=True) |
field_name: F = v |
F(default=v) |
NotStrict[F] [2] |
F(strict=False) |
NotRequired[F] [2] |
F(required=False) |
NotRequired[F] [2] |
F(required=False) |
[1] It needs consideration whether there should be a generic class that maps to the TypeExpr
field
[2] These types would be provided by the new oblate.types
module (e.g. oblate.types.NotRequired
etc.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.