API Reference
This section provides complete documentation for all public classes and functions.
Core API
x-zic - TZDB Parser Copyright (C) 2024 Your Name
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
- x_zic.get_transitions(zone_name, start_year=1970, end_year=2030)[source]
Get timezone transitions for a zone.
- class x_zic.FileLoader(config)[source]
Bases:
objectSmart file loader with caching
- Parameters:
config (TZDBConfig) –
- __init__(config)[source]
- Parameters:
config (TZDBConfig) –
- class x_zic.TZDBConfig(tzdb_source_path='tzdb-2025b', cache_dir='.tzdb_cache', cache_enabled=True, cache_version='1.0', max_transition_years=100, region_files=None, legacy_files=None, geo_files=None)[source]
Bases:
objectConfiguration for TZDB parser
- Parameters:
- __init__(tzdb_source_path='tzdb-2025b', cache_dir='.tzdb_cache', cache_enabled=True, cache_version='1.0', max_transition_years=100, region_files=None, legacy_files=None, geo_files=None)
Core Module
Configuration
Configuration and constants Copyright (C) 2024 Your Name
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
- class x_zic.core.config.TZDBConfig(tzdb_source_path='tzdb-2025b', cache_dir='.tzdb_cache', cache_enabled=True, cache_version='1.0', max_transition_years=100, region_files=None, legacy_files=None, geo_files=None)[source]
Configuration for TZDB parser
- Parameters:
- __init__(tzdb_source_path='tzdb-2025b', cache_dir='.tzdb_cache', cache_enabled=True, cache_version='1.0', max_transition_years=100, region_files=None, legacy_files=None, geo_files=None)
Models
Data models for TZDB entities Copyright (C) 2024 Your Name
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
- class x_zic.core.models.Zone(name, offset, rules, format, until=None, region=None, line_number=None)[source]
Timezone zone definition
- Parameters:
- class x_zic.core.models.Rule(name, from_year, to_year, type, month, day, time, save, letter, region=None, line_number=None)[source]
DST rule definition
- Parameters:
- __init__(name, from_year, to_year, type, month, day, time, save, letter, region=None, line_number=None)
- class x_zic.core.models.Transition(zone, timestamp, offset_before, offset_after, is_dst, abbrev)[source]
Timezone transition
- Parameters:
Loader
File loading with caching Copyright (C) 2024 Your Name
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
- class x_zic.core.loader.FileLoader(config)[source]
Smart file loader with caching
- Parameters:
config (TZDBConfig) –
- __init__(config)[source]
- Parameters:
config (TZDBConfig) –
Parser Module
Base Parser
Base parser with common utilities Copyright (C) 2024 Your Name
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Zone Parser
Zone parser Copyright (C) 2024 Your Name
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Rule Parser
Rule parser Copyright (C) 2024 Your Name
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Link Parser
Link parser Copyright (C) 2024 Your Name
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Regions Module
Region file management Copyright (C) 2024 Your Name
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Transitions Module
Transition calculations
- x_zic.transitions.get_transitions(zone_name, start_year=1970, end_year=2030, loader=None)[source]
Calculate transitions for a zone.
Calculator
Transition calculator - core DST logic
- x_zic.transitions.calculator.get_transitions(zone_name, start_year=1970, end_year=2030, loader=None)[source]
Calculate transitions for a zone.