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 FastAPI application that:

  1. Static Files: Serves the entire public/ folder contents at the root path using FastAPI'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
  • fastapi >= 0.100.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.2.0.tar.gz (8.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.2.0-py3-none-any.whl (8.6 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nyancad_server-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fd86e0dfc66f8e8c6318fb85fb3c554a2143430de9bbbb855bfc6e58c75151b9
MD5 4828cdbd45c5cffd8d05a9e3a488711f
BLAKE2b-256 f19270667a82d47fea7f4480e31d5280a3dcf9b0ad34c32754c47d66e9ae7369

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nyancad_server-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nyancad_server-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60d41fe013fb5d201dd1a3ee8d1b69bc25a67ab010b181233c7fc6c21fd852a6
MD5 7596a5aa5bbbce8f4e8203c6f8f679ad
BLAKE2b-256 11b76decef9676d766859f62ff2a67ba49d307ce3d96de9c281eed0a8126a99d

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