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:
- Sankey diagrams (example 1, example 2)
- Chord diagrams (example 1, example 2)
- Force-directed graphs (example 1, example 2)
- Tree maps (example 1, example 2)
- Choropleth maps (example 1, example 2)
- Violin plots (example 1, example 2)
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
Metadata
Release files for polyviz 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polyviz-1.0.4.tar.gz | 16.2 kB | Without provenance | Details for polyviz-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| polyviz-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for polyviz-1.0.4-py3-none-any.whl |
Total release size: 35.4 kB
Release files / polyviz-1.0.4.tar.gz
| Download URL | polyviz-1.0.4.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38f280a125e69bcd19f175eba5ddc9c4a5568a90f71a153e3ebee508b56827be
|
|
BLAKE2b-256 checksum How to use checksums |
c1fc1275c0942386fd2cc3c2b244608e978b33758678752b5a96ccd21d36281d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / polyviz-1.0.4-py3-none-any.whl
| Download URL | polyviz-1.0.4-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71fbd75c9ffe5d2373df4b7d919d21bffb3fb2ef1923b9665adc7a18cd8e9fad
|
|
BLAKE2b-256 checksum How to use checksums |
ebb327ab9ba4cf7a551f7251fff5b9b1445e3476c5a680c0a3df8e12e5fbb57b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for polyviz 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.