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
-
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
-
Subsequent Uses: The package checks the cache and returns the existing assets path immediately.
Download Issues
If asset download fails:
- Check internet connectivity
- Verify firewall settings allow access to registry.npmjs.org
- 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.3 | 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file monaco_assets-0.3.3.tar.gz.
File metadata
- Download URL: monaco_assets-0.3.3.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac8d1dc33d5a6e18b17e0e318c59535feacf9c394b8aa11ad06a6c6ef445a493
|
|
| MD5 |
2d907553a0f75acfd0f701538ba34c1b
|
|
| BLAKE2b-256 |
e1de54fca819c0b25c2a87cc4fcd381ab5246ca137fa115c45bdafbb782a6578
|
File details
Details for the file monaco_assets-0.3.3-py3-none-any.whl.
File metadata
- Download URL: monaco_assets-0.3.3-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea2cc8356f1c73af8904feb6f47ff1fd1f8106f25542a3468024d98d053cd2c6
|
|
| MD5 |
ebb59ab9c443f6d126dbdbf18f4eca15
|
|
| BLAKE2b-256 |
04598872f071b9001520d21c9eb3555d5206a8924dbb9e5d3ddf7c49f2e2f20a
|