taipower-tou 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. taipower_tou-0.1.0/CHANGELOG.md +62 -0
  2. taipower_tou-0.1.0/LICENSE +21 -0
  3. taipower_tou-0.1.0/MANIFEST.in +4 -0
  4. taipower_tou-0.1.0/PKG-INFO +1356 -0
  5. taipower_tou-0.1.0/README.md +1316 -0
  6. taipower_tou-0.1.0/pyproject.toml +72 -0
  7. taipower_tou-0.1.0/setup.cfg +4 -0
  8. taipower_tou-0.1.0/src/taipower_tou/__init__.py +319 -0
  9. taipower_tou-0.1.0/src/taipower_tou/billing.py +1602 -0
  10. taipower_tou-0.1.0/src/taipower_tou/calendar.py +320 -0
  11. taipower_tou-0.1.0/src/taipower_tou/custom.py +266 -0
  12. taipower_tou-0.1.0/src/taipower_tou/data/__init__.py +1 -0
  13. taipower_tou-0.1.0/src/taipower_tou/data/plans.json +3593 -0
  14. taipower_tou-0.1.0/src/taipower_tou/data/plans_summary.md +44 -0
  15. taipower_tou-0.1.0/src/taipower_tou/data//347/260/241/350/246/201/351/233/273/345/203/271/350/241/250.pdf +0 -0
  16. taipower_tou-0.1.0/src/taipower_tou/data//350/251/263/347/264/260/351/233/273/345/203/271/350/241/250.md +2629 -0
  17. taipower_tou-0.1.0/src/taipower_tou/data//350/251/263/347/264/260/351/233/273/345/203/271/350/241/250.pdf +0 -0
  18. taipower_tou-0.1.0/src/taipower_tou/data//350/251/263/347/264/260/351/233/273/345/203/271/350/241/250.txt +2622 -0
  19. taipower_tou-0.1.0/src/taipower_tou/errors.py +35 -0
  20. taipower_tou-0.1.0/src/taipower_tou/factory.py +345 -0
  21. taipower_tou-0.1.0/src/taipower_tou/models.py +114 -0
  22. taipower_tou-0.1.0/src/taipower_tou/rates.py +67 -0
  23. taipower_tou-0.1.0/src/taipower_tou/tariff.py +820 -0
  24. taipower_tou-0.1.0/src/taipower_tou.egg-info/PKG-INFO +1356 -0
  25. taipower_tou-0.1.0/src/taipower_tou.egg-info/SOURCES.txt +42 -0
  26. taipower_tou-0.1.0/src/taipower_tou.egg-info/dependency_links.txt +1 -0
  27. taipower_tou-0.1.0/src/taipower_tou.egg-info/requires.txt +17 -0
  28. taipower_tou-0.1.0/src/taipower_tou.egg-info/top_level.txt +1 -0
  29. taipower_tou-0.1.0/tests/test_accuracy_validation.py +619 -0
  30. taipower_tou-0.1.0/tests/test_billing.py +166 -0
  31. taipower_tou-0.1.0/tests/test_billing_cycle.py +619 -0
  32. taipower_tou-0.1.0/tests/test_billing_cycle_edge_cases.py +184 -0
  33. taipower_tou-0.1.0/tests/test_calendar.py +44 -0
  34. taipower_tou-0.1.0/tests/test_comprehensive.py +338 -0
  35. taipower_tou-0.1.0/tests/test_custom.py +63 -0
  36. taipower_tou-0.1.0/tests/test_custom_stress.py +1217 -0
  37. taipower_tou-0.1.0/tests/test_e2e.py +501 -0
  38. taipower_tou-0.1.0/tests/test_entry.py +148 -0
  39. taipower_tou-0.1.0/tests/test_factory.py +174 -0
  40. taipower_tou-0.1.0/tests/test_integration.py +411 -0
  41. taipower_tou-0.1.0/tests/test_production_readiness.py +1650 -0
  42. taipower_tou-0.1.0/tests/test_stress.py +809 -0
  43. taipower_tou-0.1.0/tests/test_tariff.py +220 -0
  44. taipower_tou-0.1.0/tests/test_version.py +24 -0
@@ -0,0 +1,62 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+ - Initial release of Taiwan TOU Calculator
12
+ - Support for all 20 Taipower tariff plans
13
+ - Residential: non-TOU, simple 2-tier, simple 3-tier
14
+ - Lighting: non-business tiered, business tiered, standard 2/3-tier
15
+ - Low Voltage: power, 2-tier, 3-stage, EV
16
+ - High Voltage: power, 2-tier, 3-stage, batch production, EV
17
+ - Extra High Voltage: power, 2-tier, 3-stage, batch production
18
+ - Flexible plan name matching (English ID, Chinese, bilingual, with/without spaces)
19
+ - Taiwan holiday calendar with API fallback
20
+ - Energy cost calculation with monthly aggregation
21
+ - Full bill calculation (energy cost, basic fee, penalty, power factor adjustment)
22
+ - Demand penalty calculation based on 15-minute peak demand
23
+ - Custom plan builders for creating custom tariff schedules
24
+ - No-pandas convenience functions (`calculate_bill_from_list`, `calculate_bill_from_dict`)
25
+ - Bilingual API documentation (English/Chinese)
26
+
27
+ ### Testing
28
+ - 364 tests across 12 test modules
29
+ - 104 production readiness tests covering:
30
+ - Security & input validation
31
+ - Multilingual & encoding support
32
+ - Extreme scenarios (leap years, century transitions)
33
+ - Data type compatibility
34
+ - API compatibility
35
+ - Concurrency & race conditions
36
+ - Resource management
37
+ - Documentation examples
38
+ - Boundary values
39
+ - Error recovery
40
+ - Performance benchmarks
41
+ - Version compatibility
42
+ - Accuracy validation against Taipower official rates
43
+ - Stress tests (5M+ records, concurrent access, memory stability)
44
+ - End-to-end tests simulating real-world scenarios
45
+
46
+ ### Documentation
47
+ - Comprehensive README with bilingual quick start tutorial
48
+ - API documentation (English and Chinese)
49
+ - Calculation logic background with formulas
50
+ - Performance benchmarks and optimization tips
51
+
52
+ ### Development Status
53
+ - Python 3.9-3.13 support
54
+ - CI/CD with GitHub Actions (tests on Python 3.9, 3.10, 3.11, 3.12, 3.13)
55
+ - Pre-commit hooks for code quality (ruff, mypy)
56
+ - MIT License
57
+
58
+ ## [0.1.0] - TBD
59
+
60
+ ### Release Notes
61
+ - First stable release
62
+ - PyPI publication pending
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Gary
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ recursive-include src/taipower_tou/data *.json