Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
pip install -e .[dev]

- name: Run tests
run: |
Expand Down
85 changes: 84 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,84 @@
# meowDFer
# meowDFer
### Extract, Convert, Merge
This is a tool made to simplify the processes mentioned above.

## How to use

##### Example commands:

- `py -m src extract --src s_name --dest d_name`
- `py -m src convert --src s_name --dest d_name`
- `py -m src merge --src s_name --dest d_name --vol v_name.txt`
- `py -m src all --src s_name --dest d_name --vol v_name.txt`
- `py -m src cm --src s_name --dest d_name --vol v_name.txt`

## `extract`

Extracts multiple zip files into one folder.

1. Create a folder in root, put all .zip files inside.
2. In the root of the directory, open the terminal and run:

```py -m src extract --src s_name --dest d_name```
- s_name: name of folder with zip files
- d_name: name of folder where files to be extracted in

3. Folder with d_name will be created in root with extracted zip files

## `convert`

Converts folder with images (chapters) into PDFs. Folders with images must contain 'chapter', 'ch.', or 'c' with a number. Decimal number chapters get skipped.

1. Create a folder containing folders of images with chapter and number in name. Or have the folders from 'extract'.
2. In the root of the directory, open terminal and run:

```py -m src convert --src s_name --dest d_name```
- s_name: name of folder with image folders
- d_name: name of folder where chapter PDFs to be extracted in

3. Folder with d_name will be created in root with PDFs of chapters.

## `merge`

Merge many PDF s (chapters) into volumes, using a .txt file. In the .txt file write the upper limit chapter number of a volume separated by a comma. (e.g. "3, 5, 7, 9")

1. Create a folder containing PDF chapters, or get them from step above.
2. Create a .txt file with comma separated values, which are upper limit chapter numbers.
3. In the root directory, open terminal and run:

```py -m src merge --src s_name --dest d_name --vols v_name.txt```
- s_name: name of folder with chapter PDFs
- d_name: name of folder where volumes to be extracted in
- v_name.txt: name of .txt files containing all limit chapter numbers

4. Folder with d_name will be created in root with volumes.

## `all`

This combines all three commands: extract, convert, and merge. They will run one after another.

1. Create a folder in root, put all .zip files inside.
2. Create a .txt file with comma separated values, which are upper limit chapter numbers.
3. In the root directory, open terminal and run:

```py -m src all --src s_name --dest d_name --vols v_name.txt```
- s_name: name of folder with .zip files
- d_name: name of folder where volumes to be extracted in
- v_name.txt: name of .txt files containing all limit chapter numbers

4. Folder with d_name will be created in root with volumes.

## `cm`

This combines two commands: convert, and merge. They will run one after another.

1. Create a folder containing folders of images with chapter and number in name. Or have the folders from 'extract'.
2. Create a .txt file with comma separated values, which are upper limit chapter numbers.
3. In the root directory, open terminal and run:

```py -m src cm --src s_name --dest d_name --vols v_name.txt```
- s_name: name of folder with image folders
- d_name: name of folder where volumes to be extracted in
- v_name.txt: name of .txt files containing all limit chapter numbers

4. Folder with d_name will be created in root with volumes.
1 change: 1 addition & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
all = ["cli"]
4 changes: 4 additions & 0 deletions src/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .cli import main

if __name__ == "__main__":
main()
15 changes: 8 additions & 7 deletions src/meowDFer.py → src/cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import sys
import argparse

from commands import convert_command, extract_command, merge_command, all_command, cm_command
from .commands import (
convert_command,
extract_command,
merge_command,
all_command,
cm_command
)

logo = r"""
|\ _,,,---,,_
Expand Down Expand Up @@ -91,8 +96,4 @@ def main():
cm_command.run(args, name)

else:
parser.print_help()


if __name__ == "__main__":
main()
parser.print_help()
5 changes: 5 additions & 0 deletions src/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .extract_command import *
from .convert_command import *
from .merge_command import *
from .all_command import *
from .cm_command import *
6 changes: 3 additions & 3 deletions src/commands/all_command.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import tempfile

from utils.extract import extract_zips
from utils.convert import convert_all_to_pdf
from utils.merge import merge_to_volumes
from ..utils.extract import extract_zips
from ..utils.convert import convert_all_to_pdf
from ..utils.merge import merge_to_volumes

def run(args, name):
src = args.src
Expand Down
4 changes: 2 additions & 2 deletions src/commands/cm_command.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import tempfile

from utils.convert import convert_all_to_pdf
from utils.merge import merge_to_volumes
from ..utils.convert import convert_all_to_pdf
from ..utils.merge import merge_to_volumes

def run(args, name):
src = args.src
Expand Down
2 changes: 1 addition & 1 deletion src/commands/convert_command.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from utils.convert import convert_all_to_pdf
from ..utils.convert import convert_all_to_pdf

def run(args, name):
src = args.src
Expand Down
2 changes: 1 addition & 1 deletion src/commands/extract_command.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from utils.extract import extract_zips
from ..utils.extract import extract_zips

def run(args):
src = args.src
Expand Down
2 changes: 1 addition & 1 deletion src/commands/merge_command.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from utils.merge import merge_to_volumes
from ..utils.merge import merge_to_volumes

def run(args, name):
src = args.src
Expand Down