Python: module simpleparse.common.iso_date

simpleparse.common.iso_date | index /home/mcfletch/pylive/simpleparse/common/iso_date.py

`Canonical ISO date format YYYY-MM-DDTHH:mm:SS+HH:mm
This parser is _extremely_ strict, and the dates that match it,
though really easy to work with for the computer, are not particularly
readable. See the iso_date_loose module for a slightly relaxed
definition which allows the "T" character to be replaced by a
" " character, and allows a space before the timezone offset, as well
as allowing the integer values to use non-0-padded integers.
ISO_date -- YYYY-MM-DD format, with a month and date optional
ISO_time -- HH:mm:SS format, with minutes and seconds optional
ISO_date_time -- YYYY-MM-DD HH:mm:SS+HH:mm format,
with time optional and TimeZone offset optional
Interpreter:
MxInterpreter
Interprets the parse tree as mx.DateTime values
ISO_date and ISO_time
returns DateTime objects
Time only
returns RelativeDateTime object which, when
added to a DateTime gives you the given time
within that day`

Modules
`` |  |
mx.DateTime simpleparse.common.chartypes | simpleparse.common simpleparse.common.numbers | simpleparse.objectgenerator |

Classes
`` |  | DispatchProcessor(Processor) MxInterpreter
class MxInterpreter(DispatchProcessor)
`` | `Interpret a parsed ISO_date_time_loose in GMT/UTC time or localtime`
| Method resolution order: MxInterpreter DispatchProcessor Processor MethodSource Methods defined here: ISO_date(self, (tag, left, right, sublist), buffer) `Interpret the ISO date format` ISO_date_time(self, (tag, left, right, sublist), buffer) `Interpret the loose ISO date + time format` ISO_time(self, (tag, left, right, sublist), buffer) `Interpret the ISO time format` __init__(self, inputLocal=1, returnLocal=1) offset(self, (tag, left, right, sublist), buffer) `Calculate the time zone offset as a date-time delta` offset_sign(self, (tag, left, right, sublist), buffer) `Interpret the offset sign as a multiplier` Data and other attributes defined here: dateName = 'ISO_date' day = <IntInterpreter object @ 46912541558904> `Interpret an integer (or unsigned integer) string as an integer` hour = <IntInterpreter object @ 46912541558904> `Interpret an integer (or unsigned integer) string as an integer` integer = <IntInterpreter object @ 46912541558904> `Interpret an integer (or unsigned integer) string as an integer` minute = <IntInterpreter object @ 46912541558904> `Interpret an integer (or unsigned integer) string as an integer` month = <IntInterpreter object @ 46912541558904> `Interpret an integer (or unsigned integer) string as an integer` offset_hour = <IntInterpreter object @ 46912541558904> `Interpret an integer (or unsigned integer) string as an integer` offset_minute = <IntInterpreter object @ 46912541558904> `Interpret an integer (or unsigned integer) string as an integer` second = <IntInterpreter object @ 46912541558904> `Interpret an integer (or unsigned integer) string as an integer` timeName = 'ISO_time' year = <IntInterpreter object @ 46912541558904> `Interpret an integer (or unsigned integer) string as an integer` Methods inherited from DispatchProcessor: __call__(self, value, buffer) `Process the results of the parsing run over buffer Value can either be: (success, tags, next) for a top-level production, or (tag, left, right, children) for a non-top production.` Methods inherited from Processor: __repr__(self) `Return a representation of the class`

Data
`` |  | _p = <simpleparse.parser.Parser instance> c = {'ISO_date': LibraryElement( production = 'ISO_date', ...enerator.Generator instance at 0x2aaaad5dca28>, ), 'ISO_date_time': LibraryElement( production = 'ISO_date_time'...enerator.Generator instance at 0x2aaaad5dca28>, ), 'ISO_time': LibraryElement( production = 'ISO_time', ...enerator.Generator instance at 0x2aaaad5dca28>, )} declaration = '\nyear := digit,digit,digit,digit\nmonth ...ate_time := ISO_date, ([T], ISO_time)?, offset?\n' haveMX = 1 name = 'ISO_date_time'