Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

download-esm

PyPI Changelog Tests License

Download ESM modules from npm and jsdelivr

Installation

Install this tool using pip:

pip install download-esm

Warning

This is alpha software. It works for downloading Observable Plot, but has not been tested against any other packages yet.

Your help welcome in testing this further!

Usage

To download Observable Plot and all of its dependencies as ECMAScript modules:

download-esm @observablehq/plot

This will download around 40 .js files to the current directory.

To put them in another directory, add that as an argument:

download-esm @observablehq/plot ./js

Each file will have any import and export statements rewritten as relative paths.

You can then use the library in your own HTML and JavaScript something like this:

<div id="myplot"></div>
<script type="module">
import * as Plot from "./js/observablehq-plot-0-6-6.js";
const plot = Plot.rectY(
    {length: 10000}, Plot.binX({y: "count"}, {x: Math.random})
).plot();
const div = document.querySelector("#myplot");
div.append(plot);
</script>

Development

To contribute to this tool, first checkout the code. Then create a new virtual environment:

cd download-esm
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Metadata

Release files for download-esm 0.1a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for download-esm 0.1a0
File Size Uploaded
download-esm-0.1a0.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for download-esm 0.1a0
File Interpreter ABI Platform
download_esm-0.1a0-py3-none-any.whl Python 3 none any Details

Total release size: 16.9 kB

Release files / download-esm-0.1a0.tar.gz

Download URL download-esm-0.1a0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ccf23288162742b59c37841d2284e6aedb0c85b58993b76dd14143307cfe7601
BLAKE2b-256 checksum
How to use checksums
d07e5a4c58075871588f5758f6fe0b33f27fe13e56bb79e928742882dd8da2b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / download_esm-0.1a0-py3-none-any.whl

Download URL download_esm-0.1a0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e1351852496d9352f6041da6119cec45c4d65cd85bad1696bef7221646d4f5a
BLAKE2b-256 checksum
How to use checksums
06c1fba22466c59fe53244c02834c8aba8d758605bd892227be0f51dfa1daf0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.1a0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page