cernion-forecast-cli 0.2.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 (33) hide show
  1. cernion_forecast_cli-0.2.0/.github/ISSUE_TEMPLATE/bug_report.yml +97 -0
  2. cernion_forecast_cli-0.2.0/.github/ISSUE_TEMPLATE/feature_request.yml +59 -0
  3. cernion_forecast_cli-0.2.0/.github/pull_request_template.md +35 -0
  4. cernion_forecast_cli-0.2.0/.github/workflows/ci.yml +48 -0
  5. cernion_forecast_cli-0.2.0/CHANGELOG.md +29 -0
  6. cernion_forecast_cli-0.2.0/CODE_OF_CONDUCT.md +24 -0
  7. cernion_forecast_cli-0.2.0/CONTRIBUTING.md +62 -0
  8. cernion_forecast_cli-0.2.0/LICENSE +21 -0
  9. cernion_forecast_cli-0.2.0/MANIFEST.in +11 -0
  10. cernion_forecast_cli-0.2.0/PKG-INFO +575 -0
  11. cernion_forecast_cli-0.2.0/README.md +546 -0
  12. cernion_forecast_cli-0.2.0/SECURITY.md +47 -0
  13. cernion_forecast_cli-0.2.0/SUPPORT.md +30 -0
  14. cernion_forecast_cli-0.2.0/docs/e2e-acceptance.md +81 -0
  15. cernion_forecast_cli-0.2.0/docs/input-formats.md +78 -0
  16. cernion_forecast_cli-0.2.0/docs/release.md +53 -0
  17. cernion_forecast_cli-0.2.0/docs/troubleshooting.md +138 -0
  18. cernion_forecast_cli-0.2.0/examples/README.md +55 -0
  19. cernion_forecast_cli-0.2.0/examples/data/synthetic_actuals_2026-09-29.csv +97 -0
  20. cernion_forecast_cli-0.2.0/examples/data/synthetic_actuals_2026-09-29.json +397 -0
  21. cernion_forecast_cli-0.2.0/examples/data/synthetic_history_35d.csv +3361 -0
  22. cernion_forecast_cli-0.2.0/examples/data/synthetic_history_35d.json +13453 -0
  23. cernion_forecast_cli-0.2.0/examples/predictions/synthetic_previous_week_prediction_2026-09-29.json +395 -0
  24. cernion_forecast_cli-0.2.0/pyproject.toml +50 -0
  25. cernion_forecast_cli-0.2.0/setup.cfg +4 -0
  26. cernion_forecast_cli-0.2.0/src/cernion_forecast_cli/__init__.py +1 -0
  27. cernion_forecast_cli-0.2.0/src/cernion_forecast_cli/cli.py +1489 -0
  28. cernion_forecast_cli-0.2.0/src/cernion_forecast_cli.egg-info/PKG-INFO +575 -0
  29. cernion_forecast_cli-0.2.0/src/cernion_forecast_cli.egg-info/SOURCES.txt +31 -0
  30. cernion_forecast_cli-0.2.0/src/cernion_forecast_cli.egg-info/dependency_links.txt +1 -0
  31. cernion_forecast_cli-0.2.0/src/cernion_forecast_cli.egg-info/entry_points.txt +2 -0
  32. cernion_forecast_cli-0.2.0/src/cernion_forecast_cli.egg-info/top_level.txt +1 -0
  33. cernion_forecast_cli-0.2.0/tests/test_cli.py +575 -0
