Skip to main content

spaday-diffs

Build Status PyPI License

Pierre Diffs for spaday: syntax-highlighted file comparisons and patches, controlled from Python.

File comparison and component gallery

Install

pip install "spaday-diffs[examples]"

Usage

import uvicorn
from spaday.backends.starlette import serve
from spaday_diffs import Diff, package

diff = Diff(
    old_file={"name": "hello.py", "contents": 'print("hello")\n'},
    new_file={"name": "hello.py", "contents": 'print("hello, world")\n'},
    diff_style="split",
)
app = serve(diff, packages=[package])
uvicorn.run(app, host="127.0.0.1", port=8000)

The same component works in notebooks and standalone apps. The package registers its components and browser assets with spaday automatically.

Features

  • Split and unified layouts with syntax highlighting.
  • Two-file comparisons or a selected file from a unified patch.
  • Reactive content, layout, line selection, and plain-text annotations.
  • Selection and line-click events usable with spaday actions and transports.
  • Light, dark, and system themes; package tokens inherit spaday shell colors.
  • Bundled assets, including lazily loaded syntax languages and themes.

This is a read-only viewer. Editing, merge resolution, and upstream worker-pool configuration are not exposed.

Documentation

Browser Examples

Open the browser example or jump to the component gallery.

The browser runs the packaged Python example in Pyodide. Buttons and selections call Python handlers, then transports sends updated model state back to spaday. The gallery renders real Diff components.

Run the examples locally

pip install "spaday-diffs[examples]"
python -m spaday_diffs.example

Open http://127.0.0.1:8017. The proposed file updates every ten seconds; line-number selections round-trip to Python.

From a checkout, use make develop, make build, and make test. Build the standalone browser preview with make pyodide-example, then serve dist/lite over HTTP. make test-pyodide-example exercises it in Chromium.

Metadata

Release files for spaday-diffs 0.1.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 spaday-diffs 0.1.0
File Size Uploaded Provenance
spaday_diffs-0.1.0.tar.gz 4.1 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for spaday-diffs 0.1.0
File Interpreter ABI Platform
spaday_diffs-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.9 MB

Release files / spaday_diffs-0.1.0.tar.gz

Download URL spaday_diffs-0.1.0.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
221a6c267342b42d670b2e213a896c8b03a9d38f8356166dd12686e0a8cd2425
BLAKE2b-256 checksum
How to use checksums
161db26753a5e5a16337dfdb2e2d8a0abbcce2fd27473e3fc61b55aa5aebe9ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / spaday_diffs-0.1.0-py3-none-any.whl

Download URL spaday_diffs-0.1.0-py3-none-any.whl
Size 4.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
da066c762b88d87a927516856c60c8388633e8b64366bb01947794f913888748
BLAKE2b-256 checksum
How to use checksums
1b15dc3b86e76aabf1e4eca19a545d678bf1b576914fd37db6442d0de6e4900a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for spaday-diffs 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.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