Skip to main content

Automatically download Monaco editor assets.

Project description

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. The assets can be served by a webserver on a custom port.

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/ in a webbrowser to see all assets.

Cache Management

import monaco_assets

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

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

Version correspondence will be ensured after initial bugfixes.

Package Version Monaco Editor Version
0.3.1 0.54.0

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.

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

monaco_assets-0.3.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

monaco_assets-0.3.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file monaco_assets-0.3.1.tar.gz.

File metadata

  • Download URL: monaco_assets-0.3.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for monaco_assets-0.3.1.tar.gz
Algorithm Hash digest
SHA256 8bc2eea5283dd11f14bd400b7b57b3547177969a15bc3910cab35e0ad09b6161
MD5 8c062052a61a8bfff6698f0b641b78b4
BLAKE2b-256 373564e7244a30749185b208452d85aa4edf46a3eb90e6722b40355507f46f64

See more details on using hashes here.

File details

Details for the file monaco_assets-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: monaco_assets-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for monaco_assets-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ffb959ebf553bb5ad05db55c05d77852e2cf9947d64c9842298ee7545d57866c
MD5 7f0481b78ccd9dc3c31d410f893e5a38
BLAKE2b-256 ad047d48dad41b3e544cd516d61d0e676e4457f307618af7af1cf4ef1a2ae6a2

See more details on using hashes here.

Supported by

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