Skip to main content

python-makemkv

PyPI Python License Code Style CI Codecov

python-makemkv is a simple python wrapper for MakeMKV (written by GuinpinSoft inc.). While it can be imported as a module, it also offers a command-line interface that tries to be more intuitive than makemkvcon.

Requirements

python-makemkv requires Python 3.9 or later.

Additionally, a copy of MakeMKV is required, which can be downloaded from their website. If MakeMKV isn't installed at the default location, you also need to ensure that makemkvcon can be run from the terminal, e. g. by adding its location to your PATH environment variable.

Installation

python-makemkv can be installed using pip.

pip install makemkv

If you want to use the CLI, you need to install it with

pip install makemkv[cli]

or install click and rich manually.

Usage

See full documentation on Read the Docs.

To get information about discs, you need to instantiate a makemkv.MakeMKV object which provides its makemkv.MakeMKV.info() method.

from pprint import pp
from makemkv import MakeMKV

makemkv = MakeMKV('/dev/sr0')
disc_info = makemkv.info()
pp(disc_info)

To create a mkv file from the first title of the first disc you can use makemkv.MakeMKV.mkv(). Since this will take some time you can define a function that analyzes the program's progress or you can use the makemkv.ProgressParser class to show pretty progress bars (this requires rich to be installed).

from makemkv import MakeMKV, ProgressParser

with ProgressParser() as progress:
    makemkv = MakeMKV(0, progress_handler=progress.parse_progress)
    makemkv.mkv(0, '~/Videos/Really Cool Movie (2021)')

python-makemkv uses the logging module from Python's standard library, see Logging HOWTO to change the output format or verbosity. To change the verbosity of specific messages, you can modify the makemkv.output_codes.MESSAGE_CODES dictionary accordingly. If you think that the log level of a specific message isn't appropriate for most users, feel free to open an issue or a pull request.

Command-line interface

Usage: pymakemkv COMMAND [OPTIONS]

Options:
  -n, --disc-nr NR      Specify disc number. Alternatively you can specify an
                        input with -i/--input. Defaults to 0.
  -i, --input PATH      Specify input, can be either a device, a .IFO file or
                        a VIDEO_TS folder.
  -l, --minlength SECS  Specify minimum title length in seconds.
  -c, --cache MB        Specify size of read cache in megabytes.
  -f, --info-file FILE  Write disc info to file.
  -j, --json            Show disc info in JSON format.
  -v, --verbose         Show more detailed logs.
  -q, --quiet           Don't show logs.
  --no-bar              Don't show progress bars.
  --no-info             Don't show disc info.
  --help                Show this message and exit.
  -t, --title NR        Select title to be ripped, can be either an integer
                        starting with 0 or the keyword "all". Defaults to 0.
                        [Commands: mkv]
  -o, --output DIR      Specify output directory for created mkv files.
                        Defaults to current directory. [Commands: mkv, backup]
  -d, --decrypt         Decrypt stream files during backup. [Commands: backup]

Commands:
  backup  Backup whole disc.
  info    Display information about a disc.
  mkv     Copy titles from disc.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please use nox to format, lint, type-check and test your code by calling nox in your project directory.

License

This project is licensed under the MIT License.

See LICENSE for more information.

Metadata

Release files for makemkv 0.3.1

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

Source distribution (sdist)

Source distribution for makemkv 0.3.1
File Size Uploaded
makemkv-0.3.1.tar.gz 27.2 kB Details

Built distribution (wheel)

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

Total release size: 43.9 kB

Release files / makemkv-0.3.1.tar.gz

Download URL makemkv-0.3.1.tar.gz
Size 27.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d3d9379e4e041ec30c1c815e4cc627c5d419acdd59afc343674e8ad956fc1b3e
BLAKE2b-256 checksum
How to use checksums
072c73d93f536d96d733457f3f0c3aaa3926f0b1a8841c1b0bea4a2b56dadeeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release files / makemkv-0.3.1-py3-none-any.whl

Download URL makemkv-0.3.1-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
914a9ebb5ee6a3e8c0d5ca3e7e090836aaf8d8bf2f3112ffad8b9f63d3cc710f
BLAKE2b-256 checksum
How to use checksums
15a597ff4bfbc2dad68ec3b3c13ea230d0da27d4857ae48ebd6825e4e5cf85df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

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