Skip to main content

NyanCAD Python Library

A Python library for the NyanCAD schematic editor with anywidget integration. Provides live access to schematic data from marimo notebooks.

Installation

pip install nyancad

Usage

Basic Usage

import marimo as mo
from nyancad import SchematicBridge

# Create a schematic bridge widget
bridge = SchematicBridge()

# Display the widget (shows connection status)
bridge

# Access live schematic data
print(bridge.schematic_data)

# Send simulation data back to the editor
bridge.simulation_data = {
    "results": [1.2, 3.4, 5.6],
    "timestamp": "2024-01-01T00:00:00Z",
}

Integration with Marimo

The SchematicBridge widget automatically connects to the NyanCAD editor running in the same marimo session. Any changes made in the schematic editor will be immediately reflected in the Python widget.

# In a marimo cell
bridge = SchematicBridge()
bridge  # This will show the connection status

# In another marimo cell - access the live data
mo.md(f"""
## Schematic Analysis
Raw schematic data: {len(bridge.schematic_data)} items
""")

# View the actual schematic data structure
bridge.schematic_data

Features

  • Live Sync: Real-time synchronization with NyanCAD schematic editor via PouchDB
  • Bidirectional Communication: Send simulation data back to the editor from Python
  • Zero Configuration: Automatically detects and connects to the active schematic
  • Raw Data Access: Direct access to the complete schematic data structure
  • Marimo Integration: Seamless integration with marimo notebooks

API Reference

SchematicBridge

The main widget class that provides bidirectional communication with the Mosaic editor.

Properties

  • schematic_data (dict): Raw schematic data from the Mosaic editor, automatically synced
  • simulation_data (dict): Simulation data to send to the Mosaic editor. Setting this will store the data with a timestamp in the editor's database

Development

This package is part of the NyanCAD project. The anywidget integration uses a ClojureScript bridge that compiles to an ESM module, allowing seamless data sharing between the schematic editor and Python environment.

License

This project is licensed under the Mozilla Public License 2.0 - see the LICENSE file for details.

Metadata

Release files for nyancad 0.19.0

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

Source distribution (sdist)

Source distribution for nyancad 0.19.0
File Size Uploaded Provenance Actions
nyancad-0.19.0.tar.gz 45.5 kB Without provenance Details for nyancad-0.19.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nyancad 0.19.0
File Interpreter ABI Platform Actions
nyancad-0.19.0-py3-none-any.whl Python 3 none any Details for nyancad-0.19.0-py3-none-any.whl

Total release size: 73.8 kB

Release files / nyancad-0.19.0.tar.gz

Download URL nyancad-0.19.0.tar.gz
Size 45.5 kB
Tags Source
SHA-256 checksum
How to use checksums
aab0726b0c5d5984b4bb7a4146c57a796fa2d79e3d2335f82d2b28b431dbb204
BLAKE2b-256 checksum
How to use checksums
013079b044f434dd631e303b188635d825aebc33cfeb35bfdddd832a7bb32ddf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / nyancad-0.19.0-py3-none-any.whl

Download URL nyancad-0.19.0-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2240ef78dd2218f9e39d32e6ef13a16fe0101766359a5be3e42876f72854ddd7
BLAKE2b-256 checksum
How to use checksums
48d20dcfd72b01a85f8ddd4b9465b84e36cfae132f572349026f84bbc043eb17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for nyancad 0.19.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.19.0 This release

2 release files No provenance

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