comcheck-api 1.0.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 (138) hide show
  1. comcheck_api-1.0.0/.env.example +4 -0
  2. comcheck_api-1.0.0/.github/ISSUE_TEMPLATE/bug_report.md +46 -0
  3. comcheck_api-1.0.0/.github/ISSUE_TEMPLATE/feature_request.md +25 -0
  4. comcheck_api-1.0.0/.github/ISSUE_TEMPLATE/question.md +27 -0
  5. comcheck_api-1.0.0/.github/pull_request_template.md +17 -0
  6. comcheck_api-1.0.0/.github/workflows/docs.yml +49 -0
  7. comcheck_api-1.0.0/.github/workflows/publish.yml +34 -0
  8. comcheck_api-1.0.0/.gitignore +60 -0
  9. comcheck_api-1.0.0/.pre-commit-config.yaml +8 -0
  10. comcheck_api-1.0.0/.python-version +1 -0
  11. comcheck_api-1.0.0/CHANGELOG.md +123 -0
  12. comcheck_api-1.0.0/DISCLAIMER.md +24 -0
  13. comcheck_api-1.0.0/LICENSE +24 -0
  14. comcheck_api-1.0.0/PKG-INFO +244 -0
  15. comcheck_api-1.0.0/README.md +216 -0
  16. comcheck_api-1.0.0/comcheck_api/__init__.py +99 -0
  17. comcheck_api-1.0.0/comcheck_api/ai/__init__.py +30 -0
  18. comcheck_api-1.0.0/comcheck_api/ai/skill/SKILL.md +285 -0
  19. comcheck_api-1.0.0/comcheck_api/ai/skill/__init__.py +5 -0
  20. comcheck_api-1.0.0/comcheck_api/ai/skill/reference/operations.md +101 -0
  21. comcheck_api-1.0.0/comcheck_api/ai/skill/reference/simulation.md +99 -0
  22. comcheck_api-1.0.0/comcheck_api/ai/skill/reference/types.md +90 -0
  23. comcheck_api-1.0.0/comcheck_api/ai/skill/scripts/__init__.py +1 -0
  24. comcheck_api-1.0.0/comcheck_api/ai/skill/scripts/validate_code.py +210 -0
  25. comcheck_api-1.0.0/comcheck_api/api/__init__.py +1 -0
  26. comcheck_api-1.0.0/comcheck_api/api/api_services.py +273 -0
  27. comcheck_api-1.0.0/comcheck_api/cli.py +136 -0
  28. comcheck_api-1.0.0/comcheck_api/client/__init__.py +1 -0
  29. comcheck_api-1.0.0/comcheck_api/client/comcheck_client.py +335 -0
  30. comcheck_api-1.0.0/comcheck_api/constants/__init__.py +0 -0
  31. comcheck_api-1.0.0/comcheck_api/constants/building_area_constants.py +35 -0
  32. comcheck_api-1.0.0/comcheck_api/constants/common_constants.py +116 -0
  33. comcheck_api-1.0.0/comcheck_api/constants/envelope_constants.py +250 -0
  34. comcheck_api-1.0.0/comcheck_api/defaults.py +150 -0
  35. comcheck_api-1.0.0/comcheck_api/exceptions.py +54 -0
  36. comcheck_api-1.0.0/comcheck_api/introspection.py +188 -0
  37. comcheck_api-1.0.0/comcheck_api/managers/__init__.py +0 -0
  38. comcheck_api-1.0.0/comcheck_api/managers/components/__init__.py +0 -0
  39. comcheck_api-1.0.0/comcheck_api/managers/components/building_area.py +11 -0
  40. comcheck_api-1.0.0/comcheck_api/managers/components/envelope/__init__.py +0 -0
  41. comcheck_api-1.0.0/comcheck_api/managers/components/envelope/ag_wall.py +97 -0
  42. comcheck_api-1.0.0/comcheck_api/managers/components/envelope/bg_wall.py +39 -0
  43. comcheck_api-1.0.0/comcheck_api/managers/components/envelope/door.py +11 -0
  44. comcheck_api-1.0.0/comcheck_api/managers/components/envelope/floor.py +11 -0
  45. comcheck_api-1.0.0/comcheck_api/managers/components/envelope/roof.py +30 -0
  46. comcheck_api-1.0.0/comcheck_api/managers/components/envelope/skylight.py +11 -0
  47. comcheck_api-1.0.0/comcheck_api/managers/components/envelope/window.py +11 -0
  48. comcheck_api-1.0.0/comcheck_api/managers/data_manager.py +369 -0
  49. comcheck_api-1.0.0/comcheck_api/project_operations/__init__.py +8 -0
  50. comcheck_api-1.0.0/comcheck_api/project_operations/project_building_area_operations.py +107 -0
  51. comcheck_api-1.0.0/comcheck_api/project_operations/project_envelope_operations.py +899 -0
  52. comcheck_api-1.0.0/comcheck_api/schemas/comCheck.schema.json +6463 -0
  53. comcheck_api-1.0.0/comcheck_api/types/__init__.py +49 -0
  54. comcheck_api-1.0.0/comcheck_api/types/api_types.py +127 -0
  55. comcheck_api-1.0.0/comcheck_api/types/common_types.py +32 -0
  56. comcheck_api-1.0.0/comcheck_api/types/core_types.py +4198 -0
  57. comcheck_api-1.0.0/comcheck_api/types/custom_base_model.py +314 -0
  58. comcheck_api-1.0.0/comcheck_api/utilities/__init__.py +5 -0
  59. comcheck_api-1.0.0/comcheck_api/utilities/common.py +50 -0
  60. comcheck_api-1.0.0/comcheck_api/utilities/envelope_utilities.py +46 -0
  61. comcheck_api-1.0.0/comcheck_api/utilities/id_registry.py +79 -0
  62. comcheck_api-1.0.0/comcheck_api/utilities/project_utilities.py +60 -0
  63. comcheck_api-1.0.0/comcheck_api/validation.py +64 -0
  64. comcheck_api-1.0.0/docs_site/api/api-service.md +7 -0
  65. comcheck_api-1.0.0/docs_site/api/client.md +5 -0
  66. comcheck_api-1.0.0/docs_site/api/constants/building-area.md +5 -0
  67. comcheck_api-1.0.0/docs_site/api/constants/common.md +5 -0
  68. comcheck_api-1.0.0/docs_site/api/constants/envelope.md +6 -0
  69. comcheck_api-1.0.0/docs_site/api/defaults.md +6 -0
  70. comcheck_api-1.0.0/docs_site/api/exceptions.md +5 -0
  71. comcheck_api-1.0.0/docs_site/api/introspection.md +34 -0
  72. comcheck_api-1.0.0/docs_site/api/managers/building-area.md +5 -0
  73. comcheck_api-1.0.0/docs_site/api/managers/data-manager.md +12 -0
  74. comcheck_api-1.0.0/docs_site/api/managers/envelope.md +50 -0
  75. comcheck_api-1.0.0/docs_site/api/operations/building-area.md +5 -0
  76. comcheck_api-1.0.0/docs_site/api/operations/credits.md +11 -0
  77. comcheck_api-1.0.0/docs_site/api/operations/envelope.md +9 -0
  78. comcheck_api-1.0.0/docs_site/api/operations/exterior-lighting.md +12 -0
  79. comcheck_api-1.0.0/docs_site/api/operations/interior-lighting.md +13 -0
  80. comcheck_api-1.0.0/docs_site/api/operations/mechanical.md +13 -0
  81. comcheck_api-1.0.0/docs_site/api/operations/renewable-energy.md +12 -0
  82. comcheck_api-1.0.0/docs_site/api/simulation.md +86 -0
  83. comcheck_api-1.0.0/docs_site/api/types/api-types.md +5 -0
  84. comcheck_api-1.0.0/docs_site/api/types/common-types.md +5 -0
  85. comcheck_api-1.0.0/docs_site/api/types/custom-base-model.md +5 -0
  86. comcheck_api-1.0.0/docs_site/api/utilities/common.md +5 -0
  87. comcheck_api-1.0.0/docs_site/api/utilities/envelope.md +5 -0
  88. comcheck_api-1.0.0/docs_site/api/utilities/id-registry.md +6 -0
  89. comcheck_api-1.0.0/docs_site/getting-started.md +177 -0
  90. comcheck_api-1.0.0/docs_site/index.md +68 -0
  91. comcheck_api-1.0.0/docs_site/types-guide.md +172 -0
  92. comcheck_api-1.0.0/examples/README.md +140 -0
  93. comcheck_api-1.0.0/examples/client/simulation.py +32 -0
  94. comcheck_api-1.0.0/examples/client/user_functions.py +36 -0
  95. comcheck_api-1.0.0/examples/data_manager/building_area.py +19 -0
  96. comcheck_api-1.0.0/examples/data_manager/envelope.py +27 -0
  97. comcheck_api-1.0.0/examples/project_operations/building_area_operations.py +36 -0
  98. comcheck_api-1.0.0/examples/project_operations/envelope_operations.py +64 -0
  99. comcheck_api-1.0.0/mkdocs.yml +73 -0
  100. comcheck_api-1.0.0/pyproject.toml +98 -0
  101. comcheck_api-1.0.0/pytest_fixtures/__init__.py +0 -0
  102. comcheck_api-1.0.0/pytest_fixtures/components.py +769 -0
  103. comcheck_api-1.0.0/scripts/README.md +61 -0
  104. comcheck_api-1.0.0/scripts/__init__.py +0 -0
  105. comcheck_api-1.0.0/scripts/comcheck_client_tests/__init__.py +0 -0
  106. comcheck_api-1.0.0/scripts/comcheck_client_tests/simulation_script.py +91 -0
  107. comcheck_api-1.0.0/scripts/comcheck_client_tests/user_function_script.py +186 -0
  108. comcheck_api-1.0.0/scripts/main.py +30 -0
  109. comcheck_api-1.0.0/scripts/project_operations_tests/__init__.py +0 -0
  110. comcheck_api-1.0.0/scripts/project_operations_tests/building_area_operations_script.py +192 -0
  111. comcheck_api-1.0.0/scripts/project_operations_tests/envelope_operations_script.py +840 -0
  112. comcheck_api-1.0.0/scripts/script_test_data.py +696 -0
  113. comcheck_api-1.0.0/tests/README.md +92 -0
  114. comcheck_api-1.0.0/tests/__init__.py +0 -0
  115. comcheck_api-1.0.0/tests/client/test_simulation.py +61 -0
  116. comcheck_api-1.0.0/tests/client/test_user_functions.py +70 -0
  117. comcheck_api-1.0.0/tests/conftest.py +78 -0
  118. comcheck_api-1.0.0/tests/data_manager_tests/__init__.py +0 -0
  119. comcheck_api-1.0.0/tests/data_manager_tests/envelope_tests/__init__.py +0 -0
  120. comcheck_api-1.0.0/tests/data_manager_tests/envelope_tests/conftest.py +20 -0
  121. comcheck_api-1.0.0/tests/data_manager_tests/envelope_tests/test_bg_wall_list_manager.py +43 -0
  122. comcheck_api-1.0.0/tests/data_manager_tests/envelope_tests/test_door_list_manager.py +9 -0
  123. comcheck_api-1.0.0/tests/data_manager_tests/envelope_tests/test_envelope.py +12 -0
  124. comcheck_api-1.0.0/tests/data_manager_tests/envelope_tests/test_floor_list_manager.py +9 -0
  125. comcheck_api-1.0.0/tests/data_manager_tests/envelope_tests/test_roof_list_manager.py +32 -0
  126. comcheck_api-1.0.0/tests/data_manager_tests/envelope_tests/test_window_list_manager.py +19 -0
  127. comcheck_api-1.0.0/tests/data_manager_tests/test_data_manager.py +67 -0
  128. comcheck_api-1.0.0/tests/project_operation_tests/__init__.py +0 -0
  129. comcheck_api-1.0.0/tests/project_operation_tests/assertions/__init__.py +0 -0
  130. comcheck_api-1.0.0/tests/project_operation_tests/assertions/components.py +85 -0
  131. comcheck_api-1.0.0/tests/project_operation_tests/conftest.py +257 -0
  132. comcheck_api-1.0.0/tests/project_operation_tests/test_building_area_operations.py +82 -0
  133. comcheck_api-1.0.0/tests/project_operation_tests/test_envelope_operations.py +147 -0
  134. comcheck_api-1.0.0/tests/test_base_model.py +95 -0
  135. comcheck_api-1.0.0/tests/test_comcheck_client.py +41 -0
  136. comcheck_api-1.0.0/tools/fetch_comcheck_schema.sh +59 -0
  137. comcheck_api-1.0.0/tools/generate_core_types.py +48 -0
  138. comcheck_api-1.0.0/uv.lock +1304 -0
