Skip to main content

NyanCAD server package with marimo integration

Project description

NyanCAD Server

NyanCAD Server is a Python package that provides an ASGI server for hosting NyanCAD applications with marimo notebook integration.

Features

  • Serves NyanCAD static files (HTML, CSS, JavaScript, assets) at the root path
  • Integrates marimo notebook server at /notebook/ endpoint
  • Bundles all static assets in the wheel for easy deployment
  • Simple command-line interface for starting the server
  • Development mode with auto-reload support

Installation

pip install nyancad-server

Usage

Command Line

Start the server with default settings (localhost:8080):

nyancad-server

Custom host and port:

nyancad-server --host 0.0.0.0 --port 3000

Development mode with auto-reload:

nyancad-server --reload

Programmatic Usage

from nyancad_server.server import create_app
import uvicorn

app = create_app()
uvicorn.run(app, host="localhost", port=8080)

Server Endpoints

  • / - NyanCAD web interface (static files)
  • /css/, /js/, /library/, etc. - Static assets
  • /wheels/ - Python wheels (including nyancad package)
  • /notebook/ - Marimo notebook interface

Architecture

The server creates a Starlette ASGI application that:

  1. Static Files: Serves the entire public/ folder contents at the root path using Starlette's StaticFiles
  2. Marimo Integration: Mounts a marimo ASGI app at /notebook/ that hosts the NyanCAD notebook
  3. Asset Bundling: All static files and the notebook are bundled into the wheel during package build

This mirrors the existing WASM setup where users can access the main interface at / and the notebook at /notebook/, but replaces the WASM notebook with a full marimo server.

Development

The server includes fallback logic to work in development mode by looking for files relative to the source code when bundled assets are not available.

Requirements

  • Python 3.8+

  • marimo >= 0.13.0

  • uvicorn[standard] >= 0.23.0

  • nyancad >= 0.1.0

License

This project is licensed under the Mozilla Public License 2.0 (MPL-2.0).

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

nyancad_server-0.10.3.tar.gz (12.5 MB view details)

Uploaded Source

Built Distribution

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

nyancad_server-0.10.3-py3-none-any.whl (12.9 MB view details)

Uploaded Python 3

File details

Details for the file nyancad_server-0.10.3.tar.gz.

File metadata

  • Download URL: nyancad_server-0.10.3.tar.gz
  • Upload date:
  • Size: 12.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nyancad_server-0.10.3.tar.gz
Algorithm Hash digest
SHA256 4af6df9de69aa0dd11283c0e056cdc7e3b58d0794d34530fce4e18a6f0a9f1a8
MD5 3b40ff6b4ca821bdc5c1a4a7305dbaac
BLAKE2b-256 c068a3d9c4fac7207ac3feeef7d698f6b27fab3c574d6c97338acd30ba590c81

See more details on using hashes here.

File details

Details for the file nyancad_server-0.10.3-py3-none-any.whl.

File metadata

File hashes

Hashes for nyancad_server-0.10.3-py3-none-any.whl
Algorithm Hash digest
SHA256 60d98c2df3c778a08ab16b06508bcf5244ac99f0cd08b76677135deec5a26d45
MD5 5c1c9d3ad95ec419fcf7af962e7ab6f1
BLAKE2b-256 021f1e43bbbbb5ee98510c457453cd7c8b25409e04af31d280e2183db8cf4719

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