Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,13 @@ It has also been packaged as a Python package to enable easy, version-controlled
pip install netzero-metrics-reference-data
```

**Usage**

```python
import netzero_metrics_reference_data as nz_data

data = nz_data.load_datapackage()
```

> [!NOTE]
> The data in the root of the repo is active and up-to-date. The data in the src directory is overwritten by the root data when the pacakge is built.
> The data in the root of the repo is active and up-to-date. The data in the src directory is overwritten by the root data when the package is built.
5 changes: 3 additions & 2 deletions src/netzero_metrics_reference_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.joinpath("data")
.joinpath("datapackage.yaml")
)
nzm_pkg = Package(PTH_PKG)

__all__ = ["nzm_pkg"]

def load_datapackage() -> Package:
return Package(PTH_PKG)
5 changes: 4 additions & 1 deletion tests/test_netzero_metrics_reference_data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from netzero_metrics_reference_data import nzm_pkg
from netzero_metrics_reference_data import load_datapackage
from frictionless import Package


def test_nzm_pkg():
nzm_pkg = load_datapackage()
assert isinstance(nzm_pkg, Package)
assert nzm_pkg is not None
li = [
"energy-use-intensity",
Expand Down