hc package

Submodules

hc.cli module

Command line interface of hc

hc.cli.main()

hc.datatypes module

Data types definition

class hc.datatypes.MonthDayList

Bases: list

class hc.datatypes.PhData

Bases: list

hc.datatypes.fix_data_types(dataset)
hc.datatypes.fix_ph_data(dataset)

hc.defaults module

hc defaults

hc.helpers module

hc helpers

hc.helpers.get_date_from_relative_month(relative_month)
hc.helpers.get_month_number(month_name)
hc.helpers.get_relative_month(date)

hc.opening_hours_js module

OpenStreetMap opening_hours.js format. Refer to https://github.com/opening-hours/opening_hours.js/blob/master/holidays/README.md for the “spec”.

class hc.opening_hours_js.OpeningHoursJS(defs=None)

Bases: object

FIRST_LEVEL_SORTING = {'PH': '20', 'SH': '30', '_nominatim_url': '10'}
SH_DATA_SORTING = {'name': '0'}
get_school_holidays(out=None)
read(in_defs)
static update_sh_format(sh_data)
hc.opening_hours_js.find_ind(lst, key, value)

hc.schulferien_org module

schulferien.org interface

class hc.schulferien_org.SchulferienOrg(defs=None, cache=True, cache_dir=None)

Bases: object

get_month_dataset(date)
get_school_holidays(from_date, to_date)

hc.yaml module

YAML representation

class hc.yaml.PrettyHolidayYAMLDumper(stream, default_style=None, default_flow_style=None, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None, block_seq_indent=None, top_level_colon_align=None, prefix_colon=None)

Bases: ruamel.yaml.dumper.RoundTripDumper

YAML dumper optimized human readability of the holiday format.

represent_dict(data)
represent_list(data)
yaml_representers = {<type 'NoneType'>: <unbound method RoundTripRepresenter.represent_none>, <type 'float'>: <unbound method SafeRepresenter.represent_float>, <type 'set'>: <unbound method SafeRepresenter.represent_set>, <type 'str'>: <unbound method SafeRepresenter.represent_str>, <type 'datetime.datetime'>: <unbound method SafeRepresenter.represent_datetime>, <type 'long'>: <unbound method SafeRepresenter.represent_long>, None: <unbound method SafeRepresenter.represent_undefined>, <class 'collections.OrderedDict'>: <unbound method PrettyHolidayYAMLDumper.represent_dict>, <class 'ruamel.yaml.comments.CommentedSeq'>: <unbound method RoundTripRepresenter.represent_list>, <type 'bool'>: <unbound method SafeRepresenter.represent_bool>, <type 'tuple'>: <unbound method SafeRepresenter.represent_list>, <class 'hc.datatypes.PhData'>: <unbound method PrettyHolidayYAMLDumper.represent_list>, <type 'datetime.date'>: <unbound method SafeRepresenter.represent_date>, <class 'ruamel.yaml.scalarstring.DoubleQuotedScalarString'>: <unbound method RoundTripRepresenter.represent_double_quoted_scalarstring>, <class 'ruamel.yaml.scalarstring.SingleQuotedScalarString'>: <unbound method RoundTripRepresenter.represent_single_quoted_scalarstring>, <class 'ruamel.yaml.scalarstring.PreservedScalarString'>: <unbound method RoundTripRepresenter.represent_preserved_scalarstring>, <type 'unicode'>: <unbound method SafeRepresenter.represent_unicode>, <class 'ruamel.yaml.comments.CommentedMap'>: <unbound method RoundTripRepresenter.represent_dict>, <class 'ruamel.yaml.scalarint.HexCapsInt'>: <unbound method RoundTripRepresenter.represent_hex_caps_int>, <class 'ruamel.yaml.comments.CommentedSet'>: <unbound method RoundTripRepresenter.represent_set>, <type 'dict'>: <unbound method PrettyHolidayYAMLDumper.represent_dict>, <class 'ruamel.yaml.scalarint.HexInt'>: <unbound method RoundTripRepresenter.represent_hex_int>, <type 'int'>: <unbound method SafeRepresenter.represent_int>, <type 'list'>: <unbound method SafeRepresenter.represent_list>, <class 'ruamel.yaml.scalarint.OctalInt'>: <unbound method RoundTripRepresenter.represent_octal_int>, <class 'ruamel.yaml.compat.ordereddict'>: <unbound method SafeRepresenter.represent_ordereddict>, <class 'ruamel.yaml.scalarint.BinaryInt'>: <unbound method RoundTripRepresenter.represent_binary_int>, <class 'ruamel.yaml.comments.CommentedOrderedMap'>: <unbound method RoundTripRepresenter.represent_ordereddict>, <class 'ruamel.yaml.timestamp.TimeStamp'>: <unbound method RoundTripRepresenter.represent_datetime>, <class 'ruamel.yaml.scalarint.ScalarInt'>: <unbound method RoundTripRepresenter.represent_scalar_int>, <class 'hc.datatypes.MonthDayList'>: <unbound method PrettyHolidayYAMLDumper.represent_list>}
hc.yaml.dump_holidays_as_yaml(unserialized_data, add_vspacing=True)
hc.yaml.get_clean_yaml(serialized_data, add_vspacing=False)

Module contents

Holiday converter tool