@@ -0,0 +1,4 @@
1
+ # COMcheck API Configuration
2
+
3
+ # Required: Your COMcheck API key
4
+ COM_API_KEY=your-api-key-here
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug or issue with the library
4
+ title: '[BUG] '
5
+ labels: bug
6
+ ---
7
+
8
+ ## Description
9
+ A clear and concise description of the bug.
10
+
11
+ ## Environment
12
+ - Python version: [e.g., 3.12.1]
13
+ - Library version: [e.g., 0.1.0]
14
+ - Operating System: [e.g., macOS 14.0, Ubuntu 22.04]
15
+
16
+ ## Steps to Reproduce
17
+ 1. Step one
18
+ 2. Step two
19
+ 3. Step three
20
+
21
+ ## Expected Behavior
22
+ What you expected to happen.
23
+
24
+ ## Actual Behavior
25
+ What actually happened.
26
+
27
+ ## Code Example
28
+ ```python
29
+ # Minimal code example that reproduces the issue
30
+ from comcheck_api import COMcheckClient
31
+
32
+ client = COMcheckClient(api_key="...")
33
+ # Your code here
34
+ ```
35
+
36
+ ## Error Message
37
+ ```
38
+ Paste the full error message and stack trace here
39
+ ```
40
+
41
+ ## Additional Context
42
+ Any other information that might be helpful.
43
+
44
+ ---
45
+
46
+ **Note:** This project does not accept external contributions. Issues are welcome for bug reports and feedback only.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest a feature or enhancement
4
+ title: '[FEATURE] '
5
+ labels: enhancement
6
+ ---
7
+
8
+ ## Feature Description
9
+ A clear description of the feature you'd like to see.
10
+
11
+ ## Use Case
12
+ Describe the problem this feature would solve or the use case it would enable.
13
+
14
+ ## Proposed Solution
15
+ If you have ideas on how this could be implemented, share them here.
16
+
17
+ ## Alternatives Considered
18
+ Are there alternative solutions or workarounds you've considered?
19
+
20
+ ## Additional Context
21
+ Any other information, examples, or references that might be helpful.
22
+
23
+ ---
24
+
25
+ **Note:** This project does not accept external contributions. Feature requests are noted for consideration by the internal development team.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: Question
3
+ about: Ask a question about using the library
4
+ title: '[QUESTION] '
5
+ labels: question
6
+ ---
7
+
8
+ ## Question
9
+ Your question here.
10
+
11
+ ## What I've Tried
12
+ Describe what you've already tried or where you've looked for answers:
13
+ - [ ] Checked the README
14
+ - [ ] Reviewed the examples/ directory
15
+ - [ ] Searched existing issues
16
+
17
+ ## Context
18
+ Provide any relevant context about what you're trying to accomplish.
19
+
20
+ ## Code Example (if applicable)
21
+ ```python
22
+ # Your code here
23
+ ```
24
+
25
+ ---
26
+
27
+ **Note:** Please check the [examples/](../../examples/) directory. For usage questions, these are often the best resources.
@@ -0,0 +1,17 @@
1
+ # ⚠️ External Pull Requests Not Accepted
2
+
3
+ Thank you for your interest in this project!
4
+
5
+ However, **this project does not accept external contributions or pull requests** at this time. Development is managed internally by the PNNL team.
6
+
7
+ ## Alternative Ways to Help
8
+
9
+ If you've found a bug or have a suggestion:
10
+
11
+ 1. **Report an Issue**: Open a bug report or feature request instead
12
+ 2. **Share Feedback**: Your feedback helps us improve the library
13
+ 3. **Use and Share**: Use the library and share your experiences
14
+
15
+ ---
16
+
17
+ We appreciate your understanding and interest in the COMcheck API Python client!
@@ -0,0 +1,49 @@
1
+ name: Deploy Documentation
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ concurrency:
14
+ group: pages
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ build:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v4
25
+
26
+ - name: Set up Python
27
+ run: uv python install 3.12
28
+
29
+ - name: Install dependencies
30
+ run: uv sync --group docs
31
+
32
+ - name: Build documentation
33
+ run: uv run mkdocs build
34
+
35
+ - name: Upload artifact
36
+ uses: actions/upload-pages-artifact@v3
37
+ with:
38
+ path: site
39
+
40
+ deploy:
41
+ needs: build
42
+ runs-on: ubuntu-latest
43
+ environment:
44
+ name: github-pages
45
+ url: ${{ steps.deployment.outputs.page_url }}
46
+ steps:
47
+ - name: Deploy to GitHub Pages
48
+ id: deployment
49
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,34 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version:
7
+ description: "Version to publish (e.g. 1.0.0). Leave empty to use the version in pyproject.toml."
8
+ required: false
9
+
10
+ permissions:
11
+ id-token: write
12
+
13
+ jobs:
14
+ publish:
15
+ runs-on: ubuntu-latest
16
+ environment: pypi
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v4
22
+
23
+ - name: Set version (if provided)
24
+ if: ${{ inputs.version != '' }}
25
+ run: sed -i "s/^version = .*/version = \"${{ inputs.version }}\"/" pyproject.toml
26
+
27
+ - name: Show version
28
+ run: grep '^version' pyproject.toml
29
+
30
+ - name: Build package
31
+ run: uv build
32
+
33
+ - name: Publish to PyPI
34
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,60 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ build/
11
+ *.egg-info/
12
+ .eggs/
13
+
14
+ # Virtual environments
15
+ venv/
16
+ .env/
17
+ .envrc
18
+ .venv/
19
+
20
+ # Python tool caches
21
+ pip-log.txt
22
+ pip-delete-this-directory.txt
23
+ __pypackages__/
24
+
25
+ # uv / hatch virtual environment (if any)
26
+ .uv_env/
27
+ .uv_cache/
28
+
29
+ # Testing / coverage
30
+ .coverage
31
+ .coverage.*
32
+ .cache
33
+ nosetests.xml
34
+ pytest_cache/
35
+ .pytest_cache/
36
+ htmlcov/
37
+
38
+ # IDE / editor configs
39
+ .vscode/
40
+ .idea/
41
+ *.sublime-project
42
+ *.sublime-workspace
43
+
44
+ # MacOS
45
+ .DS_Store
46
+
47
+ # Logs
48
+ *.log
49
+
50
+ # Temporary files
51
+ *.tmp
52
+ *.swp
53
+
54
+ .env
55
+ testprojectJson/
56
+
57
+ # MkDocs build output
58
+ site/
59
+
60
+ .claude
@@ -0,0 +1,8 @@
1
+ repos:
2
+ - repo: https://github.com/psf/black
3
+ rev: 26.1.0 # latest Black release
4
+ hooks:
5
+ - id: black
6
+ language_version: python3
7
+ exclude: ^comcheck_api/types/core_types\.py$
8
+
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,123 @@
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
+ ### Fixed
11
+ - Made BASE_URL configurable via COMCHECK_API_URL environment variable
12
+
13
+ ### To Be Added
14
+ - Logging implementation to replace print statements
15
+ - Custom exception classes for better error handling
16
+ - Comprehensive API documentation
17
+ - Additional examples and tutorials
18
+
19
+ ### To Be Fixed
20
+ - Fix import path documentation in __init__.py
21
+ - Security: Remove .env from version control
22
+
23
+ ## [0.1.0] - 2025-03-XX
24
+
25
+ ### Added
26
+ - Initial release of COMcheck Web API Python client
27
+ - Core API service layer with httpx HTTP client
28
+ - High-level client interface (COMcheckClient)
29
+ - Project CRUD operations (get, list, update)
30
+ - Building component management:
31
+ - Envelope operations (walls, roofs, windows, doors, skylights)
32
+ - Building area operations
33
+ - Lighting, HVAC, and control systems
34
+ - Energy simulation support:
35
+ - Start simulation
36
+ - Check simulation status
37
+ - Retrieve simulation results
38
+ - Compliance checking before simulation
39
+ - Type-safe Pydantic models for all data structures
40
+ - Context manager support for automatic resource cleanup
41
+ - Project template and default constants
42
+ - Data managers for building areas and envelope components
43
+ - Utility functions for project operations
44
+ - Comprehensive examples:
45
+ - Client operations (simulation, user functions)
46
+ - Data manager usage
47
+ - Project operations
48
+ - Development tooling:
49
+ - Black code formatter
50
+ - MyPy type checking
51
+ - Pre-commit hooks
52
+ - pytest test framework
53
+ - Schema generation from COMcheck API
54
+ - Package management with uv
55
+
56
+ ### Dependencies
57
+ - httpx >= 0.27.0 (HTTP client)
58
+ - pydantic >= 2.12.5 (data validation)
59
+ - jsonschema >= 4.23.0 (schema validation)
60
+ - python-dotenv >= 1.0.0 (environment configuration)
61
+ - types-jsonschema >= 4.23.0 (type stubs)
62
+
63
+ ### Development Dependencies
64
+ - black >= 26.1.0 (code formatting)
65
+ - datamodel-code-generator >= 0.54.1 (type generation)
66
+ - mypy >= 1.19.1 (type checking)
67
+ - pre-commit >= 4.5.1 (git hooks)
68
+ - pytest >= 9.0.2 (testing)
69
+
70
+ ### Requirements
71
+ - Python >= 3.12
72
+
73
+ ### Known Issues
74
+ - API key must be provided manually (no OAuth flow yet)
75
+ - Some print() statements used instead of proper logging
76
+ - Limited error handling with custom exceptions
77
+
78
+ ### Breaking Changes
79
+ None (initial release)
80
+
81
+ ---
82
+
83
+ ## Release Notes
84
+
85
+ ### Version 0.1.0 - Initial Alpha Release
86
+
87
+ This is the first alpha release of the COMcheck Web API Python client. The library provides a clean, type-safe interface for interacting with the COMcheck Web API to perform building energy code compliance checks.
88
+
89
+ **Key Features:**
90
+ - Easy-to-use client interface
91
+ - Full project lifecycle management
92
+ - Building component operations
93
+ - Energy simulation and compliance checking
94
+ - Type-safe with Pydantic models
95
+ - Well-documented with examples
96
+
97
+ **Not Yet Stable:**
98
+ This is an alpha release. The API may change in future versions. Not recommended for production use without thorough testing.
99
+
100
+ **What's Next:**
101
+ - API stabilization for v1.0.0
102
+ - Enhanced documentation
103
+ - More examples and tutorials
104
+ - Performance optimizations
105
+ - Better error handling
106
+
107
+ ---
108
+
109
+ ## Migration Guides
110
+
111
+ ### Upgrading to 0.1.0
112
+ Initial release - no migration needed.
113
+
114
+ ---
115
+
116
+ ## Deprecation Notices
117
+
118
+ None yet.
119
+
120
+ ---
121
+
122
+ *For detailed technical improvements and roadmap, see [docs/IMPROVEMENTS.md](docs/IMPROVEMENTS.md)*
123
+ *For version control strategy, see [docs/VERSION_CONTROL.md](docs/VERSION_CONTROL.md)*
@@ -0,0 +1,24 @@
1
+ DISCLAIMER
2
+
3
+ This material was prepared as an account of work sponsored by an agency of the
4
+ United States Government. Neither the United States Government nor the United
5
+ States Department of Energy, nor Battelle, nor any of their employees, nor any
6
+ jurisdiction or organization that has cooperated in the development of these
7
+ materials, makes any warranty, express or implied, or assumes any legal
8
+ liability or responsibility for the accuracy, completeness, or usefulness or
9
+ any information, apparatus, product, software, or process disclosed, or
10
+ represents that its use would not infringe privately owned rights.
11
+
12
+ Reference herein to any specific commercial product, process, or service by
13
+ trade name, trademark, manufacturer, or otherwise does not necessarily
14
+ constitute or imply its endorsement, recommendation, or favoring by the United
15
+ States Government or any agency thereof, or Battelle Memorial Institute. The
16
+ views and opinions of authors expressed herein do not necessarily state or
17
+ reflect those of the United States Government or any agency thereof.
18
+
19
+ PACIFIC NORTHWEST NATIONAL LABORATORY
20
+ operated by
21
+ BATTELLE
22
+ for the
23
+ UNITED STATES DEPARTMENT OF ENERGY
24
+ under Contract DE-AC05-76RL01830
@@ -0,0 +1,24 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright Battelle Memorial Institute 2026
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,244 @@
1
+ Metadata-Version: 2.4
2
+ Name: comcheck_api
3
+ Version: 1.0.0
4
+ Summary: COMcheck Web API Python Client
5
+ Project-URL: Homepage, https://pnnl.github.io/comcheckweb-api-python/
6
+ Project-URL: Documentation, https://pnnl.github.io/comcheckweb-api-python/
7
+ Project-URL: Repository, https://github.com/pnnl/comcheckweb-api-python
8
+ Author-email: Yanyan Zhu <yanyan.zhu@pnnl.gov>
9
+ Maintainer-email: Yanyan Zhu <yanyan.zhu@pnnl.gov>, Weili Xu <weili.xu@pnnl.gov>
10
+ License-Expression: BSD-3-Clause
11
+ License-File: LICENSE
12
+ Keywords: IECC,ashrae 90.1,building,comcheck,compliance,simulation
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.12
22
+ Requires-Dist: httpx>=0.27.0
23
+ Requires-Dist: jsonschema>=4.23.0
24
+ Requires-Dist: pydantic>=2.12.5
25
+ Requires-Dist: python-dotenv>=1.0.0
26
+ Requires-Dist: types-jsonschema>=4.23.0
27
+ Description-Content-Type: text/markdown
28
+
29
+ # COMcheckWeb API — Python Package
30
+
31
+ This repository contains the COMcheckWeb API Python package. It provides tools and scripts for working with the COMcheckWeb API and is intended to be used as a Python package maintained with `uv` for package management.
32
+
33
+ **Requirements:**
34
+ - Python: `>=3.12`
35
+
36
+ **Package management:**
37
+ - This project uses `uv` (configured in `pyproject.toml`) for dependency and workspace management. The `tool.uv` settings in `pyproject.toml` control workspace members and local sources.
38
+
39
+ Quickly useful notes:
40
+ - If you reference this package from other workspace packages, keep the `tool.uv.sources` entry that maps `comcheck_api = { workspace = true }` so `uv` resolves it to the local workspace copy.
41
+ - For a single-package repo you can also rely on `members = ["."]` and omit additional sources, but leaving the explicit source entry is harmless and makes intent clear.
42
+
43
+ ## Usage
44
+
45
+ ### 1. Obtain an API Key
46
+
47
+ Get a Personal Access Token from the new
48
+ [COMcheck Web site](https://comcheck.energycode.pnl.gov):
49
+
50
+ 1. Log in (or register a new account if you don't have one).
51
+ 2. Click your **username** in the left-side navigation.
52
+ 3. From the menu that appears, choose **Settings**.
53
+ 4. Click **Developer Setting** to open the Personal Access Token
54
+ page.
55
+ 5. Click **Generate**, then immediately copy the token.
56
+
57
+ > **Important:** the token is shown **only once**. Save it somewhere
58
+ > safe (a password manager, your `.env`, etc.) before leaving the
59
+ > page. If you lose it, generate a new one — the old one will stop
60
+ > working.
61
+
62
+ ### 2. Configure the API Key
63
+
64
+ Create a `.env` file at the root of your project and add:
65
+
66
+ ```
67
+ COM_API_KEY=<your-api-key-here>
68
+ ```
69
+
70
+ The SDK does **not** auto-load this — you read it yourself and pass
71
+ it to the client. With `python-dotenv` this is two lines:
72
+
73
+ ```python
74
+ import os
75
+ from dotenv import load_dotenv
76
+ from comcheck_api import COMcheckClient
77
+
78
+ load_dotenv()
79
+ client = COMcheckClient(api_key=os.environ["COM_API_KEY"])
80
+ ```
81
+
82
+ (`client.set_api_key(api_key)` is the equivalent post-construction
83
+ setter if you'd rather defer.)
84
+
85
+ For more detail, see the
86
+ [Getting Started](https://pnnl.github.io/comcheckweb-api-python/getting-started/)
87
+ guide.
88
+
89
+ ### 3. Install the Package
90
+
91
+ ```bash
92
+ pip install comcheck-api
93
+ ```
94
+
95
+ ### 4. Start Using the Package
96
+
97
+ - **Simulation only:** You can use the simulation features directly without creating a project on COMcheck Web.
98
+ - **Updating a project:** You must first create the project under your account on [COMcheck Web](https://comcheck.energycode.pnl.gov) before using this package to update it. Project creation is not yet supported through this package.
99
+
100
+ For detailed usage examples and API reference, see the [documentation](https://pnnl.github.io/comcheckweb-api-python/).
101
+
102
+ ## Introspection helpers
103
+
104
+ The package ships typed helpers for discovering what the SDK exposes
105
+ and for validating project data — useful from notebooks, IDE plugins,
106
+ and AI agents alike. All return Pydantic models; call `.model_dump()`
107
+ when you need JSON.
108
+
109
+ ```python
110
+ import comcheck_api as cc
111
+
112
+ # What operation functions does the SDK ship?
113
+ for op in cc.list_operations():
114
+ print(op.group, op.signature)
115
+
116
+ # What does the ComBuilding model look like?
117
+ schema = cc.lookup_type("ComBuilding")
118
+ for field in schema.fields:
119
+ print(field.name, field.type, field.required)
120
+
121
+ # Does this dict satisfy the SDK schema?
122
+ result = cc.validate_project(project_dict)
123
+ if not result.ok:
124
+ for err in result.errors:
125
+ print(err.loc, err.msg)
126
+ ```
127
+
128
+ See [`api/introspection`](https://pnnl.github.io/comcheckweb-api-python/api/introspection/)
129
+ in the docs for the full reference.
130
+
131
+ ## AI integration: the bundled Skill
132
+
133
+ A bundled Skill teaches AI coding agents how to use this SDK correctly —
134
+ operation modules, default templates, the simulation polling loop,
135
+ common pitfalls. The Skill folder lives at
136
+ [`comcheck_api/ai/skill/`](comcheck_api/ai/skill/) and ships in the
137
+ wheel. It follows the open agent-skills standard (`SKILL.md` plus
138
+ `reference/` and `scripts/`), so the same folder works for both
139
+ **Claude Code** and **OpenAI Codex** — only the install location
140
+ differs.
141
+
142
+ ### Setup in your own repo
143
+
144
+ Run the installer once in the root of the project that consumes
145
+ `comcheck_api`. By default it installs the Skill for **both** agents:
146
+
147
+ ```bash
148
+ comcheck-api install-skill
149
+ ```
150
+
151
+ This writes:
152
+
153
+ - `.claude/skills/comcheck-api/` — Claude Code scans
154
+ `<project>/.claude/skills/` when a session opens against the repo.
155
+ - `.agents/skills/comcheck-api/` — Codex scans `.agents/skills` from
156
+ the working directory up to the repository root.
157
+
158
+ So the guidance kicks in only for projects that actually use this SDK,
159
+ not on every session everywhere. Commit both folders; teammates get the
160
+ same guidance the moment they open the repo, and the agent can pull in
161
+ the reference docs and `validate_code.py` script on demand — not just
162
+ the `SKILL.md` body.
163
+
164
+ To install for only one agent, pass `--claude` or `--codex`:
165
+
166
+ ```bash
167
+ comcheck-api install-skill --claude # Claude Code only
168
+ comcheck-api install-skill --codex # Codex only
169
+ ```
170
+
171
+ Re-run with `--force` after upgrading the package to refresh the Skill.
172
+ Pass `--global` to install into the user-global skills dirs
173
+ (`~/.claude/skills/` and/or `~/.agents/skills/`) for every session
174
+ instead of per-project.
175
+
176
+ ## Development
177
+
178
+ Clone the repository and follow the commands below to set up developer tooling.
179
+
180
+ ```bash
181
+ git clone https://github.com/pnnl/comcheckweb-api-python.git
182
+ cd comcheckweb-api-python
183
+ uv sync
184
+ ```
185
+
186
+ ## Common commands
187
+
188
+ - Setup pre-commit (run once after cloning):
189
+ `uv run pre-commit install`
190
+
191
+ - Fetch the latest COMcheck schema and regenerate types:
192
+ `./tools/fetch_comcheck_schema.sh`
193
+
194
+ - Regenerate types from existing schema (without fetching):
195
+ `uv run tools/generate_core_types.py`
196
+
197
+ - Run a file from `examples/`:
198
+ `uv run examples/<script>`
199
+
200
+ - Run tests:
201
+ `uv run pytest`
202
+
203
+ - Format the repository with Black:
204
+ `uv run black comcheck_api tests examples`
205
+
206
+ - Run type checking:
207
+ `uv run mypy comcheck_api`
208
+
209
+ ## Running the docs locally
210
+
211
+ The documentation site is built with MkDocs (Material theme +
212
+ mkdocstrings). The dependencies live in the optional `docs` group
213
+ defined in `pyproject.toml`.
214
+
215
+ ```bash
216
+ # Install the docs group (mkdocs, mkdocs-material, mkdocstrings).
217
+ uv sync --group docs
218
+
219
+ # Serve with live reload at http://127.0.0.1:8000
220
+ uv run mkdocs serve
221
+
222
+ # One-shot build into ./site/
223
+ uv run mkdocs build
224
+
225
+ # Fail on warnings (good before committing)
226
+ uv run mkdocs build --strict
227
+ ```
228
+
229
+ ## Support
230
+
231
+ This is a publicly available library maintained by PNNL. While the code is open source and free to use, **external contributions are not accepted** at this time.
232
+
233
+ ### Reporting Issues
234
+
235
+ If you encounter bugs or have questions:
236
+ - Open an issue on GitHub for bug reports
237
+ - Check the [examples/](examples/) directory for usage guidance
238
+ - Review the [documentation](docs/) for detailed information
239
+
240
+ **Note:** Issues are welcome, but pull requests from external contributors will not be accepted.
241
+
242
+ ## License
243
+
244
+ See the `LICENSE` file at the repository root for license details.