headwater 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.
- headwater-0.1.0/LICENSE +202 -0
- headwater-0.1.0/PKG-INFO +150 -0
- headwater-0.1.0/README.md +111 -0
- headwater-0.1.0/pyproject.toml +113 -0
- headwater-0.1.0/pyproject.toml.orig +116 -0
- headwater-0.1.0/src/headwater/__init__.py +107 -0
- headwater-0.1.0/src/headwater/_lazy.py +33 -0
- headwater-0.1.0/src/headwater/calc/__init__.py +76 -0
- headwater-0.1.0/src/headwater/calc/arrays.py +45 -0
- headwater-0.1.0/src/headwater/calc/cancellation.py +85 -0
- headwater-0.1.0/src/headwater/calc/errors.py +54 -0
- headwater-0.1.0/src/headwater/calc/explain.py +351 -0
- headwater-0.1.0/src/headwater/calc/monte_carlo.py +581 -0
- headwater-0.1.0/src/headwater/calc/signs.py +99 -0
- headwater-0.1.0/src/headwater/calc/skus.py +42 -0
- headwater-0.1.0/src/headwater/calc/solve.py +498 -0
- headwater-0.1.0/src/headwater/calc/study.py +101 -0
- headwater-0.1.0/src/headwater/calc/update.py +378 -0
- headwater-0.1.0/src/headwater/calc/weighting.py +56 -0
- headwater-0.1.0/src/headwater/cli/__init__.py +151 -0
- headwater-0.1.0/src/headwater/cli/_common.py +528 -0
- headwater-0.1.0/src/headwater/cli/brightway.py +96 -0
- headwater-0.1.0/src/headwater/cli/demo.py +38 -0
- headwater-0.1.0/src/headwater/cli/diff.py +270 -0
- headwater-0.1.0/src/headwater/cli/excel.py +154 -0
- headwater-0.1.0/src/headwater/cli/find.py +97 -0
- headwater-0.1.0/src/headwater/cli/method.py +211 -0
- headwater-0.1.0/src/headwater/cli/release.py +155 -0
- headwater-0.1.0/src/headwater/cli/schema.py +35 -0
- headwater-0.1.0/src/headwater/cli/sensitivity.py +101 -0
- headwater-0.1.0/src/headwater/cli/study.py +979 -0
- headwater-0.1.0/src/headwater/cli/upgrade.py +316 -0
- headwater-0.1.0/src/headwater/cli/uses.py +112 -0
- headwater-0.1.0/src/headwater/cli/where.py +40 -0
- headwater-0.1.0/src/headwater/demo/README.md +25 -0
- headwater-0.1.0/src/headwater/demo/releases/toy-background@6864b7dbb65d/exchanges.parquet +0 -0
- headwater-0.1.0/src/headwater/demo/releases/toy-background@6864b7dbb65d/flow_properties.parquet +0 -0
- headwater-0.1.0/src/headwater/demo/releases/toy-background@6864b7dbb65d/flows.parquet +0 -0
- headwater-0.1.0/src/headwater/demo/releases/toy-background@6864b7dbb65d/geographies.parquet +0 -0
- headwater-0.1.0/src/headwater/demo/releases/toy-background@6864b7dbb65d/issues.parquet +0 -0
- headwater-0.1.0/src/headwater/demo/releases/toy-background@6864b7dbb65d/methods/toy-climate/factors.parquet +0 -0
- headwater-0.1.0/src/headwater/demo/releases/toy-background@6864b7dbb65d/processes.parquet +0 -0
- headwater-0.1.0/src/headwater/demo/releases/toy-background@6864b7dbb65d/release.json +75 -0
- headwater-0.1.0/src/headwater/demo/releases/toy-background@6864b7dbb65d/units.parquet +0 -0
- headwater-0.1.0/src/headwater/demo/studies/dyes/database.yaml +3 -0
- headwater-0.1.0/src/headwater/demo/studies/dyes/flows.csv +2 -0
- headwater-0.1.0/src/headwater/demo/studies/dyes/parameters.yaml +5 -0
- headwater-0.1.0/src/headwater/demo/studies/dyes/processes/reactive-dye.csv +4 -0
- headwater-0.1.0/src/headwater/demo/studies/dyes/processes/reactive-dye.yaml +3 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt/database.yaml +3 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt/flows.csv +2 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt/processes/tshirt.csv +4 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt/processes/tshirt.yaml +3 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt-dyed/database.yaml +4 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt-dyed/flows.csv +2 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt-dyed/processes/tshirt.csv +5 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt-dyed/processes/tshirt.yaml +3 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt-footprint/scenarios/cleaner-dye.yaml +5 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt-footprint/study.yaml +8 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt-local-electricity/database.yaml +3 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt-local-electricity/flows.csv +2 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt-local-electricity/overrides/own-wind-power.csv +2 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt-local-electricity/processes/tshirt.csv +4 -0
- headwater-0.1.0/src/headwater/demo/studies/tshirt-local-electricity/processes/tshirt.yaml +3 -0
- headwater-0.1.0/src/headwater/diff/__init__.py +51 -0
- headwater-0.1.0/src/headwater/diff/_attribute.py +663 -0
- headwater-0.1.0/src/headwater/diff/_changes.py +1127 -0
- headwater-0.1.0/src/headwater/diff/_git.py +389 -0
- headwater-0.1.0/src/headwater/diff/_moved.py +44 -0
- headwater-0.1.0/src/headwater/diff/_releases.py +284 -0
- headwater-0.1.0/src/headwater/diff/_render.py +564 -0
- headwater-0.1.0/src/headwater/diff/_study.py +283 -0
- headwater-0.1.0/src/headwater/io/__init__.py +6 -0
- headwater-0.1.0/src/headwater/io/allocate.py +327 -0
- headwater-0.1.0/src/headwater/io/brightway/__init__.py +20 -0
- headwater-0.1.0/src/headwater/io/brightway/importer.py +134 -0
- headwater-0.1.0/src/headwater/io/brightway/project.py +465 -0
- headwater-0.1.0/src/headwater/io/brightway/reader.py +282 -0
- headwater-0.1.0/src/headwater/io/ecospold1/__init__.py +87 -0
- headwater-0.1.0/src/headwater/io/ecospold1/assemble.py +282 -0
- headwater-0.1.0/src/headwater/io/ecospold1/dataset.py +403 -0
- headwater-0.1.0/src/headwater/io/ecospold1/reader.py +162 -0
- headwater-0.1.0/src/headwater/io/ecospold1/roles.py +165 -0
- headwater-0.1.0/src/headwater/io/ecospold1/uncertainty.py +180 -0
- headwater-0.1.0/src/headwater/io/ecospold1/units.py +46 -0
- headwater-0.1.0/src/headwater/io/ecospold2/__init__.py +57 -0
- headwater-0.1.0/src/headwater/io/ecospold2/dataset.py +715 -0
- headwater-0.1.0/src/headwater/io/ecospold2/geographies.py +59 -0
- headwater-0.1.0/src/headwater/io/ecospold2/masterdata.py +324 -0
- headwater-0.1.0/src/headwater/io/ecospold2/reader.py +382 -0
- headwater-0.1.0/src/headwater/io/excel/__init__.py +52 -0
- headwater-0.1.0/src/headwater/io/excel/activities.py +187 -0
- headwater-0.1.0/src/headwater/io/excel/convert.py +279 -0
- headwater-0.1.0/src/headwater/io/excel/database_yaml.py +217 -0
- headwater-0.1.0/src/headwater/io/excel/importer.py +219 -0
- headwater-0.1.0/src/headwater/io/excel/index.py +152 -0
- headwater-0.1.0/src/headwater/io/excel/lines.py +480 -0
- headwater-0.1.0/src/headwater/io/excel/linking.py +322 -0
- headwater-0.1.0/src/headwater/io/excel/mapping.py +198 -0
- headwater-0.1.0/src/headwater/io/excel/parameters.py +164 -0
- headwater-0.1.0/src/headwater/io/excel/records.py +172 -0
- headwater-0.1.0/src/headwater/io/excel/report.py +257 -0
- headwater-0.1.0/src/headwater/io/excel/uncertainty.py +145 -0
- headwater-0.1.0/src/headwater/io/excel/units.py +89 -0
- headwater-0.1.0/src/headwater/io/excel/workbook.py +524 -0
- headwater-0.1.0/src/headwater/io/excel/write.py +224 -0
- headwater-0.1.0/src/headwater/io/exclude.py +105 -0
- headwater-0.1.0/src/headwater/io/files.py +25 -0
- headwater-0.1.0/src/headwater/io/formats.py +122 -0
- headwater-0.1.0/src/headwater/io/inventory.py +269 -0
- headwater-0.1.0/src/headwater/io/lcia/__init__.py +49 -0
- headwater-0.1.0/src/headwater/io/lcia/reader.py +138 -0
- headwater-0.1.0/src/headwater/io/lcia/workbook.py +413 -0
- headwater-0.1.0/src/headwater/io/method.py +412 -0
- headwater-0.1.0/src/headwater/io/nwset.py +109 -0
- headwater-0.1.0/src/headwater/io/olca_jsonld/__init__.py +26 -0
- headwater-0.1.0/src/headwater/io/olca_jsonld/flows.py +194 -0
- headwater-0.1.0/src/headwater/io/olca_jsonld/inventory.py +413 -0
- headwater-0.1.0/src/headwater/io/olca_jsonld/method.py +201 -0
- headwater-0.1.0/src/headwater/io/olca_jsonld/package.py +185 -0
- headwater-0.1.0/src/headwater/io/simapro_csv/__init__.py +43 -0
- headwater-0.1.0/src/headwater/io/simapro_csv/blocks.py +146 -0
- headwater-0.1.0/src/headwater/io/simapro_csv/export.py +162 -0
- headwater-0.1.0/src/headwater/io/simapro_csv/header.py +111 -0
- headwater-0.1.0/src/headwater/io/simapro_csv/method.py +129 -0
- headwater-0.1.0/src/headwater/io/simapro_csv/reader.py +297 -0
- headwater-0.1.0/src/headwater/io/simapro_csv/records.py +573 -0
- headwater-0.1.0/src/headwater/io/simapro_csv/text.py +40 -0
- headwater-0.1.0/src/headwater/io/simapro_csv/units.py +40 -0
- headwater-0.1.0/src/headwater/io/source.py +279 -0
- headwater-0.1.0/src/headwater/io/units.py +199 -0
- headwater-0.1.0/src/headwater/link/__init__.py +42 -0
- headwater-0.1.0/src/headwater/link/by_id.py +92 -0
- headwater-0.1.0/src/headwater/link/by_name.py +248 -0
- headwater-0.1.0/src/headwater/link/flows.py +113 -0
- headwater-0.1.0/src/headwater/link/lines.py +192 -0
- headwater-0.1.0/src/headwater/link/mapping.py +241 -0
- headwater-0.1.0/src/headwater/model/__init__.py +112 -0
- headwater-0.1.0/src/headwater/model/_types.py +17 -0
- headwater-0.1.0/src/headwater/model/catalog.py +155 -0
- headwater-0.1.0/src/headwater/model/database.py +117 -0
- headwater-0.1.0/src/headwater/model/errors.py +122 -0
- headwater-0.1.0/src/headwater/model/flows.py +63 -0
- headwater-0.1.0/src/headwater/model/formula.py +561 -0
- headwater-0.1.0/src/headwater/model/issue.py +81 -0
- headwater-0.1.0/src/headwater/model/method.py +224 -0
- headwater-0.1.0/src/headwater/model/nwset.py +217 -0
- headwater-0.1.0/src/headwater/model/override.py +106 -0
- headwater-0.1.0/src/headwater/model/parameters.py +320 -0
- headwater-0.1.0/src/headwater/model/process.py +232 -0
- headwater-0.1.0/src/headwater/model/roles.py +36 -0
- headwater-0.1.0/src/headwater/model/scenario.py +147 -0
- headwater-0.1.0/src/headwater/model/study.py +71 -0
- headwater-0.1.0/src/headwater/model/uncertainty.py +112 -0
- headwater-0.1.0/src/headwater/model/units.py +134 -0
- headwater-0.1.0/src/headwater/py.typed +0 -0
- headwater-0.1.0/src/headwater/query/__init__.py +80 -0
- headwater-0.1.0/src/headwater/query/_git.py +28 -0
- headwater-0.1.0/src/headwater/query/_hash.py +66 -0
- headwater-0.1.0/src/headwater/query/_internals.py +29 -0
- headwater-0.1.0/src/headwater/query/_open.py +27 -0
- headwater-0.1.0/src/headwater/query/_release.py +488 -0
- headwater-0.1.0/src/headwater/query/_scenario.py +248 -0
- headwater-0.1.0/src/headwater/query/_study_draws.py +482 -0
- headwater-0.1.0/src/headwater/query/_system.py +418 -0
- headwater-0.1.0/src/headwater/query/_uncertainty.py +175 -0
- headwater-0.1.0/src/headwater/query/background.py +1019 -0
- headwater-0.1.0/src/headwater/query/database.py +866 -0
- headwater-0.1.0/src/headwater/query/monte_carlo.py +617 -0
- headwater-0.1.0/src/headwater/query/result.py +1133 -0
- headwater-0.1.0/src/headwater/query/search.py +335 -0
- headwater-0.1.0/src/headwater/query/skus.py +279 -0
- headwater-0.1.0/src/headwater/query/study.py +607 -0
- headwater-0.1.0/src/headwater/release/__init__.py +51 -0
- headwater-0.1.0/src/headwater/release/cache.py +186 -0
- headwater-0.1.0/src/headwater/release/checks.py +1016 -0
- headwater-0.1.0/src/headwater/release/content.py +245 -0
- headwater-0.1.0/src/headwater/release/indicators.py +162 -0
- headwater-0.1.0/src/headwater/release/manifest.py +103 -0
- headwater-0.1.0/src/headwater/release/read.py +380 -0
- headwater-0.1.0/src/headwater/release/remote.py +159 -0
- headwater-0.1.0/src/headwater/release/schema.py +408 -0
- headwater-0.1.0/src/headwater/release/write.py +518 -0
- headwater-0.1.0/src/headwater/study/__init__.py +44 -0
- headwater-0.1.0/src/headwater/study/_cut_offs.py +264 -0
- headwater-0.1.0/src/headwater/study/_exchanges.py +207 -0
- headwater-0.1.0/src/headwater/study/_files.py +324 -0
- headwater-0.1.0/src/headwater/study/_no_factor.py +107 -0
- headwater-0.1.0/src/headwater/study/_overrides.py +117 -0
- headwater-0.1.0/src/headwater/study/_parameters.py +206 -0
- headwater-0.1.0/src/headwater/study/_scenarios.py +480 -0
- headwater-0.1.0/src/headwater/study/_study.py +308 -0
- headwater-0.1.0/src/headwater/study/_uncertainty.py +118 -0
- headwater-0.1.0/src/headwater/study/_uses.py +199 -0
- headwater-0.1.0/src/headwater/study/_write.py +361 -0
- headwater-0.1.0/src/headwater/study/edit.py +934 -0
- headwater-0.1.0/src/headwater/study/folders.py +168 -0
- headwater-0.1.0/src/headwater/study/reader.py +625 -0
- headwater-0.1.0/src/headwater/study/schema.py +171 -0
- headwater-0.1.0/src/headwater/study/validate.py +686 -0
- headwater-0.1.0/src/headwater/upgrade/__init__.py +30 -0
- headwater-0.1.0/src/headwater/upgrade/_datasets.py +133 -0
- headwater-0.1.0/src/headwater/upgrade/_flags.py +132 -0
- headwater-0.1.0/src/headwater/upgrade/_moves.py +103 -0
- headwater-0.1.0/src/headwater/upgrade/_plan.py +466 -0
- headwater-0.1.0/src/headwater/upgrade/_rules.py +214 -0
- headwater-0.1.0/src/headwater/upgrade/_write.py +213 -0
headwater-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Leonardo Natale
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
headwater-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: headwater
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Python library for life cycle assessment (LCA).
|
|
5
|
+
Keywords: life cycle assessment,lca,carbon footprint,ecoinvent,environmental footprint,sustainability
|
|
6
|
+
Author: Leonardo Natale
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Science/Research
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering
|
|
17
|
+
Classifier: Typing :: Typed
|
|
18
|
+
Requires-Dist: numpy>=2.1
|
|
19
|
+
Requires-Dist: scipy>=1.17
|
|
20
|
+
Requires-Dist: pydantic>=2.8
|
|
21
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
22
|
+
Requires-Dist: duckdb>=1.5.6
|
|
23
|
+
Requires-Dist: pyarrow>=26.0.0
|
|
24
|
+
Requires-Dist: lxml>=6.1.3
|
|
25
|
+
Requires-Dist: typer>=0.27.2
|
|
26
|
+
Requires-Dist: openpyxl>=3.1.5
|
|
27
|
+
Requires-Dist: fsspec[http]>=2026.9.0
|
|
28
|
+
Requires-Dist: gcsfs>=2026.10.1 ; extra == 'gcs'
|
|
29
|
+
Requires-Dist: pandas>=2.2.3 ; extra == 'pandas'
|
|
30
|
+
Requires-Dist: s3fs>=2026.9.0 ; extra == 's3'
|
|
31
|
+
Requires-Python: >=3.13
|
|
32
|
+
Project-URL: Repository, https://github.com/LeonardoNatale/headwater
|
|
33
|
+
Project-URL: Documentation, https://github.com/LeonardoNatale/headwater/tree/main/docs
|
|
34
|
+
Project-URL: Issues, https://github.com/LeonardoNatale/headwater/issues
|
|
35
|
+
Provides-Extra: gcs
|
|
36
|
+
Provides-Extra: pandas
|
|
37
|
+
Provides-Extra: s3
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# headwater
|
|
41
|
+
|
|
42
|
+
A Python library for life cycle assessment (LCA).
|
|
43
|
+
|
|
44
|
+
Background databases like ecoinvent are imported once per version into immutable Parquet files, with every product's impact scores already solved. Studies are plain text files in git. Calculations run inside your Python process with DuckDB and SciPy. There is no server and no database to install.
|
|
45
|
+
|
|
46
|
+
**Status: alpha.** File formats and the Python API may change before 1.0. headwater imports ecoinvent 3.12, cut-off and APOS, and other sources (ecoSpold1, SimaPro CSV, openLCA JSON-LD) into frozen releases, and pulls them from a folder or a bucket URL. Databases, written as YAML and CSV or converted from a Brightway Excel workbook or a database of a Brightway project, and the studies that ask a question of them, calculate, explain, give single scores and Monte Carlo ranges, upgrade to a new release and show their changes as a diff on pull requests. Not there yet: publishing a database as a release, and EF 3.1 single scores with JRC's factors ([roadmap](https://github.com/LeonardoNatale/headwater/blob/main/docs/roadmap.md)).
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install headwater
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Python 3.13 or later. Extras: `headwater[pandas]` for tables as DataFrames, `headwater[gcs]` and `headwater[s3]` to pull releases from Google Cloud Storage or S3.
|
|
55
|
+
|
|
56
|
+
## Quick start
|
|
57
|
+
|
|
58
|
+
The demo is a toy: it needs no licence and no download beyond the package.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install headwater
|
|
62
|
+
headwater demo headwater-demo
|
|
63
|
+
cd headwater-demo
|
|
64
|
+
headwater release pull releases/toy-background@6864b7dbb65d
|
|
65
|
+
headwater calc studies/tshirt-footprint
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`headwater demo` copies a toy background, frozen as a release, four small databases and a study into `headwater-demo`. `release pull` checks the release and copies it into your cache, `~/.headwater` or `$HEADWATER_HOME`. `calc` scores the study, one dyed T-shirt: 1.24265 kg CO₂-eq, with the data versions and the solver checks behind it.
|
|
69
|
+
|
|
70
|
+
The same in Python, in that folder:
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
import headwater as hw
|
|
74
|
+
|
|
75
|
+
background = hw.load("toy-background@6864b7dbb65d")
|
|
76
|
+
[result] = hw.open("studies/tshirt-footprint").calc(background)
|
|
77
|
+
print(f"{result.score:.6f}") # 1.242646
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Next: `headwater --help`, the folder's README.md, and [Setup](https://github.com/LeonardoNatale/headwater/blob/main/docs/workflows.md#setup) to import ecoinvent.
|
|
81
|
+
|
|
82
|
+
## One example
|
|
83
|
+
|
|
84
|
+
A toy T-shirt factory buys 0.25 kg of cotton fabric and 0.5 kWh of electricity per T-shirt. The background database already knows the score of each thing it buys:
|
|
85
|
+
|
|
86
|
+
| Bought | Amount | Stored score (kg CO₂-eq per unit) | Contribution |
|
|
87
|
+
|---|---|---|---|
|
|
88
|
+
| cotton fabric | 0.25 kg | 3.7086 | 0.92715 |
|
|
89
|
+
| electricity | 0.5 kWh | 0.5298 | 0.26490 |
|
|
90
|
+
| **T-shirt** | | | **1.19205** |
|
|
91
|
+
|
|
92
|
+
Change the fabric to 0.30 kg and the answer is 1.37748, with no work on the background. The same idea scales to ecoinvent (23,522 products) and to tens of thousands of SKUs. [docs/calculation.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/calculation.md) explains the math on this example.
|
|
93
|
+
|
|
94
|
+
## Goal
|
|
95
|
+
|
|
96
|
+
- **Correct numbers, or an error.** Unlinked inputs, unknown units and numerically unsafe results stop the work with a list of what is wrong. A flow the method does not cover is listed on the result. In a database's own processes it is an error until a row of the database's `no_factor.csv` says why it counts 0. Nothing is dropped silently.
|
|
97
|
+
- **Explainable numbers.** For any result: what it buys, where emissions physically happen, and which inputs matter most.
|
|
98
|
+
- **Reproducible numbers.** Every result records the exact data versions, method, code commit and solver settings that produced it.
|
|
99
|
+
- **Easy setup.** `pip install headwater`, a folder, and git. Background data is imported once and reused, never re-imported per project.
|
|
100
|
+
- **Fast enough to stop thinking about speed.** Editing a database, scoring a portfolio of SKUs and exploring scenarios happen in milliseconds once the background is loaded.
|
|
101
|
+
- **A general library.** Nothing in it is specific to one company. Organisation-specific code (storage, exports, reporting rules) lives in separate packages.
|
|
102
|
+
|
|
103
|
+
## What we found
|
|
104
|
+
|
|
105
|
+
We studied Brightway, the leading open-source Python LCA framework, by reading its code, reproducing its failures and timing it on ecoinvent 3.10. Its calculation core is sound. Its data layer is where things go wrong: integer ids that change on every rewrite, writes that delete and reinsert, data spread over seven kinds of files, and failures that return a wrong number instead of an error. We also checked our own design against LCA practice (ecoinvent conventions, ISO 14044/14067, PEF, GHG Protocol) and corrected it. Details and evidence: [docs/findings.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/findings.md). All measurements: [docs/appendix/benchmarks.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/appendix/benchmarks.md).
|
|
106
|
+
|
|
107
|
+
## What we build
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
headwater the library: data model, importers, validation, releases,
|
|
111
|
+
calculation, database files, CLI and Python API
|
|
112
|
+
headwater-<org> optional, private, per organisation: storage access,
|
|
113
|
+
exports to internal systems, reporting rules
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Stack
|
|
117
|
+
|
|
118
|
+
| Part | Choice |
|
|
119
|
+
|---|---|
|
|
120
|
+
| Language | Python 3.13+ (developed on 3.14) |
|
|
121
|
+
| Background data | Parquet files (zstd), immutable, named by content hash |
|
|
122
|
+
| Query engine | DuckDB, in-process, in memory |
|
|
123
|
+
| Calculation | NumPy and SciPy sparse (SuperLU), solver pluggable |
|
|
124
|
+
| Studies and history | YAML and CSV files in git |
|
|
125
|
+
| Records and validation | Pydantic |
|
|
126
|
+
| Parsing ecoSpold2 | lxml |
|
|
127
|
+
| Tooling | uv, ruff, pyright, pytest |
|
|
128
|
+
|
|
129
|
+
No Postgres and no server in v1. Reasons in [docs/design.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/design.md#stack).
|
|
130
|
+
|
|
131
|
+
## Docs
|
|
132
|
+
|
|
133
|
+
| Read | When |
|
|
134
|
+
|---|---|
|
|
135
|
+
| [AGENTS.md](https://github.com/LeonardoNatale/headwater/blob/main/AGENTS.md) | Before writing any code. Rules that are not negotiable. |
|
|
136
|
+
| [docs/findings.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/findings.md) | You want to know why the design is the way it is. |
|
|
137
|
+
| [docs/design.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/design.md) | Principles, architecture, data model, file formats. |
|
|
138
|
+
| [docs/calculation.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/calculation.md) | How results are computed, explained and updated. |
|
|
139
|
+
| [docs/workflows.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/workflows.md) | Setup, commands, collaboration with git, CI. |
|
|
140
|
+
| [notebooks/](https://github.com/LeonardoNatale/headwater/tree/main/notebooks) | You want to learn by running code, in a clone of the repository: getting started, a first footprint, writing a database, ecoinvent 3.12, and the same tasks in Brightway and headwater side by side. |
|
|
141
|
+
| [docs/roadmap.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/roadmap.md) | What to build in which order, and the test that closes each step. |
|
|
142
|
+
| [docs/decisions.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/decisions.md) | What is settled, and what is still open. |
|
|
143
|
+
| [docs/appendix/benchmarks.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/appendix/benchmarks.md) | Every measured number, with its scope and script. |
|
|
144
|
+
| [docs/appendix/glossary.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/appendix/glossary.md) | LCA and math terms in plain words. |
|
|
145
|
+
| [docs/appendix/sources.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/appendix/sources.md) | Links. |
|
|
146
|
+
| [bench/](https://github.com/LeonardoNatale/headwater/tree/main/bench) | The scripts behind the measurements. |
|
|
147
|
+
|
|
148
|
+
## Licence
|
|
149
|
+
|
|
150
|
+
Apache-2.0: [LICENSE](https://github.com/LeonardoNatale/headwater/blob/main/LICENSE). The demo and the test fixtures are toy data. No licensed data is in the package or the repository.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# headwater
|
|
2
|
+
|
|
3
|
+
A Python library for life cycle assessment (LCA).
|
|
4
|
+
|
|
5
|
+
Background databases like ecoinvent are imported once per version into immutable Parquet files, with every product's impact scores already solved. Studies are plain text files in git. Calculations run inside your Python process with DuckDB and SciPy. There is no server and no database to install.
|
|
6
|
+
|
|
7
|
+
**Status: alpha.** File formats and the Python API may change before 1.0. headwater imports ecoinvent 3.12, cut-off and APOS, and other sources (ecoSpold1, SimaPro CSV, openLCA JSON-LD) into frozen releases, and pulls them from a folder or a bucket URL. Databases, written as YAML and CSV or converted from a Brightway Excel workbook or a database of a Brightway project, and the studies that ask a question of them, calculate, explain, give single scores and Monte Carlo ranges, upgrade to a new release and show their changes as a diff on pull requests. Not there yet: publishing a database as a release, and EF 3.1 single scores with JRC's factors ([roadmap](https://github.com/LeonardoNatale/headwater/blob/main/docs/roadmap.md)).
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install headwater
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Python 3.13 or later. Extras: `headwater[pandas]` for tables as DataFrames, `headwater[gcs]` and `headwater[s3]` to pull releases from Google Cloud Storage or S3.
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
The demo is a toy: it needs no licence and no download beyond the package.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install headwater
|
|
23
|
+
headwater demo headwater-demo
|
|
24
|
+
cd headwater-demo
|
|
25
|
+
headwater release pull releases/toy-background@6864b7dbb65d
|
|
26
|
+
headwater calc studies/tshirt-footprint
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`headwater demo` copies a toy background, frozen as a release, four small databases and a study into `headwater-demo`. `release pull` checks the release and copies it into your cache, `~/.headwater` or `$HEADWATER_HOME`. `calc` scores the study, one dyed T-shirt: 1.24265 kg CO₂-eq, with the data versions and the solver checks behind it.
|
|
30
|
+
|
|
31
|
+
The same in Python, in that folder:
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
import headwater as hw
|
|
35
|
+
|
|
36
|
+
background = hw.load("toy-background@6864b7dbb65d")
|
|
37
|
+
[result] = hw.open("studies/tshirt-footprint").calc(background)
|
|
38
|
+
print(f"{result.score:.6f}") # 1.242646
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Next: `headwater --help`, the folder's README.md, and [Setup](https://github.com/LeonardoNatale/headwater/blob/main/docs/workflows.md#setup) to import ecoinvent.
|
|
42
|
+
|
|
43
|
+
## One example
|
|
44
|
+
|
|
45
|
+
A toy T-shirt factory buys 0.25 kg of cotton fabric and 0.5 kWh of electricity per T-shirt. The background database already knows the score of each thing it buys:
|
|
46
|
+
|
|
47
|
+
| Bought | Amount | Stored score (kg CO₂-eq per unit) | Contribution |
|
|
48
|
+
|---|---|---|---|
|
|
49
|
+
| cotton fabric | 0.25 kg | 3.7086 | 0.92715 |
|
|
50
|
+
| electricity | 0.5 kWh | 0.5298 | 0.26490 |
|
|
51
|
+
| **T-shirt** | | | **1.19205** |
|
|
52
|
+
|
|
53
|
+
Change the fabric to 0.30 kg and the answer is 1.37748, with no work on the background. The same idea scales to ecoinvent (23,522 products) and to tens of thousands of SKUs. [docs/calculation.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/calculation.md) explains the math on this example.
|
|
54
|
+
|
|
55
|
+
## Goal
|
|
56
|
+
|
|
57
|
+
- **Correct numbers, or an error.** Unlinked inputs, unknown units and numerically unsafe results stop the work with a list of what is wrong. A flow the method does not cover is listed on the result. In a database's own processes it is an error until a row of the database's `no_factor.csv` says why it counts 0. Nothing is dropped silently.
|
|
58
|
+
- **Explainable numbers.** For any result: what it buys, where emissions physically happen, and which inputs matter most.
|
|
59
|
+
- **Reproducible numbers.** Every result records the exact data versions, method, code commit and solver settings that produced it.
|
|
60
|
+
- **Easy setup.** `pip install headwater`, a folder, and git. Background data is imported once and reused, never re-imported per project.
|
|
61
|
+
- **Fast enough to stop thinking about speed.** Editing a database, scoring a portfolio of SKUs and exploring scenarios happen in milliseconds once the background is loaded.
|
|
62
|
+
- **A general library.** Nothing in it is specific to one company. Organisation-specific code (storage, exports, reporting rules) lives in separate packages.
|
|
63
|
+
|
|
64
|
+
## What we found
|
|
65
|
+
|
|
66
|
+
We studied Brightway, the leading open-source Python LCA framework, by reading its code, reproducing its failures and timing it on ecoinvent 3.10. Its calculation core is sound. Its data layer is where things go wrong: integer ids that change on every rewrite, writes that delete and reinsert, data spread over seven kinds of files, and failures that return a wrong number instead of an error. We also checked our own design against LCA practice (ecoinvent conventions, ISO 14044/14067, PEF, GHG Protocol) and corrected it. Details and evidence: [docs/findings.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/findings.md). All measurements: [docs/appendix/benchmarks.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/appendix/benchmarks.md).
|
|
67
|
+
|
|
68
|
+
## What we build
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
headwater the library: data model, importers, validation, releases,
|
|
72
|
+
calculation, database files, CLI and Python API
|
|
73
|
+
headwater-<org> optional, private, per organisation: storage access,
|
|
74
|
+
exports to internal systems, reporting rules
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Stack
|
|
78
|
+
|
|
79
|
+
| Part | Choice |
|
|
80
|
+
|---|---|
|
|
81
|
+
| Language | Python 3.13+ (developed on 3.14) |
|
|
82
|
+
| Background data | Parquet files (zstd), immutable, named by content hash |
|
|
83
|
+
| Query engine | DuckDB, in-process, in memory |
|
|
84
|
+
| Calculation | NumPy and SciPy sparse (SuperLU), solver pluggable |
|
|
85
|
+
| Studies and history | YAML and CSV files in git |
|
|
86
|
+
| Records and validation | Pydantic |
|
|
87
|
+
| Parsing ecoSpold2 | lxml |
|
|
88
|
+
| Tooling | uv, ruff, pyright, pytest |
|
|
89
|
+
|
|
90
|
+
No Postgres and no server in v1. Reasons in [docs/design.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/design.md#stack).
|
|
91
|
+
|
|
92
|
+
## Docs
|
|
93
|
+
|
|
94
|
+
| Read | When |
|
|
95
|
+
|---|---|
|
|
96
|
+
| [AGENTS.md](https://github.com/LeonardoNatale/headwater/blob/main/AGENTS.md) | Before writing any code. Rules that are not negotiable. |
|
|
97
|
+
| [docs/findings.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/findings.md) | You want to know why the design is the way it is. |
|
|
98
|
+
| [docs/design.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/design.md) | Principles, architecture, data model, file formats. |
|
|
99
|
+
| [docs/calculation.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/calculation.md) | How results are computed, explained and updated. |
|
|
100
|
+
| [docs/workflows.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/workflows.md) | Setup, commands, collaboration with git, CI. |
|
|
101
|
+
| [notebooks/](https://github.com/LeonardoNatale/headwater/tree/main/notebooks) | You want to learn by running code, in a clone of the repository: getting started, a first footprint, writing a database, ecoinvent 3.12, and the same tasks in Brightway and headwater side by side. |
|
|
102
|
+
| [docs/roadmap.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/roadmap.md) | What to build in which order, and the test that closes each step. |
|
|
103
|
+
| [docs/decisions.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/decisions.md) | What is settled, and what is still open. |
|
|
104
|
+
| [docs/appendix/benchmarks.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/appendix/benchmarks.md) | Every measured number, with its scope and script. |
|
|
105
|
+
| [docs/appendix/glossary.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/appendix/glossary.md) | LCA and math terms in plain words. |
|
|
106
|
+
| [docs/appendix/sources.md](https://github.com/LeonardoNatale/headwater/blob/main/docs/appendix/sources.md) | Links. |
|
|
107
|
+
| [bench/](https://github.com/LeonardoNatale/headwater/tree/main/bench) | The scripts behind the measurements. |
|
|
108
|
+
|
|
109
|
+
## Licence
|
|
110
|
+
|
|
111
|
+
Apache-2.0: [LICENSE](https://github.com/LeonardoNatale/headwater/blob/main/LICENSE). The demo and the test fixtures are toy data. No licensed data is in the package or the repository.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "headwater"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "A Python library for life cycle assessment (LCA)."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "Apache-2.0"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
keywords = [
|
|
9
|
+
"life cycle assessment",
|
|
10
|
+
"lca",
|
|
11
|
+
"carbon footprint",
|
|
12
|
+
"ecoinvent",
|
|
13
|
+
"environmental footprint",
|
|
14
|
+
"sustainability",
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Intended Audience :: Science/Research",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Programming Language :: Python :: 3.14",
|
|
24
|
+
"Topic :: Scientific/Engineering",
|
|
25
|
+
"Typing :: Typed",
|
|
26
|
+
]
|
|
27
|
+
requires-python = ">=3.13"
|
|
28
|
+
dependencies = [
|
|
29
|
+
"numpy>=2.1",
|
|
30
|
+
"scipy>=1.17",
|
|
31
|
+
"pydantic>=2.8",
|
|
32
|
+
"pyyaml>=6.0.2",
|
|
33
|
+
"duckdb>=1.5.6",
|
|
34
|
+
"pyarrow>=26.0.0",
|
|
35
|
+
"lxml>=6.1.3",
|
|
36
|
+
"typer>=0.27.2",
|
|
37
|
+
"openpyxl>=3.1.5",
|
|
38
|
+
"fsspec[http]>=2026.9.0",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[[project.authors]]
|
|
42
|
+
name = "Leonardo Natale"
|
|
43
|
+
|
|
44
|
+
[project.urls]
|
|
45
|
+
Repository = "https://github.com/LeonardoNatale/headwater"
|
|
46
|
+
Documentation = "https://github.com/LeonardoNatale/headwater/tree/main/docs"
|
|
47
|
+
Issues = "https://github.com/LeonardoNatale/headwater/issues"
|
|
48
|
+
|
|
49
|
+
[project.scripts]
|
|
50
|
+
headwater = "headwater.cli:main"
|
|
51
|
+
|
|
52
|
+
[project.optional-dependencies]
|
|
53
|
+
gcs = ["gcsfs>=2026.10.1"]
|
|
54
|
+
s3 = ["s3fs>=2026.9.0"]
|
|
55
|
+
pandas = ["pandas>=2.2.3"]
|
|
56
|
+
|
|
57
|
+
[build-system]
|
|
58
|
+
requires = ["uv_build>=0.13.0,<0.14.0"]
|
|
59
|
+
build-backend = "uv_build"
|
|
60
|
+
|
|
61
|
+
[dependency-groups]
|
|
62
|
+
dev = [
|
|
63
|
+
"jsonschema>=4.26",
|
|
64
|
+
"pandas>=2.2",
|
|
65
|
+
"pandas-stubs",
|
|
66
|
+
"pyarrow-stubs>=20.0.0.20260819",
|
|
67
|
+
"pyright[nodejs]",
|
|
68
|
+
"pytest",
|
|
69
|
+
"ruff",
|
|
70
|
+
"scipy-stubs",
|
|
71
|
+
"types-lxml>=2026.2.16",
|
|
72
|
+
"types-openpyxl>=3.1.5.20260827",
|
|
73
|
+
]
|
|
74
|
+
notebooks = [
|
|
75
|
+
"ipykernel",
|
|
76
|
+
"nbmake",
|
|
77
|
+
"pandas",
|
|
78
|
+
]
|
|
79
|
+
brightway = [
|
|
80
|
+
"bw2data==4.5.4",
|
|
81
|
+
"bw2calc==2.3",
|
|
82
|
+
"bw2io==0.9.14",
|
|
83
|
+
"peewee==3.19.0",
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
[tool.ruff]
|
|
87
|
+
line-length = 100
|
|
88
|
+
extend-exclude = ["bench"]
|
|
89
|
+
|
|
90
|
+
[tool.ruff.format]
|
|
91
|
+
exclude = ["*.md"]
|
|
92
|
+
|
|
93
|
+
[tool.ruff.lint]
|
|
94
|
+
select = [
|
|
95
|
+
"E",
|
|
96
|
+
"F",
|
|
97
|
+
"I",
|
|
98
|
+
"UP",
|
|
99
|
+
"B",
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
[tool.pyright]
|
|
103
|
+
include = [
|
|
104
|
+
"src",
|
|
105
|
+
"tests",
|
|
106
|
+
]
|
|
107
|
+
strict = ["src"]
|
|
108
|
+
pythonVersion = "3.13"
|
|
109
|
+
|
|
110
|
+
[tool.pytest.ini_options]
|
|
111
|
+
testpaths = ["tests"]
|
|
112
|
+
addopts = ["--import-mode=importlib"]
|
|
113
|
+
filterwarnings = ["error::UserWarning:headwater"]
|