pyfwf.columns module

The MIT License (MIT)

Copyright 2015 Umbrella Tech.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class pyfwf.columns.AbstractColumn(_name: str, size: int, description: str = None)[source]

Bases: Hydrator

property end
hydrating_args = ['name', 'size', 'description']
to_str(value: str)[source]
to_str_assertion(value)[source]
to_str_assertion_class = None
to_str_assertion_types = None
to_str_none_pad = None
to_str_pad_template = None
to_value(slice)[source]
class pyfwf.columns.CharColumn(_name: str, size: int, description: str = None)[source]

Bases: AbstractColumn

to_str_assertion_class

alias of str

to_str_assertion_types = 'str'
to_str_none_pad = ' '
to_str_pad_template = '{0: <%d}'
to_value(slice: str)[source]
class pyfwf.columns.DateColumn(_name: str, _format: str = '%d%m%Y', description: str = None)[source]

Bases: DateTimeColumn

format_num_elements = 3
to_str_assertion_class

alias of date

to_str_assertion_types = 'date'
to_value(slice: str)[source]
class pyfwf.columns.DateTimeColumn(_name: str, _format: str = '%d%m%Y%H%M', description: str = None)[source]

Bases: AbstractColumn

format_num_elements = 5
hydrating_args = ['name', 'format', 'description']
to_str(value: datetime)[source]
to_str_assertion_class

alias of datetime

to_str_assertion_types = 'datetime'
to_str_none_pad = '0'
to_value(slice: str)[source]
class pyfwf.columns.PositiveDecimalColumn(_name: str, size: int, decimals: int = 2, description: str = None)[source]

Bases: PositiveIntegerColumn

hydrating_args = ['name', 'size', 'decimals', 'description']
to_str(value: str)[source]
to_str_assertion(value)[source]
to_str_assertion_class

alias of float

to_str_assertion_types = 'positive decimal'
to_value(slice: str)[source]
class pyfwf.columns.PositiveIntegerColumn(_name: str, size: int, description: str = None)[source]

Bases: AbstractColumn

to_str_assertion(value)[source]
to_str_assertion_class

alias of int

to_str_assertion_types = 'positive int'
to_str_none_pad = '0'
to_str_pad_template = '{0:0%dd}'
to_value(slice: str)[source]
class pyfwf.columns.RightCharColumn(_name: str, size: int, description: str = None)[source]

Bases: CharColumn

to_str_pad_template = '{0: >%d}'
class pyfwf.columns.TimeColumn(_name: str, _format: str = '%H%M', description: str = None)[source]

Bases: DateTimeColumn

format_num_elements = 2
to_str_assertion_class

alias of time

to_str_assertion_types = 'time'
to_value(slice: str)[source]