An open API service indexing awesome lists of open source software.

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.

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 []