Date

class ase2sprkkr.common.grammar_types.basic.Date(prefix=None, postfix=None, format='', after_format=None, default_value=None, condition=None, after_convert=None, description='', min=None, max=None)[source]

A date value of the form ‘DD.MM.YYYY’

Class hierarchy

Inheritance diagram of ase2sprkkr.common.grammar_types.basic.Date

Constructor

Parameters:
  • prefix (str | None) –

  • postfix (str | None) –

  • format (str) –

  • after_format (str | None) –

  • default_value (Any) –

  • condition (Callable[[Any], bool | str] | None) –

  • after_convert (Callable[[Any], Any] | None) –

  • min (int | None) –

  • max (int | None) –

__init__(prefix=None, postfix=None, format='', after_format=None, default_value=None, condition=None, after_convert=None, description='', min=None, max=None)
Parameters:
  • min (int | None) – Minimal allowed value.

  • max (int | None) – Maximal allowed value.

  • prefix (str | None) –

  • postfix (str | None) –

  • format (str) –

  • after_format (str | None) –

  • default_value (Any) –

  • condition (Callable[[Any], bool | str] | None) –

  • after_convert (Callable[[Any], Any] | None) –

_grammar = Re:('(?P<d>\d{2}).(?P<m>\d{2}).(?P<y>\d{4})')
Parameters:

name (str | None) –

Return type:

ParserElement

grammar_name()[source]

Human readable expression of the grammar. By default, this is what is set by grammar.setName, however, sometimes is desirable to set even shorter string

_string(val)[source]

Convert the value to the ouput.

The string() apply format and do some additional transformation (add prefix, postfix etc.), so the actual way how to convert the value for the output should be here.

numpy_type

alias of date

type_name = 'date'
I = <Date>
allowed_types = (<class 'datetime.date'>,)
datatype

alias of date

datatype_name = 'date'