https://github.com/awmleer/scummer
A Python dict validator.
https://github.com/awmleer/scummer
dict python python3 validation validator
Last synced: 2 months ago
JSON representation
A Python dict validator.
- Host: GitHub
- URL: https://github.com/awmleer/scummer
- Owner: awmleer
- License: mit
- Created: 2017-12-07T12:38:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-20T16:12:55.000Z (almost 8 years ago)
- Last Synced: 2025-01-24T07:31:17.847Z (8 months ago)
- Topics: dict, python, python3, validation, validator
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scummer
Python dict validator.## Basic Formats
### Schema
```
{
"key1": ,
"key2": ,
...
}
```### Definition
A definition is one of these three forms:
```
```
```
(, )
``````
[,(, ),...]
```### Meta
A meta is an instance of one of these classes:
```
| |
```### Param
```
{
"required"?: , //default is True
"allow_none"?: , //default is False
"verbose_name"?: ,
...
(some meta specific params)
...
}
```### TypeStr
A `TypeStr` can be a **basic type string**:
```
'any' | 'str' | 'int' | 'float' | 'bool' | 'number' | 'enum'
```or:
```
'array'
```or a **basic type string** with a `[]`, such as:
```
'any[]' | 'str[]' | 'int[]'
```## Meta Specific Params
### map
**definition**: a definition (see above)
### array
**basic_type**: a basic type string
**max_length**: an integer
### str
**basic_type**: a basic type string
**max_length**: an integer
### int
**max**: the upper limit (<=)
**min**: the lower limit (>=)
### float
**max**: the upper limit (<=)
**min**: the lower limit (>=)
### enum
**items**: a list contain the possible values, default as []