cornflakes.decorator.dataclasses.validator package

Submodules

cornflakes.decorator.dataclasses.validator.url module

class cornflakes.decorator.dataclasses.validator.url.AnyUrl(url=None, scheme='', netloc='', path='', params='', query='', fragment='', query_args=<factory>, hostname='', port=None, username=None, password=None, tld=None, valid=False, token=None)[Quellcode]

Bases: object

Database URL.

Variablen:
  • url – URL to init the whole object (will be overwritten with other args).

  • scheme – The scheme of the url

  • netloc – user / pw / host and port of the url

  • path – path of the url

  • query – url query

  • params – url params

  • query_args – url query_args -> parsed query

  • fragment – url fragment

  • hostname – url hostname (overwrites the netloc)

  • port – url port (overwrites the netloc)

  • username – url username (overwrites the netloc)

  • password – url password (overwrites the netloc)

  • tld – url tld if it is valid

  • valid – validators.url validation result

Parameter:
  • url (dataclasses.InitVar[Optional[str]]) –

  • scheme (str) –

  • netloc (str) –

  • path (str) –

  • params (str) –

  • query (str) –

  • fragment (str) –

  • query_args (dict) –

  • hostname (str) –

  • port (int | None) –

  • username (str | None) –

  • password (str | None) –

  • tld (str | None) –

  • valid (bool) –

  • token (str | None) –

classmethod check_kwargs(**kwargs)

Check dataclass types.

Rückgabetyp:

Dict[str, Any]

fragment: str
hostname: str
classmethod keys()
netloc: str
params: str
password: str | None
path: str
port: int | None
query: str
query_args: dict
scheme: str
tld: str | None
to_dict()

Method to convert Dataclass with slots to dict.

Rückgabetyp:

dict

to_tuple()

Method to convert Dataclass with slots to dict.

Rückgabetyp:

Any

token: str | None
url: dataclasses.InitVar[Optional[str]] = None
username: str | None
valid: bool
classmethod validate_kwargs(force=True, **kwargs)

Validate dataclass (includes type checks + validators).

Module contents

cornflakes default validators for config_fields.

class cornflakes.decorator.dataclasses.validator.AnyUrl(url=None, scheme='', netloc='', path='', params='', query='', fragment='', query_args=<factory>, hostname='', port=None, username=None, password=None, tld=None, valid=False, token=None)[Quellcode]

Bases: object

Database URL.

Variablen:
  • url – URL to init the whole object (will be overwritten with other args).

  • scheme – The scheme of the url

  • netloc – user / pw / host and port of the url

  • path – path of the url

  • query – url query

  • params – url params

  • query_args – url query_args -> parsed query

  • fragment – url fragment

  • hostname – url hostname (overwrites the netloc)

  • port – url port (overwrites the netloc)

  • username – url username (overwrites the netloc)

  • password – url password (overwrites the netloc)

  • tld – url tld if it is valid

  • valid – validators.url validation result

Parameter:
  • url (dataclasses.InitVar[Optional[str]]) –

  • scheme (str) –

  • netloc (str) –

  • path (str) –

  • params (str) –

  • query (str) –

  • fragment (str) –

  • query_args (dict) –

  • hostname (str) –

  • port (int | None) –

  • username (str | None) –

  • password (str | None) –

  • tld (str | None) –

  • valid (bool) –

  • token (str | None) –

classmethod check_kwargs(**kwargs)

Check dataclass types.

Rückgabetyp:

Dict[str, Any]

fragment: str
hostname: str
classmethod keys()
netloc: str
params: str
password: str | None
path: str
port: int | None
query: str
query_args: dict
scheme: str
tld: str | None
to_dict()

Method to convert Dataclass with slots to dict.

Rückgabetyp:

dict

to_tuple()

Method to convert Dataclass with slots to dict.

Rückgabetyp:

Any

token: str | None
url: dataclasses.InitVar[Optional[str]] = None
username: str | None
valid: bool
classmethod validate_kwargs(force=True, **kwargs)

Validate dataclass (includes type checks + validators).