Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

muxtools-styx

muxtools-styx is a small, local-only policy layer for muxtools. It can clean up one mux, combine a new target with selected tracks from a donor, inspect media and parsed filename metadata, or preflight and process an episode directory sequentially.

Python 3.12 or newer and MKVToolNix/FFmpeg are required. Binary wheels are published for Linux x86_64/ARM64, Windows x86_64/ARM64, and macOS ARM64.

CLI

muxtools-styx mux target.mkv -o finished.mkv
muxtools-styx mux target.mkv --donor previous.mkv --fill-audio --keep-subs-missing-languages
muxtools-styx batch downloads/ --donor-dir previous/ --out-dir muxed --dry-run
muxtools-styx --json inspect '[Group] Show - 03 [1080p CR].mkv'

The important source-policy flags are:

  • --keep-video: use donor video instead of target video.
  • --keep-audio: append every donor audio track.
  • --fill-audio: append donor audio languages absent from the target, plus matching forced/sign tracks. It cannot be combined with --keep-audio.
  • --keep-subs: append every donor subtitle.
  • --keep-subs-missing-languages: append donor subtitle languages absent from the target.
  • --keep-non-english: append non-English donor subtitles.
  • --discard-new-subs: remove target subtitles before donor subtitle policy is applied.
  • --best-audio: retain one Japanese candidate using the deliberately narrow web-audio preference documented in the source.
  • --remove-unnecessary: retain only configured audio/subtitle languages.

--audio-sync and --sub-sync are independent donor offsets in milliseconds. --restyle-subs applies the Styx Gandhi-family cleanup to selected ASS tracks. --fix-tags repairs technical metadata and flags; --normalize-track-names separately normalizes user-facing audio/subtitle titles. --tpp is currently a documented no-op and emits one warning.

A donor-free mux using only --fix-tags, --normalize-track-names, or both edits an MKV in place with mkvpropedit when -o is omitted or points to the input file. Any other policy, or a distinct output path, uses the normal remux path.

--supplemental-info TEXT supplies extra target filename metadata for source provenance when the filename itself has no recognized service. --donor-supplemental-info TEXT does the same for a donor. A recognized source in the actual filename takes precedence.

Temporary muxtools work directories are removed after a successful mux. Pass --no-clean-work-dirs to retain extracted and transformed files for inspection.

In JSON mode normal diagnostics are written to stderr. Successful mux and batch results are stable, small objects suitable for Styx-Downloader:

{"output":"/absolute/path/to/result.mkv"}

Styx-Downloader should resolve its own %...% metadata before invocation and may leave muxtools $...$ tokens in --out-name. The deferred $crc32$ token is rejected because its final filename cannot be collision-checked during preflight.

Python API

The caller owns the active muxtools.Setup; the operation owns inspection, selection, transformations, and the final mux.

from pathlib import Path

from muxtools import Setup
from muxtools_styx import MuxOptions, TrackOptions, process_mux

Setup(
    episode="03",
    config_file="",
    show_name="Sousou no Frieren",
    out_dir="muxed",
    out_name="[Group] $show$ - $ep$ [$res$]",
)

output = process_mux(
    Path("target.mkv"),
    donor=Path("previous.mkv"),
    options=MuxOptions(tracks=TrackOptions(fill_audio=True, keep_subs_missing_languages=True)),
)

Batch matching uses normalized season/episode keys, applies offsets to the donor side, rejects duplicates and unsafe episode ranges, completes preflight before muxing, and runs accepted files sequentially because muxtools.Setup is process-wide state.

Development

Clone with submodules, or initialize them before building:

git submodule update --init --recursive
uv sync
uv run ruff format
uv run ruff check .
uv run pyrefly check
uv run pytest
uv build

Versions come from Git tags using the same versioningit scheme as muxtools: a clean v0.3.0 tag builds as 0.3.0, subsequent commits as 0.4.0.devN+gHASH, and dirty builds add .dirty (or use 0.4.0+dirty at the tag). Clone with full history for version detection. Builds without Git metadata or sdist metadata fall back to 0.0.0+unknown. The generated muxtools_styx._version module exposes __version__ and __version_tuple__, also available from muxtools_styx.

