Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pjsier/anki-compressor
Command line utility to compress Anki deck .apkg file size
https://github.com/pjsier/anki-compressor
anki cli hacktoberfest python
Last synced: 3 months ago
JSON representation
Command line utility to compress Anki deck .apkg file size
- Host: GitHub
- URL: https://github.com/pjsier/anki-compressor
- Owner: pjsier
- License: mit
- Created: 2018-01-22T02:10:31.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-03-20T15:49:09.000Z (10 months ago)
- Last Synced: 2024-10-01T09:42:39.219Z (3 months ago)
- Topics: anki, cli, hacktoberfest, python
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Anki Compressor
[![Build status](https://github.com/pjsier/anki-compressor/workflows/CI/badge.svg)](https://github.com/pjsier/anki-compressor/actions)
![pypi](https://img.shields.io/pypi/v/anki-compressor)Compresses images and audio in [Anki](https://apps.ankiweb.net/) .apkg files to reduce the overall file size.
## Installation
`anki-compressor` can be installed with Pip, but it requires [Pydub](http://pydub.com/) and [Pillow](https://pillow.readthedocs.io/en/latest/) 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
```shell
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_
-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
-t {jpg,jpeg,png,tif,tiff,gif,webp}, --image_type {jpg,jpeg,png,tif,tiff,gif,webp}
Filetype for image compression, defaults to jpeg
```Here's an example of compressing a file `input.apkg` and writing the output to `output.apkg`:
```bash
anki-compressor -i input.apkg -o output.apkg -q 50 -b 64k -t jpeg
```### Arguments
- `-i`: Specifies the input file and is required
- `-o`: Output file name, defaults to `MIN_`
- `-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'
- `-t`: Filetype for image compression, defaults to jpeg