Skip to main content

Embodied and end-of-life estimator service.

Project description

JUG LCA Buildings

jug_lca_buildings is a Sabu microservice that estimates building-level life-cycle carbon emissions from GeoJSON building data.

At a high level, the service accepts a GeoJSON FeatureCollection of buildings, runs a building life-cycle assessment workflow, and returns emissions results for the embodied and end-of-life stages. It can return either JSON results for API-to-API use or a CSV report for download and review.

All emission values returned by this service are expressed as kgCO2e per building unless stated otherwise.

This service is part of the broader Sabu project, where each "jug" is a focused microservice for a specific urban carbon or geospatial workflow. In that architecture, jug_lca_buildings covers the building LCA calculation step.

What The Service Does

  • Accepts building data through POST /emissions as JSON or POST /emissions/upload as a GeoJSON file upload.
  • Validates the request structure before running the workflow.
  • Calculates embodied and end-of-life emissions for each building.
  • Can export results as JSON or as a CSV report with per-building rows and totals.
  • Stores generated artifacts under .runtime/jug_lca_buildings unless JUG_LCA_ARTIFACTS_DIR is set.

Units

  • opening_embodied_emissions, envelope_embodied_emissions, and component_embodied_emissions are reported in kgCO2e.
  • opening_end_of_life_emissions, envelope_end_of_life_emissions, and component_end_of_life_emissions are reported in kgCO2e.
  • CSV totals such as total_embodied_emissions, total_end_of_life_emissions, and total_lca_emissions are also reported in kgCO2e.
  • These values are absolute totals for each building, not per-square-metre intensities and not tonnes.

Inputs Needed For Testing

For a basic test request, you need a GeoJSON FeatureCollection where each feature represents one building and includes:

  • type
  • id
  • geometry
  • properties.name
  • properties.address
  • properties.function
  • properties.height
  • properties.year_of_construction

The service also depends on bundled reference data used by the workflow:

Example Test Data

Contract examples already exist in the repository and are the safest starting point for manual or integration testing:

The contract examples include:

  • an example JSON body for POST /emissions
  • an example JSON success response
  • an example CSV export response
  • example error payloads for invalid upload and validation failures

The test suite also shows the minimum valid request shape used in automated tests:

That minimum test payload is a single polygon building with basic metadata such as name, address, function, height, and year of construction.

Running A Simple Test

Once the service is running locally, you can test it by:

  1. Sending a JSON GeoJSON payload to POST /emissions.
  2. Sending the same payload with ?export=csv to download a CSV report.
  3. Uploading a .geojson file to POST /emissions/upload.

External Test Data Reference

Additional example inputs and supporting test data are also available in the external repository:

https://github.com/demianAdli/sabu-test-data-and-examples/tree/main/services/jug_lca_buildings

Use that repository together with the local contract artifacts in this project when preparing manual tests or integration examples.

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

jug_lca_buildings-0.1.0.tar.gz (87.2 kB view details)

Uploaded Source

Built Distribution

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

jug_lca_buildings-0.1.0-py3-none-any.whl (93.6 kB view details)

Uploaded Python 3

File details

Details for the file jug_lca_buildings-0.1.0.tar.gz.

File metadata

  • Download URL: jug_lca_buildings-0.1.0.tar.gz
  • Upload date:
  • Size: 87.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for jug_lca_buildings-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3695621237c992f7839da72f23c79e36dcc4a8c760c55c7b3764d2b75065de25
MD5 eee044d5d46327fb086d75415fd63ef4
BLAKE2b-256 247da0ef53bf3c5e219e9128e7579ef2bfb2951a8acdafb9e698a174bcadc7b4

See more details on using hashes here.

File details

Details for the file jug_lca_buildings-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jug_lca_buildings-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6705243f07bdc6f307a4ae5e59b635adb3cb6c626fef9564d109a43dbc7f2d87
MD5 3bdb5de6c7cee22e4d22b927d0d76ada
BLAKE2b-256 77a346d4ae11007477d5f2b9df7d29fb1e392aab553aead03f267887ce2468cd

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