Anitomy is a pinned Git submodule under subprojects/anitomy and is bound directly through nanobind. The binding preserves ordered elements, duplicates, UTF-8 values, and byte positions; Styx-specific interpretation remains in Python.

Metadata

Release files for muxtools-styx 0.3.0b1

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

Source distribution (sdist)

Source distribution for muxtools-styx 0.3.0b1
File Size Uploaded Provenance
muxtools_styx-0.3.0b1.tar.gz 85.1 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for muxtools-styx 0.3.0b1
File
muxtools_styx-0.3.0b1-cp312-abi3-win_arm64.whl CPython 3.12 abi3 Windows ARM64 Details
muxtools_styx-0.3.0b1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
muxtools_styx-0.3.0b1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
muxtools_styx-0.3.0b1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details
muxtools_styx-0.3.0b1-cp312-abi3-macosx_12_0_arm64.whl CPython 3.12 abi3 macOS 12.0+ ARM64 Details

Total release size: 1.5 MB

Release files / muxtools_styx-0.3.0b1.tar.gz

Download URL muxtools_styx-0.3.0b1.tar.gz
Size 85.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5165d3447daac057882cf537985a21077529814b78eb979251642ce7c69787d2
BLAKE2b-256 checksum
How to use checksums
cdf2f7c9e543542c8718a1eeacd7e7dcd1bd6d06323db866802c30b8e4ab1f8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / muxtools_styx-0.3.0b1-cp312-abi3-win_arm64.whl

Download URL muxtools_styx-0.3.0b1-cp312-abi3-win_arm64.whl
Size 523.3 kB
Tags CPython 3.12 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
5054698a002cb5062cf93aa9d5324e89cfaff659cb4a5beac48907fc85468fe6
BLAKE2b-256 checksum
How to use checksums
37c327ec12a98d7d207fe239b96e1e1d654be8edb5c2dbfafac0999290499a93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / muxtools_styx-0.3.0b1-cp312-abi3-win_amd64.whl

Download URL muxtools_styx-0.3.0b1-cp312-abi3-win_amd64.whl
Size 356.8 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
59d72b8f435ae78c3dbfb0a2e04f05f8321bf1efe8db07e85b7344a2d05e5d7b
BLAKE2b-256 checksum
How to use checksums
c8586ab3da9427c3f6e19289ce59482cde826e274ff0eb1dde17c9ad16a4e51b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / muxtools_styx-0.3.0b1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL muxtools_styx-0.3.0b1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 197.4 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
8fcfd20f66eb6031c37660702fc85d1ffe64e97db083742cd3a7e7752893c7de
BLAKE2b-256 checksum
How to use checksums
daa9029e5e4bd3fcde9a240325164e6bbf5f87d26473d690fbb9c0fc015d74ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / muxtools_styx-0.3.0b1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL muxtools_styx-0.3.0b1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 184.9 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
2a436fd97b0e82c10c59083e17a9e94df3ac2e994a286f45d267ec0c8016eb80
BLAKE2b-256 checksum
How to use checksums
9b5ae1004275900e047bbf56a1146bcdbb41017918ccf2f6232454af9756e9b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / muxtools_styx-0.3.0b1-cp312-abi3-macosx_12_0_arm64.whl

Download URL muxtools_styx-0.3.0b1-cp312-abi3-macosx_12_0_arm64.whl
Size 140.1 kB
Tags CPython 3.12 abi3 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
8916a1de6e3edd25afad537a8dc5eebd1553f788c1c1037b7aa240c756ca8094
BLAKE2b-256 checksum
How to use checksums
8ccf98293fb3cf75d4e5c2037a645a9527982802ccdc93528996df8a3251a3e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Security for muxtools-styx 0.3.0b1

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for muxtools_styx-0.3.0b1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

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.

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