{"id":23179267,"url":"https://github.com/richinsley/jumpboot","last_synced_at":"2026-01-24T21:19:10.988Z","repository":{"id":278057162,"uuid":"934337190","full_name":"richinsley/jumpboot","owner":"richinsley","description":"Seamlessly integrate Python environments and scripts into your Go projects.","archived":false,"fork":false,"pushed_at":"2026-01-23T23:07:16.000Z","size":15189,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-24T11:31:58.767Z","etag":null,"topics":["go","golang","mamba","pip","python"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/richinsley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-17T16:57:12.000Z","updated_at":"2026-01-23T23:07:19.000Z","dependencies_parsed_at":"2025-06-08T07:30:49.335Z","dependency_job_id":null,"html_url":"https://github.com/richinsley/jumpboot","commit_stats":null,"previous_names":["richinsley/jumpboot"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/richinsley/jumpboot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richinsley%2Fjumpboot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richinsley%2Fjumpboot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richinsley%2Fjumpboot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richinsley%2Fjumpboot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richinsley","download_url":"https://codeload.github.com/richinsley/jumpboot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richinsley%2Fjumpboot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28737102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T19:23:36.361Z","status":"ssl_error","status_checked_at":"2026-01-24T19:23:28.966Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","mamba","pip","python"],"created_at":"2024-12-18T07:14:18.397Z","updated_at":"2026-01-24T21:19:10.983Z","avatar_url":"https://github.com/richinsley.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jumpboot\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/richinsley/jumpboot.svg)](https://pkg.go.dev/github.com/richinsley/jumpboot)\n[![Go Report Card](https://goreportcard.com/badge/github.com/richinsley/jumpboot)](https://goreportcard.com/report/github.com/richinsley/jumpboot)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nEmbed Python and its entire ecosystem in your Go binary. Ship a single executable that creates its own Python environment on first run.\n\n```go\n//go:embed sentiment.py\nvar sentimentCode string\n\nfunc main() {\n    // Creates isolated Python 3.11 environment with pip (first run only)\n    env, _ := jumpboot.CreateEnvironmentMamba(\"mlenv\", \"./envs\", \"3.11\", \"conda-forge\", nil)\n\n    if env.IsNew {\n        env.PipInstallPackages([]string{\"transformers\", \"torch\"}, \"\", \"\", false, nil)\n    }\n\n    // Embed Python code in your binary, call it like a function\n    mod := jumpboot.NewModuleFromString(\"sentiment\", \"sentiment.py\", sentimentCode)\n    repl, _ := env.NewREPLPythonProcess(nil, nil, []jumpboot.Module{*mod}, nil)\n    defer repl.Close()\n\n    repl.Execute(\"import sentiment\", true)\n    result, _ := repl.Execute(`sentiment.analyze(\"I love this product!\")`, true)\n    fmt.Println(result)  // {\"label\": \"POSITIVE\", \"score\": 0.9998}\n}\n```\n\n```python\n# sentiment.py - embedded in Go binary\nfrom transformers import pipeline\nclassifier = pipeline(\"sentiment-analysis\")\n\ndef analyze(text):\n    return classifier(text)[0]\n```\n\n## What This Gives You\n\n**Single binary deployment.** Your Go app ships as one executable. On first run, it bootstraps a complete Python environment with any packages you need. Users don't install Python separately.\n\n**Full Python ecosystem.** NumPy, PyTorch, TensorFlow, Hugging Face, OpenCV, pandas, scikit-learn—if it's on PyPI or conda-forge, you can use it.\n\n**Multiple Python versions, simultaneously.** Run Python 3.9 for one task and Python 3.12 for another in the same application. Each environment is completely independent with its own packages.\n\n```go\n// Legacy code needs Python 3.8 with older numpy\nlegacyEnv, _ := jumpboot.CreateEnvironmentMamba(\"legacy\", \"./envs\", \"3.8\", \"conda-forge\", nil)\nlegacyEnv.PipInstallPackage(\"numpy==1.21.0\", \"\", \"\", false, nil)\n\n// New ML pipeline needs Python 3.11 with latest packages\nmlEnv, _ := jumpboot.CreateEnvironmentMamba(\"ml\", \"./envs\", \"3.11\", \"conda-forge\", nil)\nmlEnv.PipInstallPackages([]string{\"numpy==2.0\", \"torch\", \"transformers\"}, \"\", \"\", false, nil)\n\n// Run both simultaneously\nlegacyRepl, _ := legacyEnv.NewREPLPythonProcess(nil, nil, nil, nil)\nmlRepl, _ := mlEnv.NewREPLPythonProcess(nil, nil, nil, nil)\n```\n\n**Isolated environments.** No conflicts with system Python or other apps. Pin exact package versions per environment for reproducible builds.\n\n**Three ways to run Python:**\n- **REPL** - Interactive sessions, execute code strings, get results\n- **QueueProcess** - Bidirectional RPC, call Python functions with structured data\n- **Direct execution** - Run scripts, capture output\n\n## Installation\n\n```bash\ngo get github.com/richinsley/jumpboot\n```\n\n## Quick Examples\n\n### Call Python Functions from Go\n\n```go\nenv, _ := jumpboot.CreateEnvironmentMamba(\"myenv\", \"./envs\", \"3.11\", \"conda-forge\", nil)\nrepl, _ := env.NewREPLPythonProcess(nil, nil, nil, nil)\n\n// Execute any Python and get results\nresult, _ := repl.Execute(\"sum([1, 2, 3, 4, 5])\", true)\nfmt.Println(result)  // 15\n\n// State persists between calls\nrepl.Execute(\"import numpy as np\", true)\nrepl.Execute(\"data = np.random.randn(1000)\", true)\nresult, _ = repl.Execute(\"np.mean(data)\", true)\n```\n\n### Embed Entire Packages\n\n```go\n//go:embed mypackage/*\nvar myPackageFS embed.FS\n\nfunc main() {\n    // NewPackageFromFS(name, sourcePath, rootPath, fs)\n    //   name:       Python import name (import mypackage)\n    //   sourcePath: Path prefix for virtual __file__ paths\n    //   rootPath:   Directory within embed.FS containing the package\n    //   fs:         The embedded filesystem\n    pkg, _ := jumpboot.NewPackageFromFS(\"mypackage\", \"mypackage\", \"mypackage\", myPackageFS)\n\n    program := \u0026jumpboot.PythonProgram{\n        Name:     \"MyApp\",\n        Program:  mainModule,\n        Packages: []jumpboot.Package{*pkg},\n    }\n\n    process, _, _ := env.NewPythonProcessFromProgram(program, nil, nil, false)\n}\n```\n\n### Bidirectional RPC\n\n```go\n// Go calls Python\nresult, _ := queue.Call(\"process_image\", 30, map[string]interface{}{\n    \"path\": \"/tmp/photo.jpg\",\n    \"resize\": []int{800, 600},\n})\n\n// Python calls Go\nqueue.RegisterHandler(\"log\", func(data interface{}, id string) (interface{}, error) {\n    fmt.Printf(\"[Python] %v\\n\", data)\n    return \"ok\", nil\n})\n```\n\n## How It Works\n\n1. **First run**: Downloads [micromamba](https://mamba.readthedocs.io/en/latest/) (~5MB), creates a conda environment with your specified Python version, installs packages via pip/conda\n2. **Subsequent runs**: Environment exists, startup is fast\n3. **Communication**: Go spawns Python subprocess, communicates via pipes (MessagePack serialization)\n4. **Embedded code**: Python source is base64-encoded in the Go binary, loaded via custom import hooks\n\nNo CGO required for basic operation. Optional shared memory features use CGO on Unix.\n\n## Examples\n\n| Example | What it demonstrates |\n|---------|---------------------|\n| [repl](examples/repl/) | Interactive Python from Go |\n| [jsonqueueserver](examples/jsonqueueserver/) | Bidirectional RPC with MessagePack |\n| [chromadb](examples/chromadb/) | Vector database for embeddings |\n| [gradio](examples/gradio/) | Python web UI from Go |\n| [mlx](examples/mlx/) | ML inference on Apple Silicon |\n| [embedded_packages](examples/embedded_packages/) | Complex package structures |\n\n## Documentation\n\n| Document | Description |\n|----------|-------------|\n| [Quick Start](docs/QUICKSTART.md) | Get running in 5 minutes |\n| [Environments](docs/ENVIRONMENTS.md) | Creating and managing Python environments |\n| [Programs](docs/PROGRAMS.md) | Embedding modules and packages |\n| [REPL](docs/REPL.md) | Interactive Python sessions |\n| [Queue Process](docs/QUEUE.md) | Bidirectional RPC |\n| [Architecture](docs/ARCHITECTURE.md) | Internal design |\n| [AI Agents](docs/AGENTS.md) | Guide for AI coding assistants |\n\n## What It Doesn't Do\n\n- **Replace Python with Go** - This is for using Python libraries from Go, not avoiding Python\n- **Require CGO** - Basic features work without CGO; shared memory is optional, but super awesome!\n- **Provide Python C API bindings** - Communication is via subprocess pipes, not embedded interpreter\n\n## Platform Support\n\n| Platform | Status |\n|----------|--------|\n| macOS (amd64, arm64) | Supported |\n| Linux (amd64, arm64) | Supported |\n| Windows (amd64) | Supported |\n\n## Acknowledgments\n\nJumpboot uses [micromamba](https://mamba.readthedocs.io/en/latest/) for fast, reliable conda environment management. Micromamba is a lightweight, standalone C++ implementation of the conda package manager developed by the [mamba](https://github.com/mamba-org/mamba) team.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichinsley%2Fjumpboot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichinsley%2Fjumpboot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichinsley%2Fjumpboot/lists"}