Skip to main content

Flyrail for Python

A typed, synchronous library for coding-agent configuration bundles: skills, instructions, MCP registrations, hooks and supporting assets. Requires Python 3.11+; TOML editing lazily imports pinned tomlkit. Windows mutations require Python 3.11.10+, 3.12.4+, or 3.13+ for private directory creation.

Install and use

Install the pyflyrail distribution from PyPI. The import package remains flyrail:

python -m pip install pyflyrail

To install the current checkout instead, run python -m pip install . from python/. The following example uses the same public import in either installation:

from flyrail import Bundle, Target, inspect, install, uninstall, update

bundle = Bundle.from_directory("examples/filesystem/bundle")
targets = [Target.directory(".cache/demo-skills")]

installed = install(bundle, targets)
current = all(result.observation.is_current for result in inspect(bundle, targets))
updated = update(bundle, targets, lock_timeout=0.25)
removed = uninstall(bundle.id, targets)

Target.directory names the skill container itself. This example installs .cache/demo-skills/notes-summary/SKILL.md. Use Bundle.from_package("your_package") for application resources with a flyrail/ bundle directory. Both loaders snapshot complete trees before returning, so later removal of the source does not invalidate an already loaded bundle.

Presets cover Claude Code, Codex, OpenCode, Pi, Cursor and Copilot. For example, Target.user("codex") selects a user installation and Target.project("claude", "./project") selects a project installation. Hosts choose explicit destinations; the library never selects agents, prints, prompts, exits, executes skill scripts or requests the network.

Bundle version labels are independent of your application's version. Inspection compares the label, recorded content and actual content separately. Updates can change content under the same label or install an older-looking label. An intact matching revision returns UNCHANGED.

Check every mutation result's status, errors and resource recovery paths. A committed resource can still need cleanup; PARTIAL reports completed resource commits followed by a failure. Own edits block replacement/removal unless replace_modified=True; untracked and foreign-owned skills remain protected. Uninstall uses the bundle ID and receipts, without requiring source files.

For portable instructions, MCP, hooks and supporting assets, use render(bundle, context) with an explicit RenderContext. It returns a RenderedBundle for preview/apply_preview or sync with an InstallationTarget. Translation explains capabilities, native alternatives and exact unsupported boundaries. inspect_installation and remove use the private index without source bytes. For applications that select destinations from observed files, call source-free recover_installation before re-reading those files and building a fresh immutable preview. Recovery preserves healthy ownership and retains pending membership for the subsequent update or removal. Use inspect_installation(bundle.id, target).matches(bundle, rendered) to compare the app's current bundle and rendering with intact installed content. The source-free is_current field checks the recorded generation only. Neither check establishes host trust, discovery or activation; inspect render notices separately. The configuration API shows an in-memory instruction example and explains explicit takeover/adoption.

Documentation and examples

The repository's examples/ contains two independently packaged host CLIs: notes with an explicit filesystem bundle and checksum with packaged resources. They include a combined checksum config interface with generated guidance, skills, stdio/HTTP MCP environment references and a portable hook with packaged assets. Native hook execution requires an explicitly selected Node 24+ executable; OpenCode/Pi can use their existing host runtimes. Python package builds require no JavaScript runtime or compiler.

Examples and development tooling live in the repository; the source distribution contains library code, tests, shared fixtures, runtime test tooling, package metadata and the license.

For repository development, run just check from python/ or the repository root. It checks formatting, lint/security, strict typing, tests with branch coverage, built package contents and installed consumers. The repository CI matrix covers Python 3.11 and 3.14 on macOS, Linux and Windows. See development.

Release files for pyflyrail 0.2.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 pyflyrail 0.2.0
File Size Uploaded
pyflyrail-0.2.0.tar.gz 286.6 kB Details

Built distribution (wheel)

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

Total release size: 401.2 kB

Release files / pyflyrail-0.2.0.tar.gz

Download URL pyflyrail-0.2.0.tar.gz
Size 286.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9aa1820585d31722c4940a0c650615470d8a184168fc5bc412382b71d0fb3c91
BLAKE2b-256 checksum
How to use checksums
7545a796d240077bbf211485aa129c5e41eaa3d1fdaa65b7f971384b3d1a2640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyflyrail-0.2.0-py3-none-any.whl

Download URL pyflyrail-0.2.0-py3-none-any.whl
Size 114.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e169548d60099c79923c651ebda2a3a5d7a19bab0f3b6f138d593832dea0573
BLAKE2b-256 checksum
How to use checksums
e3a60dfbc88a77b4dead39f338b348e921b880b30451d83c1f627df189c9c0f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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