Skip to main content

The ultra-fast, Rust-powered bridge between Python and the Web.

Project description

CactusCat

The ultra-fast, Rust-powered bridge between Python and the Web.

Python Rust Wry License

CactusCat is a modern, high-performance hybrid framework designed to build desktop applications using Python for logic and Modern Web Tech (React, Vue, Svelte, Next.js) for the UI. Rebuilt from the ground up in Rust, it provides a "Zero-Cost" abstraction layer for enterprise-grade applications.


Recent Evolution: The "Betrayal of Tauri"

CactusCat has evolved beyond a simple WebView wrapper. It is now a Multi-Engine Application Platform.

  • CNB (Cactus Native Bundle): A new hybrid packaging paradigm. We use PyInstaller for dependency analysis (tree-shaking) but replace the actual bundling with a high-performance Rust Packer.
  • Shielded VFS Bootloader: Applications run inside a memory-backed, isolated, and encrypted Virtual File System. Your source code never touches the disk in plain text.
  • Multi-Engine Hotswapping: Hotswap your browser backend with a single CLI flag. Use the lightweight Native Engine (Tao/Wry) for performance, or the Chrome Engine (Enterprise Chromium stack) for full web compatibility.
  • Aggressive Pruning: The native Rust packer prunes non-essential metadata (.dist-info, test suites, docs) resulting in binaries significantly smaller than standard Python bundlers.

Features

  • Native Rust Engine: Built on tao and wry, eliminating legacy ctypes overhead.
  • Multi-Engine Runtime: Choose between Native WebView or a full Chromium/Electron stack.
  • Reactive State: Magic bi-directional sync between Python app.state and JavaScript ccat.state.
  • Zstd-Compressed Archives: Custom .cat archive format for ultra-fast startup and small footprints.
  • MetaEdit Integration: Powered by the brand new metaedit Rust crate for 1:1 binary metadata surgery.
  • Powerhouse CLI: One-stop shop for initializing, running, and packaging your apps.

Quick Start

1. Installation

Install the development version (pre-compiled wheels available):

pip install cactuscat

2. Scaffold a New Project

cactuscat init MySweetApp --template react

3. Run with Engine Hotswapping

# Default Native Run
cactuscat run --dev

# Run with Enterprise Chrome Engine
cactuscat run --dev --engine chrome

Code Example

Python Backend (app.py)

from cactuscat import App

app = App()
app.state.counter = 0

@app.expose
def increment():
    app.state.counter += 1
    return f"Count is now {app.state.counter}"

app.run()

Frontend UI (App.jsx)

import ccat from 'ccat' // Unified CactusCat Client

async function handleAction() {
    // Dynamic Python calling
    const msg = await ccat.increment();
    console.log(msg);
    
    // Access reactive state directly
    console.log(ccat.state.counter); 
}

CLI Reference

Command Description
init Scaffold a project with React, Vue, Svelte, or Next.js.
run --dev Launch backend + frontend dev server with hot-reload.
run --engine <name> Launch with a specific engine (native or chrome).
package --native Trigger the [CNB] workflow with aggressive Rust pruning.
package --secure Build a native Rust bootloader with an encrypted payload.
engine install Manage browser runtimes (e.g., download Chrome engine).
doctor Comprehensive system health and dependency check.

Architecture: The CNB Paradigm

Unlike traditional "OneDir" or "OneFile" approaches, CactusCat's Native Bundle logic works in three stages:

  1. Analysis: PyInstaller maps the dependency tree.
  2. Pruning: Rust strips the "fat" (PDFs, tests, info folders) and Compresses.
  3. Execution: A Rust Bootloader initializes a shielded environment, decrypts the ccat:// assets, and executes the entry point from memory.

License

CactusCat is open-source software licensed under the MIT License.

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

cactuscat-0.1.9.tar.gz (537.4 kB view details)

Uploaded Source

Built Distribution

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

cactuscat-0.1.9-cp311-cp311-manylinux_2_39_x86_64.whl (82.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

File details

Details for the file cactuscat-0.1.9.tar.gz.

File metadata

  • Download URL: cactuscat-0.1.9.tar.gz
  • Upload date:
  • Size: 537.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cactuscat-0.1.9.tar.gz
Algorithm Hash digest
SHA256 e72ee5be64a7cb55c9afc4c1d781a44dd27af2756e3760c5c0eb0e7e0a6a9cb8
MD5 89e237cda8e75caf64d406b56b58e1e3
BLAKE2b-256 a301b5ee19fa937df7a83e147684f8d0d2d0235954b86044db3490ca722e8005

See more details on using hashes here.

Provenance

The following attestation bundles were made for cactuscat-0.1.9.tar.gz:

Publisher: pypi-publish.yml on Ghua8088/cactuscat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cactuscat-0.1.9-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for cactuscat-0.1.9-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 2370687b454f58ef2f00f546d56fa1075d7d8be44577b0f8dee2a4d742f6f022
MD5 ffb858373e0ab013cf6d8356ebd857bd
BLAKE2b-256 4343674c7efb593286302a932c8c4e16914afb5a4adfea14f02999207cbd4bf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for cactuscat-0.1.9-cp311-cp311-manylinux_2_39_x86_64.whl:

Publisher: pypi-publish.yml on Ghua8088/cactuscat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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