LazyCIM 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.
lazycim-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
lazycim-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,184 @@
1
+ Metadata-Version: 2.4
2
+ Name: LazyCIM
3
+ Version: 0.1.0
4
+ Summary: LazyCIM is a Python library for querying, navigating, and editing CIM/CGMES models using a dynamic, ontology-driven API. Think SQLAlchemy for power system knowledge graphs.
5
+ Author: Louis Pauchet, Hallvar Haugdal
6
+ Author-email: Louis Pauchet <louis.pauchet@sintef.no>, Hallvar Haugdal <hallvar.haugdal@sintef.no>
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
14
+ Classifier: Topic :: Scientific/Engineering
15
+ Requires-Dist: loguru>=0.7.3
16
+ Requires-Dist: pandas>=2.0
17
+ Requires-Dist: pydantic>=2.0
18
+ Requires-Dist: rdflib>=7.0
19
+ Requires-Dist: ipykernel>=7.3.0 ; extra == 'dev'
20
+ Requires-Dist: jupyter>=1.1.1 ; extra == 'dev'
21
+ Requires-Dist: dotenv>=0.9.9 ; extra == 'dev'
22
+ Requires-Dist: lazycim[tests] ; extra == 'dev'
23
+ Requires-Dist: lazycim[kgraphpy] ; extra == 'dev'
24
+ Requires-Dist: lazycim[validation] ; extra == 'dev'
25
+ Requires-Dist: lazycim[lint] ; extra == 'dev'
26
+ Requires-Dist: lazycim[docs] ; extra == 'dev'
27
+ Requires-Dist: mkdocs-material>=9.5 ; extra == 'docs'
28
+ Requires-Dist: mkdocstrings[python]>=0.27 ; extra == 'docs'
29
+ Requires-Dist: requests>=2.31.0 ; extra == 'graphdb'
30
+ Requires-Dist: kgraphpy ; extra == 'kgraphpy'
31
+ Requires-Dist: ruff==0.16.9 ; extra == 'lint'
32
+ Requires-Dist: pytest>=8.3.0 ; extra == 'tests'
33
+ Requires-Dist: pytest-cov>=6.0.0 ; extra == 'tests'
34
+ Requires-Dist: requests-mock>=1.12.0 ; extra == 'tests'
35
+ Requires-Dist: lazycim[graphdb] ; extra == 'tests'
36
+ Requires-Dist: kgverifypy ; extra == 'validation'
37
+ Requires-Python: >=3.12
38
+ Project-URL: Homepage, https://github.com/p-swamp/LazyCIM
39
+ Project-URL: Repository, https://github.com/p-swamp/LazyCIM
40
+ Project-URL: Issues, https://github.com/p-swamp/LazyCIM/issues
41
+ Project-URL: Documentation, https://p-swamp.github.io/LazyCIM/
42
+ Provides-Extra: dev
43
+ Provides-Extra: docs
44
+ Provides-Extra: graphdb
45
+ Provides-Extra: kgraphpy
46
+ Provides-Extra: lint
47
+ Provides-Extra: tests
48
+ Provides-Extra: validation
49
+ Description-Content-Type: text/markdown
50
+
51
+ # LazyCIM
52
+
53
+ [![Docs](https://github.com/p-swamp/LazyCIM/actions/workflows/docs.yml/badge.svg)](https://p-swamp.github.io/LazyCIM) [![CI](https://github.com/p-swamp/LazyCIM/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/p-swamp/LazyCIM/actions/workflows/ci.yml)
54
+
55
+ **LazyCIM is a Python library for querying, navigating, and editing CIM/CGMES models as native Python objects. Think SQLAlchemy for CIM knowledge graphs.**
56
+
57
+ Built on top of RDF knowledge graphs, LazyCIM provides a modern, ontology-driven API that lets users work with power system models without writing SPARQL or generating Python classes from CIM schemas.
58
+
59
+ ## Features
60
+
61
+ - 🔍 Expressive query API
62
+ - 🧠 Dynamic CIM classes discovered from the ontology in Pydantic Models
63
+ - ⚡ Lazy loading of objects and relationships
64
+ - 📊 Direct export to pandas DataFrames
65
+ - ✏️ Creation and modification of CIM objects
66
+ - 🔄 Change tracking and commits
67
+ - 🌐 Multiple backends with SPARQL support (RDFLib, GraphDB, ...)
68
+
69
+ ## Install
70
+
71
+ ```bash
72
+ pip install LazyCIM
73
+ ```
74
+
75
+ ## Try it
76
+
77
+ `lazycim.demo` ships two ready-made models, so there is nothing to set up. The
78
+ Nordic44 grid model is downloaded on first use; `load_toy()` needs no network
79
+ at all.
80
+
81
+ ```python
82
+ from lazycim import F, L
83
+ from lazycim.demo import load_nordic44
84
+
85
+ repo = load_nordic44()
86
+
87
+ assert repo.query(L.ACLineSegments).count() == 68
88
+ assert repo.query(L.Substations).count() == 44
89
+ ```
90
+
91
+ Query CIM objects using Python expressions:
92
+
93
+ ```python
94
+ lines = (
95
+ repo.query(L.ACLineSegments)
96
+ .where(F.name.contains("ARENDAL") & (F.normallyInService == True))
97
+ .all()
98
+ )
99
+
100
+ assert len(lines) == 3
101
+ ```
102
+
103
+ Nordic44 has four ARENDAL lines, but one carries no `normallyInService` value
104
+ at all. CGMES models are routinely partial like this, and a filter matches only
105
+ what is actually stated.
106
+
107
+ Navigate the model naturally. Relationships resolve only when you touch them:
108
+
109
+ ```python
110
+ line = repo.query(L.ACLineSegments).where(F.name.contains("ARENDAL")).first()
111
+
112
+ for terminal in line.Terminals:
113
+ print(terminal.ConnectivityNode.name)
114
+
115
+ assert len(line.Terminals) == 2
116
+ ```
117
+
118
+ Export results directly to pandas:
119
+
120
+ ```python
121
+ df = repo.query(L.ACLineSegments).to_dataframe(
122
+ line_name=F.name,
123
+ line_terminal1=F.Terminals[0].mRID,
124
+ line_terminal2=F.Terminals[1].mRID,
125
+ line_terminals=F.Terminals,
126
+ )
127
+ df["line_terminals"] = df["line_terminals"].apply(len)
128
+
129
+ assert len(df) == 68
130
+ assert set(df["line_terminals"]) == {2}
131
+ ```
132
+
133
+ Create and edit CIM objects, then commit:
134
+
135
+ ```python
136
+ analog = repo.L.Analog(name="PMU_ARENDAL_CurrentMagnitude")
137
+
138
+ substation = repo.query(L.Substations).where(F.name == "ARENDAL").first()
139
+ substation.name = "ARENDAL (renamed)"
140
+
141
+ assert repo.status().has_changes
142
+ repo.commit()
143
+
144
+ assert repo.query(L.Analogs).count() == 1
145
+ ```
146
+
147
+ ## Documentation
148
+
149
+ The full documentation covers a guided tour of the API, a technical account of
150
+ how the laziness, schema discovery and query compilation work, and a generated
151
+ API reference. It is available at [p-swamp.github.io/LazyCIM](https://p-swamp.github.io/LazyCIM)
152
+
153
+ ## Philosophy
154
+
155
+ LazyCIM is designed around a simple idea:
156
+
157
+ > Work with CIM models as objects, not RDF triples.
158
+
159
+ The library uses the CIM ontology to discover classes and relationships dynamically, allowing it to adapt to different CIM and CGMES profiles without code generation.
160
+
161
+ ## Development
162
+
163
+ This library was developed for the **p-SWAMP** project under the **Linux Foundation Energy** umbrella and is funded by **Statnett** and supported by the community.
164
+
165
+ Contributions are welcome. To contribute, please:
166
+
167
+ - Open a Pull Request (PR)
168
+ - Include appropriate tests for any new feature or bug fix
169
+ - Ensure that existing tests pass
170
+
171
+ Every example above is executed by the test suite (`uv run pytest -m docs`), so
172
+ they cannot drift from the code.
173
+
174
+ All contributors are expected to follow the Linux Foundation Code of Conduct:
175
+
176
+ - https://lfprojects.org/policies/code-of-conduct/
177
+
178
+ <p align="center">
179
+ <img
180
+ src="https://lfenergy.org/wp-content/uploads/sites/5/2025/12/pswamp-horizontal-color.png"
181
+ alt="p-SWAMP"
182
+ width="500"
183
+ />
184
+ </p>
@@ -0,0 +1,134 @@
1
+ # LazyCIM
2
+
3
+ [![Docs](https://github.com/p-swamp/LazyCIM/actions/workflows/docs.yml/badge.svg)](https://p-swamp.github.io/LazyCIM) [![CI](https://github.com/p-swamp/LazyCIM/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/p-swamp/LazyCIM/actions/workflows/ci.yml)
4
+
5
+ **LazyCIM is a Python library for querying, navigating, and editing CIM/CGMES models as native Python objects. Think SQLAlchemy for CIM knowledge graphs.**
6
+
7
+ Built on top of RDF knowledge graphs, LazyCIM provides a modern, ontology-driven API that lets users work with power system models without writing SPARQL or generating Python classes from CIM schemas.
8
+
9
+ ## Features
10
+
11
+ - 🔍 Expressive query API
12
+ - 🧠 Dynamic CIM classes discovered from the ontology in Pydantic Models
13
+ - ⚡ Lazy loading of objects and relationships
14
+ - 📊 Direct export to pandas DataFrames
15
+ - ✏️ Creation and modification of CIM objects
16
+ - 🔄 Change tracking and commits
17
+ - 🌐 Multiple backends with SPARQL support (RDFLib, GraphDB, ...)
18
+
19
+ ## Install
20
+
21
+ ```bash
22
+ pip install LazyCIM
23
+ ```
24
+
25
+ ## Try it
26
+
27
+ `lazycim.demo` ships two ready-made models, so there is nothing to set up. The
28
+ Nordic44 grid model is downloaded on first use; `load_toy()` needs no network
29
+ at all.
30
+
31
+ ```python
32
+ from lazycim import F, L
33
+ from lazycim.demo import load_nordic44
34
+
35
+ repo = load_nordic44()
36
+
37
+ assert repo.query(L.ACLineSegments).count() == 68
38
+ assert repo.query(L.Substations).count() == 44
39
+ ```
40
+
41
+ Query CIM objects using Python expressions:
42
+
43
+ ```python
44
+ lines = (
45
+ repo.query(L.ACLineSegments)
46
+ .where(F.name.contains("ARENDAL") & (F.normallyInService == True))
47
+ .all()
48
+ )
49
+
50
+ assert len(lines) == 3
51
+ ```
52
+
53
+ Nordic44 has four ARENDAL lines, but one carries no `normallyInService` value
54
+ at all. CGMES models are routinely partial like this, and a filter matches only
55
+ what is actually stated.
56
+
57
+ Navigate the model naturally. Relationships resolve only when you touch them:
58
+
59
+ ```python
60
+ line = repo.query(L.ACLineSegments).where(F.name.contains("ARENDAL")).first()
61
+
62
+ for terminal in line.Terminals:
63
+ print(terminal.ConnectivityNode.name)
64
+
65
+ assert len(line.Terminals) == 2
66
+ ```
67
+
68
+ Export results directly to pandas:
69
+
70
+ ```python
71
+ df = repo.query(L.ACLineSegments).to_dataframe(
72
+ line_name=F.name,
73
+ line_terminal1=F.Terminals[0].mRID,
74
+ line_terminal2=F.Terminals[1].mRID,
75
+ line_terminals=F.Terminals,
76
+ )
77
+ df["line_terminals"] = df["line_terminals"].apply(len)
78
+
79
+ assert len(df) == 68
80
+ assert set(df["line_terminals"]) == {2}
81
+ ```
82
+
83
+ Create and edit CIM objects, then commit:
84
+
85
+ ```python
86
+ analog = repo.L.Analog(name="PMU_ARENDAL_CurrentMagnitude")
87
+
88
+ substation = repo.query(L.Substations).where(F.name == "ARENDAL").first()
89
+ substation.name = "ARENDAL (renamed)"
90
+
91
+ assert repo.status().has_changes
92
+ repo.commit()
93
+
94
+ assert repo.query(L.Analogs).count() == 1
95
+ ```
96
+
97
+ ## Documentation
98
+
99
+ The full documentation covers a guided tour of the API, a technical account of
100
+ how the laziness, schema discovery and query compilation work, and a generated
101
+ API reference. It is available at [p-swamp.github.io/LazyCIM](https://p-swamp.github.io/LazyCIM)
102
+
103
+ ## Philosophy
104
+
105
+ LazyCIM is designed around a simple idea:
106
+
107
+ > Work with CIM models as objects, not RDF triples.
108
+
109
+ The library uses the CIM ontology to discover classes and relationships dynamically, allowing it to adapt to different CIM and CGMES profiles without code generation.
110
+
111
+ ## Development
112
+
113
+ This library was developed for the **p-SWAMP** project under the **Linux Foundation Energy** umbrella and is funded by **Statnett** and supported by the community.
114
+
115
+ Contributions are welcome. To contribute, please:
116
+
117
+ - Open a Pull Request (PR)
118
+ - Include appropriate tests for any new feature or bug fix
119
+ - Ensure that existing tests pass
120
+
121
+ Every example above is executed by the test suite (`uv run pytest -m docs`), so
122
+ they cannot drift from the code.
123
+
124
+ All contributors are expected to follow the Linux Foundation Code of Conduct:
125
+
126
+ - https://lfprojects.org/policies/code-of-conduct/
127
+
128
+ <p align="center">
129
+ <img
130
+ src="https://lfenergy.org/wp-content/uploads/sites/5/2025/12/pswamp-horizontal-color.png"
131
+ alt="p-SWAMP"
132
+ width="500"
133
+ />
134
+ </p>
@@ -0,0 +1,122 @@
1
+ [project]
2
+ name = "LazyCIM"
3
+ version = "0.1.0"
4
+ description = "LazyCIM is a Python library for querying, navigating, and editing CIM/CGMES models using a dynamic, ontology-driven API. Think SQLAlchemy for power system knowledge graphs."
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ license = "Apache-2.0"
8
+ license-files = ["LICENSE"]
9
+ classifiers = [
10
+ "Development Status :: 3 - Alpha",
11
+ "Intended Audience :: Science/Research",
12
+ "Programming Language :: Python :: 3.12",
13
+ "Programming Language :: Python :: 3.13",
14
+ "Programming Language :: Python :: 3.14",
15
+ "Topic :: Scientific/Engineering",
16
+ ]
17
+ dependencies = [
18
+ "loguru>=0.7.3",
19
+ "pandas>=2.0",
20
+ "pydantic>=2.0",
21
+ "rdflib>=7.0",
22
+ ]
23
+
24
+ [[project.authors]]
25
+ name = "Louis Pauchet"
26
+ email = "louis.pauchet@sintef.no"
27
+
28
+ [[project.authors]]
29
+ name = "Hallvar Haugdal"
30
+ email = "hallvar.haugdal@sintef.no"
31
+
32
+ [project.optional-dependencies]
33
+ kgraphpy = ["kgraphpy"]
34
+ graphdb = ["requests>=2.31.0"]
35
+ validation = ["kgverifypy"]
36
+ lint = ["ruff==0.16.9"]
37
+ docs = [
38
+ "mkdocs-material>=9.5",
39
+ "mkdocstrings[python]>=0.27",
40
+ ]
41
+ tests = [
42
+ "pytest>=8.3.0",
43
+ "pytest-cov>=6.0.0",
44
+ "requests-mock>=1.12.0",
45
+ "LazyCIM[graphdb]",
46
+ ]
47
+ dev = [
48
+ "ipykernel>=7.3.0",
49
+ "jupyter>=1.1.1",
50
+ "dotenv>=0.9.9",
51
+ "LazyCIM[tests]",
52
+ "LazyCIM[kgraphpy]",
53
+ "LazyCIM[validation]",
54
+ "LazyCIM[lint]",
55
+ "LazyCIM[docs]",
56
+ ]
57
+
58
+ [project.urls]
59
+ Homepage = "https://github.com/p-swamp/LazyCIM"
60
+ Repository = "https://github.com/p-swamp/LazyCIM"
61
+ Issues = "https://github.com/p-swamp/LazyCIM/issues"
62
+ Documentation = "https://p-swamp.github.io/LazyCIM/"
63
+
64
+ [tool.uv.sources.kgraphpy]
65
+ git = "https://github.com/statnett/KGraphPy.git"
66
+
67
+ [tool.uv.sources.kgverifypy]
68
+ git = "https://github.com/statnett/KGVerifyPy.git"
69
+
70
+ [tool.ruff]
71
+ target-version = "py312"
72
+
73
+ [tool.ruff.lint]
74
+ extend-select = [
75
+ "I",
76
+ "UP",
77
+ "B",
78
+ "RUF",
79
+ ]
80
+
81
+ [tool.ruff.lint.per-file-ignores]
82
+ "tests/**" = [
83
+ "E712",
84
+ "B018",
85
+ ]
86
+
87
+ [tool.pytest.ini_options]
88
+ testpaths = ["tests"]
89
+ addopts = "--strict-markers -m 'not integration and not docs'"
90
+ markers = [
91
+ "integration: end-to-end tests against real CGMES corpora (deselected by default)",
92
+ "slow: tests that take more than a few seconds",
93
+ "graphdb: requires a live GraphDB endpoint via LAZYCIM_GRAPHDB_URL",
94
+ "docs: executes the code examples in docs/ and README.md (deselected by default)",
95
+ ]
96
+ filterwarnings = ["error::DeprecationWarning:lazycim.*"]
97
+
98
+ [tool.coverage.run]
99
+ source = ["src/lazycim"]
100
+ branch = true
101
+ parallel = true
102
+
103
+ [tool.coverage.paths]
104
+ source = [
105
+ "src/lazycim",
106
+ "*/site-packages/lazycim",
107
+ ]
108
+
109
+ [tool.coverage.report]
110
+ fail_under = 95
111
+ show_missing = true
112
+ skip_covered = true
113
+ exclude_also = [
114
+ "if TYPE_CHECKING:",
115
+ "if __name__ == .__main__.:",
116
+ "raise NotImplementedError",
117
+ '@(abc\.)?abstractmethod',
118
+ ]
119
+
120
+ [build-system]
121
+ requires = ["uv_build>=0.12.5,<0.13.0"]
122
+ build-backend = "uv_build"