Skip to main content

This library simplifies downloading building characteristics and load curve data from NREL's ResStock and ComStock projects.

Project description

buildstock-fetch

Release Build status Commit activity License

This library simplifies downloading building characteristics and load curve data from NREL's ResStock and ComStock projects.

Installing the library

buildstock-fetch is available on PyPI and can be installed via:

pip install buildstock-fetch

or

uv add buildstock-fetch

Using the library

To use the CLI tool in buildstock-fetch run:

bsf

to activate the interactive mode. Alternatively, provide the inputs directly. For example,

bsf --product resstock --release_year 2022 --weather_file tmy3 --release_version 1 --states CA --file_type "hpxml metadata" --upgrade_id "0 1 2" --output_directory ./CA_data

If the above options don't work, try:

python -m buildstock_fetch

For more details about the usage, see Usage

Developing the library

To simplify development, this library uses devcontainers for reproducible development environments and the just command runner for all major tasks.

Available commands are defined in Justfile. To view available them:

just --list

Setting up development environment

This library uses uv for managing python versions, virtual environments, and packages.

However, given the presence of system dependencies, the easiest way to set up the library's develop environment is to use devcontainers. To do so, open up the repo in VSCode, or a VSCode fork like Cursor or Positron.

The editor will auto-detect the presence of the repo's devcontainer (configured in .devcontainer/devcontainer.json). Click "Reopen in Container" to launch the devcontainer.

If you prefer not to use a devcontainer, you can install uv, install the pre-commit hooks, launch the virtualenv, and download the packages (pinned in uv.lock) by running:

./devcontainer/postCreateCommand.sh
just install

Using a system package manager (like brew or apt), you'll also need to manually install just and quarto.

Adding a package

To add a python package to the project:

uv add <package-name>

This replaces pip install <package-name>, and has the effect of adding the package to pyproject.toml, as well as pinning the package version in uv.lock.

To add a package that will only be used as a development tool:

uv add --dev <package-name>

This will update the dev dependency-groups in pyproject.toml, and ensure that the package isn't declared as a run-time dependency of the library itself.

Running code quality checks

We use ruff for linting and code formatting, mypy for type checking, and a series of post-commit hooks for validating YAML, JSON, whitespaces, and so on.

To run code quality checks:

just check

The checks will also be run automatically by Github Actions when opening PRs, merging to main, or creating a new release.

Running tests

Our test are written using pytest and live in tests/. They are checked against multiple python versions using tox.

To run the tests:

just test

Rendering docs

We use mkdocs and mkdocs-material for writing and rendering docs. The docs are written in markdown and live in docs/.

To dynamically render the docs as you develop them:

just docs

To statically render the docs into HTML:

just docs-test

The docs are served by Github Pages out of the gh-pages branch. We do not publish them manually: they are automatically rendered and published by the Github Actions workflow when merging to main.

Releasing the library

To build the package into a wheel file, type:

just build

To publish a release to PyPI using twine:

just publish

To do both in one go:

just build-and-publish

Repository initiated with fpgmaas/cookiecutter-uv.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

buildstock_fetch-1.0.4.tar.gz (96.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

buildstock_fetch-1.0.4-py3-none-any.whl (98.7 MB view details)

Uploaded Python 3

File details

Details for the file buildstock_fetch-1.0.4.tar.gz.

File metadata

  • Download URL: buildstock_fetch-1.0.4.tar.gz
  • Upload date:
  • Size: 96.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for buildstock_fetch-1.0.4.tar.gz
Algorithm Hash digest
SHA256 fea8cd8fe2c7c4e07ad57b47255077411bfc9ca877fd9b3bb074d8c8e9d26b78
MD5 1564990906b2dca44ce21ad899640fc3
BLAKE2b-256 f02e4b35be2364707bd69a0db6c86febde172a68e2c6b759334b85d336eeeae0

See more details on using hashes here.

File details

Details for the file buildstock_fetch-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for buildstock_fetch-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 867ab34e1d7b6627531f6c70eba922b834c5d5ab83cac1083c65f7903df79715
MD5 93b5c212b265db6961b731c82ccf3e15
BLAKE2b-256 8ea100ce7f5d985809f95d469e588e8b19e55b75a165ea3994b6f949b97003ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page