Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

Monaco Editor Assets

A Python package that provides easy access to Monaco Editor assets. Assets are automatically downloaded on first use, eliminating the need to bundle large files with the package. Optionally, the assets can be served by a local webserver on a custom port (MonacoServer); the required fastapi and uvicorn packages are installed together with monaco-assets.

Installation

python3 -m pip install monaco-assets
# or
uv pip install monaco-assets

Quick Start

import monaco_assets
server = monaco_assets.MonacoServer(port=8000)

Now, you can use http://localhost:8000/min/vs/loader.js in a webbrowser to see, e.g., loader.js. Please note that there are no directory listings, one has to directly address the file(s).

Cache Management

import monaco_assets

# Clear cache to free space before uninstalling the package
monaco_assets.clear_cache()

# Check whether the assets are already cached (no download needed)
if monaco_assets.has_cached_assets():
    ...
else:
    # a download will take place; e.g. show a progress indicator
    assets_path = monaco_assets.get_path(progress_callback=show_progress)

Download Progress

On a cold cache, get_path() downloads the Monaco Editor assets (~100 MB extracted). You can report the download progress in real time by passing a progress_callback that receives (bytes_downloaded, total_bytes):

import monaco_assets


def show_progress(done: int, total: int | None) -> None:
    if total is not None:
        print(f"\r{done / total:.0%} of {total / 2**20:.1f} MiB", end="", flush=True)
    else:
        print(f"\r{done / 2**20:.1f} MiB", end="", flush=True)


assets_path = monaco_assets.get_path(progress_callback=show_progress)

Notes:

  • The callback is only invoked if a download actually takes place; on a warm cache get_path() returns immediately without calling it. If you build progress UI around the call, check has_cached_assets() first to avoid showing it unnecessarily.
  • total_bytes is None if the server does not send a Content-Length header. The first chunk is always reported; further calls are throttled to at most one per 0.5 seconds, plus a final call when the download completes.
  • If you call get_path() from a background thread yourself, make the callback thread-safe accordingly.

Cache Locations

Assets are cached in platform-appropriate directories using the platformdirs library

How It Works

  1. First Use: When get_path() is called for the first time, the package:

    • Downloads Monaco Editor from npmjs.org
    • Verifies the download integrity with SHA1 hash
    • Extracts assets to the user cache directory
    • Returns the path to the assets
  2. Subsequent Uses: The package checks the cache and returns the existing assets path immediately.

Download Issues

If asset download fails:

  1. Check internet connectivity
  2. Verify firewall settings allow access to registry.npmjs.org
  3. Check disk space in cache directory

Cache Issues

Clear and re-download if corrupted.

monaco_assets.clear_cache()
assets_path = monaco_assets.get_path()

Version Correspondence

The package version matches the Monaco editor version it downloads. Only Monaco editor versions >= 0.55 are available; older versions are not provided by this package.

Requirements

  • Python 3.10+
  • Internet connection (only for initial asset download)
  • ~100MB disk space for Monaco Editor assets

License

MIT License - see LICENSE file for details.

Monaco Editor is licensed under the MIT License by Microsoft Corporation.

Metadata

Release files for monaco-assets 0.56.0

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

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for monaco-assets 0.56.0
File Size Uploaded Provenance Actions
monaco_assets-0.56.0.tar.gz 5.9 kB With provenance Details for monaco_assets-0.56.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for monaco-assets 0.56.0
File Interpreter ABI Platform Actions
monaco_assets-0.56.0-py3-none-any.whl Python 3 none any Details for monaco_assets-0.56.0-py3-none-any.whl

Total release size: 12.0 kB

Release files / monaco_assets-0.56.0.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL monaco_assets-0.56.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c1b505c8b46ba89662590667e36d17d24b13b07baacf97c90bedd2b41428c623
BLAKE2b-256 checksum
How to use checksums
7ba84b4441b236b4aa0be7ca8bcab14dc892569035edf8452ae35edb26f79431
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Release files / monaco_assets-0.56.0-py3-none-any.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL monaco_assets-0.56.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bcd042ccd9f676aa0b9ced4f2e65decbeb47af0ceec8ed7af549f6907c63b536
BLAKE2b-256 checksum
How to use checksums
5c5e1dd11db836b3f4a16b721bd97ff473150844576dcd5f8943cb157beab01f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 24, 2026.

Transparency log

Security for monaco-assets 0.56.0

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.

Change of provenance

The configuration that created this release differs from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Select from 2 files

Attestation for monaco_assets-0.56.0.tar.gz

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 Nov 24, 2026.

Transparency log

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.

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