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 batch downloads/ --donor-dir previous/ --donor-season 2 --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.

For mux and batch, numeric episode identifiers use at least two digits in output filenames and MKV titles (01, 02, …). Use --episode-padding 3 for 001, 002, …; larger episode numbers are never truncated. This also applies to --episode overrides.

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.

Use --donor-season 2 when donor filenames omit or use a different season, such as Show 2 E01.mkv paired with Show.S02E01.mkv. It overrides the season for every donor file during matching, can be combined with --episode-offset, and accepts 0 for specials. The Python batch functions accept the same override as donor_season=2. process_batch also accepts episode_padding=3 for the MKV titles produced by its default setup.

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.0b4

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.0b4
File Size Uploaded Provenance
muxtools_styx-0.3.0b4.tar.gz 91.9 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for muxtools-styx 0.3.0b4
File
muxtools_styx-0.3.0b4-cp312-abi3-win_arm64.whl CPython 3.12 abi3 Windows ARM64 Details
muxtools_styx-0.3.0b4-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
muxtools_styx-0.3.0b4-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.0b4-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.0b4-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.0b4.tar.gz

Download URL muxtools_styx-0.3.0b4.tar.gz
Size 91.9 kB
Tags Source
SHA-256 checksum
How to use checksums
46aeee0e89ab6a7dc95ea18bccf860ced320b5627948e68b5f820175242f69de
BLAKE2b-256 checksum
How to use checksums
e12aa7779bfc9bf6cc2e5353beb3454f66bc8b87d41f104b90cf8e48a256a8a5
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 Oct 20, 2026.

Transparency log

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

Download URL muxtools_styx-0.3.0b4-cp312-abi3-win_arm64.whl
Size 529.1 kB
Tags CPython 3.12 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
d60bd0b827a28d388139c79081796433027ee20faf61a940a5b34fe057f3a625
BLAKE2b-256 checksum
How to use checksums
1f62c83fae661d8e7c4c87f6535b4b0a85b0170fd2bc649657b988e72409405a
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 Oct 20, 2026.

Transparency log

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

Download URL muxtools_styx-0.3.0b4-cp312-abi3-win_amd64.whl
Size 361.9 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
93f83fd3778fe1e6aeaa03d8921a6837b134786139f0657a184874095253e21c
BLAKE2b-256 checksum
How to use checksums
3e88c7d6ed27df595bf19333a9132171f3c5f029615489d74d15ff79e6ae6c0e
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 Oct 20, 2026.

Transparency log

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

Download URL muxtools_styx-0.3.0b4-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 201.7 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
c6c02787291860a2ebfc517e1da2df3b2c1bda994f78ae921403f6345d82995f
BLAKE2b-256 checksum
How to use checksums
0660a7102fe8d6e93ef8f6c44031916e2901b7039837357a9a9d8e73b28b362b
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 Oct 20, 2026.

Transparency log

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

Download URL muxtools_styx-0.3.0b4-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 189.3 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
f246c4a886a1ae5ec32d8288422243d34fc3610ed0714f2b28eabad9fab6ceeb
BLAKE2b-256 checksum
How to use checksums
76b09c19e65b4362337f72dcb3b8fe0ee199e63c9bc9475abb5ce2893d904ffa
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 Oct 20, 2026.

Transparency log

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

Download URL muxtools_styx-0.3.0b4-cp312-abi3-macosx_12_0_arm64.whl
Size 146.7 kB
Tags CPython 3.12 abi3 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
cf4eb65f0df66b5d59789268b235a7ddcf720a500049b1a3a4708e0223107e67
BLAKE2b-256 checksum
How to use checksums
5b7b8e4010c01a52eae1a5822ab7d5fa8c11268776868e075dc6133c7c815437
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 Oct 20, 2026.

Transparency log

Security for muxtools-styx 0.3.0b4

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.0b4.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 Oct 20, 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