@@ -0,0 +1,97 @@
1
+ name: Bug report
2
+ description: Report a reproducible CLI bug
3
+ title: "bug: "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for reporting a bug. Do not include API tokens, real customer data, non-public MSCONS files or private market communication payloads. Use synthetic or redacted examples.
10
+ - type: input
11
+ id: version
12
+ attributes:
13
+ label: CLI version or commit
14
+ description: Output from `cernion-forecast describe` or the git commit SHA.
15
+ placeholder: "0.2.0 / d615298"
16
+ validations:
17
+ required: true
18
+ - type: input
19
+ id: python
20
+ attributes:
21
+ label: Python version
22
+ placeholder: "Python 3.12.3"
23
+ validations:
24
+ required: true
25
+ - type: dropdown
26
+ id: command
27
+ attributes:
28
+ label: Command
29
+ options:
30
+ - day-ahead
31
+ - history
32
+ - enroll
33
+ - train
34
+ - predict
35
+ - resume
36
+ - score
37
+ - acceptance-test
38
+ - e2e
39
+ - batch-history
40
+ - doctor
41
+ - describe
42
+ - other
43
+ validations:
44
+ required: true
45
+ - type: dropdown
46
+ id: input_format
47
+ attributes:
48
+ label: Input format
49
+ options:
50
+ - JSON
51
+ - CSV
52
+ - MSCONS/EDIFACT
53
+ - no input file
54
+ - mixed/other
55
+ validations:
56
+ required: true
57
+ - type: textarea
58
+ id: command_line
59
+ attributes:
60
+ label: Command line
61
+ description: Redact tokens and private paths if needed.
62
+ render: shell
63
+ validations:
64
+ required: true
65
+ - type: textarea
66
+ id: expected
67
+ attributes:
68
+ label: Expected behavior
69
+ validations:
70
+ required: true
71
+ - type: textarea
72
+ id: actual
73
+ attributes:
74
+ label: Actual behavior and sanitized output
75
+ description: Paste the error text after removing secrets and private data.
76
+ render: text
77
+ validations:
78
+ required: true
79
+ - type: textarea
80
+ id: minimal_data
81
+ attributes:
82
+ label: Minimal sanitized reproduction data
83
+ description: Prefer synthetic data. Do not attach real customer data or private MSCONS messages.
84
+ render: json
85
+ validations:
86
+ required: false
87
+ - type: checkboxes
88
+ id: safety
89
+ attributes:
90
+ label: Safety checklist
91
+ options:
92
+ - label: I removed API tokens and authorization headers.
93
+ required: true
94
+ - label: I removed or masked customer, meter and market-party identifiers unless they are synthetic.
95
+ required: true
96
+ - label: I am not attaching non-public MSCONS/EDIFACT payloads.
97
+ required: true
@@ -0,0 +1,59 @@
1
+ name: Feature request
2
+ description: Suggest a CLI improvement or integration workflow
3
+ title: "feature: "
4
+ labels: ["enhancement"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Please describe the operational problem, not only the desired flag. Do not include private customer data or API tokens.
10
+ - type: textarea
11
+ id: workflow
12
+ attributes:
13
+ label: Operational workflow
14
+ description: What user/system would use this and in which step of the forecast process?
15
+ placeholder: "Daily EDM export -> history dry-run -> import -> train/predict -> score -> report"
16
+ validations:
17
+ required: true
18
+ - type: dropdown
19
+ id: area
20
+ attributes:
21
+ label: Area
22
+ options:
23
+ - input validation
24
+ - JSON/CSV import
25
+ - MSCONS/EDIFACT import
26
+ - weather/site context
27
+ - training/prediction orchestration
28
+ - scoring/acceptance
29
+ - batch/idempotency/logging
30
+ - documentation/examples
31
+ - packaging/CI
32
+ - other
33
+ validations:
34
+ required: true
35
+ - type: textarea
36
+ id: problem
37
+ attributes:
38
+ label: Problem to solve
39
+ validations:
40
+ required: true
41
+ - type: textarea
42
+ id: proposal
43
+ attributes:
44
+ label: Proposed behavior
45
+ validations:
46
+ required: true
47
+ - type: textarea
48
+ id: alternatives
49
+ attributes:
50
+ label: Alternatives considered
51
+ validations:
52
+ required: false
53
+ - type: checkboxes
54
+ id: safety
55
+ attributes:
56
+ label: Safety checklist
57
+ options:
58
+ - label: This request can be discussed without real customer data, non-public MSCONS payloads or tokens.
59
+ required: true
@@ -0,0 +1,35 @@
1
+ ## Summary
2
+
3
+ -
4
+
5
+ ## Type of change
6
+
7
+ - [ ] Bug fix
8
+ - [ ] Feature
9
+ - [ ] Documentation/examples
10
+ - [ ] Tests/CI/packaging
11
+ - [ ] Refactor without behavior change
12
+
13
+ ## Verification
14
+
15
+ Please paste the commands you ran:
16
+
17
+ ```bash
18
+ python -m unittest discover -s tests -v
19
+ python -m compileall src tests
20
+ cernion-forecast --help
21
+ ```
22
+
23
+ If you changed examples, also run the relevant example commands from `examples/README.md`.
24
+
25
+ ## Data and security checklist
26
+
27
+ - [ ] No API tokens, authorization headers or secret files are committed.
28
+ - [ ] No real customer data is committed.
29
+ - [ ] No non-public MSCONS/EDIFACT payloads are committed.
30
+ - [ ] Meter, market-party and account identifiers are synthetic or intentionally masked.
31
+ - [ ] Generated artifacts (`runs/`, `out/`, `build/`, `dist/`, `*.egg-info`, `.venv/`, `__pycache__/`, `*.pyc`) are not committed.
32
+
33
+ ## Notes for reviewers
34
+
35
+ Mention any live API test separately, including only sanitized job IDs/diagnostic IDs and never token values.
@@ -0,0 +1,48 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ python-version: ['3.10', '3.11', '3.12']
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: actions/setup-python@v5
17
+ with:
18
+ python-version: ${{ matrix.python-version }}
19
+ - name: Install package
20
+ run: python -m pip install -e .
21
+ - name: Unit tests
22
+ run: python -m unittest discover -s tests -v
23
+ - name: Compile check
24
+ run: python -m compileall src tests
25
+ - name: CLI smoke
26
+ run: |
27
+ cernion-forecast --help
28
+ cernion-forecast describe
29
+ - name: Validate examples without API writes
30
+ run: |
31
+ cernion-forecast history --dry-run \
32
+ --series-id synthetic-meter-42 \
33
+ --input examples/data/synthetic_history_35d.json \
34
+ --quality-policy strict \
35
+ --expected-intervals auto \
36
+ --location Berlin \
37
+ --weather-region DE-BE-Berlin \
38
+ --country DE \
39
+ --out runs/ci/synthetic-history-dry-run
40
+ cernion-forecast score \
41
+ --series-id synthetic-meter-42 \
42
+ --predictions examples/predictions/synthetic_previous_week_prediction_2026-09-29.json \
43
+ --actuals examples/data/synthetic_actuals_2026-09-29.json \
44
+ --out runs/ci/synthetic-score
45
+ - name: Build package
46
+ run: |
47
+ python -m pip install build
48
+ python -m build
@@ -0,0 +1,29 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The project follows semantic-versioning intent. Before `1.0.0`, command names and core artifact names are intended to be stable, but JSON artifact details may still evolve when necessary.
6
+
7
+ ## [0.2.0] - 2026-10-09
8
+
9
+ ### Added
10
+
11
+ - Production-oriented CLI flows for `history`, `enroll`, `train`, `predict`, `resume`, `score`, `acceptance-test`, `e2e`, `batch-history`, `batch`, `doctor` and `describe`.
12
+ - JSON, CSV and MSCONS/EDIFACT input support.
13
+ - MSCONS envelope provenance preservation in local artifacts and forecast result envelopes.
14
+ - Weather/site/context metadata flags and validation for city-level location semantics.
15
+ - Data-quality reports, idempotency keys, processed-ledger support and structured run artifacts.
16
+ - Forecast scoring with residual exports and threshold exit code `50`.
17
+ - Operational acceptance testing against naive baselines.
18
+ - Live E2E workflow with history-depth preflight requiring at least 28 observed days before D-2 by default.
19
+ - Synthetic example data under `examples/`.
20
+ - Community documentation, security policy and contribution guidance.
21
+
22
+ ### Security
23
+
24
+ - Token values are read from environment or token files and are not written to artifacts.
25
+ - HTTP redirects are refused to avoid forwarding credentials to unexpected origins.
26
+
27
+ ## [0.1.0] - Initial local version
28
+
29
+ - Initial command-line client skeleton for CET forecast workflows.
@@ -0,0 +1,24 @@
1
+ # Code of Conduct
2
+
3
+ This project follows a simple contributor covenant: be respectful, constructive and safety-minded.
4
+
5
+ ## Expected behavior
6
+
7
+ - Use welcoming and professional language.
8
+ - Focus criticism on code, documentation and reproducible behavior.
9
+ - Respect different levels of energy-market, Python and CLI experience.
10
+ - Redact sensitive operational data before sharing examples.
11
+ - Help maintain a safe environment for contributors and users.
12
+
13
+ ## Unacceptable behavior
14
+
15
+ - Harassment, threats or personal attacks.
16
+ - Publishing private information, credentials, customer data or non-public market communication payloads.
17
+ - Repeatedly ignoring maintainer requests about safety, scope or data redaction.
18
+ - Disruptive comments that do not help resolve the technical issue.
19
+
20
+ ## Enforcement
21
+
22
+ Maintainers may edit or remove comments, close issues, block users or take other reasonable steps to protect the project and its users.
23
+
24
+ Security-sensitive data disclosures may be removed without prior discussion.
@@ -0,0 +1,62 @@
1
+ # Contributing
2
+
3
+ Thank you for considering a contribution to Cernion Forecast CLI.
4
+
5
+ This project is a command-line integration layer for Cernion Energy Tools (CET) forecast capabilities. Contributions should keep the boundary clear: the CLI normalizes inputs, preserves context/provenance, calls CET REST APIs and writes operational artifacts; it does not implement a replacement forecasting backend.
6
+
7
+ ## Ways to contribute
8
+
9
+ - Improve documentation, examples or troubleshooting notes.
10
+ - Add support for well-defined input/export formats.
11
+ - Improve validation, diagnostics, exit codes or artifact contracts.
12
+ - Add tests for bugs, edge cases or operational workflows.
13
+ - Report safe, minimal reproductions for failures.
14
+
15
+ ## Safe issue data
16
+
17
+ Do not upload real customer data, real MSCONS messages, API tokens, credentials, private market-party identifiers or confidential utility documents to GitHub issues or pull requests.
18
+
19
+ Prefer:
20
+
21
+ - synthetic examples from `examples/`,
22
+ - minimized JSON/CSV snippets with fake IDs,
23
+ - redacted `run.json` / `quality_report.json` / `doctor.json`,
24
+ - command lines with token values removed.
25
+
26
+ ## Development setup
27
+
28
+ ```bash
29
+ git clone git@github.com:energychain/CernionForecastCLI.git
30
+ cd CernionForecastCLI
31
+ python3 -m venv .venv
32
+ . .venv/bin/activate
33
+ python -m pip install -e .
34
+ ```
35
+
36
+ ## Test commands
37
+
38
+ Run these before opening a pull request:
39
+
40
+ ```bash
41
+ python -m unittest discover -s tests -v
42
+ python -m compileall -q -f src tests
43
+ cernion-forecast describe
44
+ ```
45
+
46
+ The default test suite must not require a CET API token and must not call live tenant-bound APIs. Live API checks belong in manual maintainer workflows or documented local smoke tests.
47
+
48
+ ## Code expectations
49
+
50
+ - Add or update tests for behavior changes.
51
+ - Keep token values and secrets out of artifacts and logs.
52
+ - Preserve machine-readable artifact compatibility where possible.
53
+ - Use explicit exit codes for job runners instead of relying on console text.
54
+ - Keep examples synthetic unless a public-data source and license are clearly documented.
55
+
56
+ ## Pull request checklist
57
+
58
+ - [ ] Tests pass locally.
59
+ - [ ] Documentation updated for new flags, input formats or artifacts.
60
+ - [ ] No token, customer data or confidential utility data included.
61
+ - [ ] New behavior has tests or a clear reason why not.
62
+ - [ ] Live API behavior, if relevant, is described separately from local tests.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 STROMDAO GmbH
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,11 @@
1
+ include LICENSE
2
+ include README.md
3
+ include CHANGELOG.md
4
+ include CODE_OF_CONDUCT.md
5
+ include CONTRIBUTING.md
6
+ include SECURITY.md
7
+ include SUPPORT.md
8
+ recursive-include docs *.md
9
+ recursive-include examples *.md *.json *.csv
10
+ recursive-include .github *.md *.yml
11
+ recursive-include tests *.py