Skip to main content

Interface between Brightway2 and D3.js

Project description

polyviz: An interface between brightway2 and D3.js

This is a Python package that provides an interface between the brightway2 LCA framework and the D3.js JavaScript library. It is designed to be used in Jupyter notebooks, and provides interactive visualizations of LCA results.

This interface extends the capabilities of d3blocks, and make it compatible with results generated by brightway2.

polyviz allows the following visualizations to be created from LCA results:

Limitations

Tested only with brightway2 version 2.4.5.

Probably works with version 2.5 too, but not tested.

Installation

Install polyviz from PyPI:

pip install polyviz

and you will need to install a forked version of d3blocks:

pip install git+https://github.com/romainsacchi/d3blocks.git

Usage

Sankey diagrams

from polyviz import sankey
import bw2data

act = bw2data.get_activity(("some db", "some activity"))
method = ("some method", "some method")
sankey(activity=act, method=method)

sankey() returns a filepath to an HTML file that can be opened in a browser.

Alternatively, you can track a specific flow:

from polyviz import sankey
import bw2data

act = bw2data.get_activity(("some db", "some activity"))
flow_type = "kilowatt hour"
sankey(activity=act, flow_type=flow_type)

Other examples are available in the examples notebook.

Support

Do not hesitate to report issues in the Github repository.

Maintainers

Contributing

See contributing.

License

BSD-3-Clause.

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

polyviz-1.0.4.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

polyviz-1.0.4-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polyviz-1.0.4.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for polyviz-1.0.4.tar.gz
Algorithm Hash digest
SHA256 38f280a125e69bcd19f175eba5ddc9c4a5568a90f71a153e3ebee508b56827be
MD5 123be23bf8997d27ef9ce188c7a688c3
BLAKE2b-256 c1fc1275c0942386fd2cc3c2b244608e978b33758678752b5a96ccd21d36281d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: polyviz-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for polyviz-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 71fbd75c9ffe5d2373df4b7d919d21bffb3fb2ef1923b9665adc7a18cd8e9fad
MD5 04e267710481b51f8153246b08a0fd0d
BLAKE2b-256 ebb327ab9ba4cf7a551f7251fff5b9b1445e3476c5a680c0a3df8e12e5fbb57b

See more details on using hashes here.

Supported by

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