Skip to main content

Compress Anki deck .apkg file size

Project description

Anki Compressor

Build status pypi

Compresses images and audio in Anki .apkg files to reduce the overall file size.

Installation

anki-compressor can be installed with Pip, but it requires Pydub and Pillow which have native dependencies that need to be installed. You'll need to include support for libvorbis in the audio library, since all audio is converted to ogg and all images are converted to jpg.

Once you've installed those dependencies, run pip install anki-compressor to install the command line script.

Usage

usage: anki-compressor [-h] -i INPUT [-o OUTPUT] [-q QUALITY] [-b BITRATE]

Compress Anki .apkg file size

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Input .apkg file to compress
  -o OUTPUT, --output OUTPUT
                        Output file to write, defaults to MIN_<INPUT>
  -q QUALITY, --quality QUALITY
                        Quality value for image compression (0-100), defaults to 50
  -b BITRATE, --bitrate BITRATE
                        ffmpeg-compliant bitrate value for audio compression, defaults to 48k

Here's an example of compressing a file input.apkg and writing the output to output.apkg:

anki-compressor -i input.apkg -o output.apkg -q 50 -b 64k

Arguments

  • -i: Specifies the input file and is required
  • -o: Output file name, defaults to MIN_<INPUT>
  • -q: Image quality on a scale of 1-100 supplied to Pillow's image processing, defaults to 50
  • -b: Bitrate for audio output, defaults to '48k'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anki-compressor-0.1.0.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

anki_compressor-0.1.0-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page