molcrafts-molplot
Unified scientific charting for the MolCrafts stack — the Python / matplotlib half of MolPlot.
It wraps scienceplots and injects
MolPlot's unified preset (palette, type scale, grid, light/dark) so a figure
made here matches the same preset rendered in the browser by the TypeScript
package @molcrafts/molplot.
The bridge between the two renderers is the Vega-Lite spec — a portable JSON intermediate language. Build a spec in Python and either ship it to the web or render it to matplotlib for a publication figure.
Install
pip install molcrafts-molplot
# optional exact web-parity export (real Vega engine → PNG/SVG):
pip install "molcrafts-molplot[convert]"
Style — scienceplots + unified preset
import matplotlib.pyplot as plt
import molplot
molplot.use("molplot") # scienceplots base + MolPlot overlay
# or a publication variant (serif, high-DPI, scienceplots 'nature' base):
molplot.use("molplot-paper")
with molplot.style("molplot", mode="dark"):
plt.plot(x, y) # scoped; restores rcParams on exit
molplot.palette()[0] # '#0c5da5' — same categorical colours as the web
plt.style.use("molplot") also works directly (the .mplstyle files are
registered on import) — but molplot.use() additionally layers the scienceplots
base styles named by the preset.
Charts — one call, or via the portable spec
# one call → (fig, ax)
fig, ax = molplot.line(
[{"id": "E_total", "x": steps, "y": e_total},
{"id": "E_kin", "x": steps, "y": e_kin}],
x_label="step", y_label="energy (kcal/mol)", show_legend=True,
)
# or build the Vega-Lite spec and choose a renderer:
spec = molplot.scatter_spec(pc1, pc2, color=cluster_id, colorscale="viridis")
fig, ax = molplot.render(spec) # matplotlib (scienceplots)
molplot.to_png(spec, "fig.png") # exact web parity via vl-convert (optional)
import json; json.dumps(spec) # ship the same spec to the browser
line_spec / scatter_spec / bar_spec / gantt_spec emit the same Vega-Lite
shapes as the TypeScript @molcrafts/molplot builders.
License
BSD-3-Clause
Metadata
Release files for molcrafts-molplot 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| molcrafts_molplot-0.1.6.tar.gz | 25.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| molcrafts_molplot-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.2 kB
Release files / molcrafts_molplot-0.1.6.tar.gz
| Download URL | molcrafts_molplot-0.1.6.tar.gz |
|---|---|
| Size | 25.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1753c4f3ddcb0ef31f0372dcf2be3b89b7d8f26923cf8b02cd2b30978b4edf16
|
|
BLAKE2b-256 checksum How to use checksums |
3ddb4df7d7640c42b106a55d9733a453767b25dcd37dc241927bffb4fa18c339
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / molcrafts_molplot-0.1.6-py3-none-any.whl
| Download URL | molcrafts_molplot-0.1.6-py3-none-any.whl |
|---|---|
| Size | 29.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e64f2c7385e6ce079ef47998402920fc4088472daad0f7b3d41d3348e93a0d8a
|
|
BLAKE2b-256 checksum How to use checksums |
a8baffabd6b8bc1c14a4c0131f836169258ae9100ba93e67d7af20a9c7033e3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency log