Skip to content

Parse MOBI files

Bases: Bolt

__init__(input, output, state, **kwargs)

The ParseMOBI class is designed to process MOBI files. It takes an input folder containing MOBI files as an argument and iterates through each file. For each file, it extracts the images and saves them in a designated output folder.

Parameters:

Name Type Description Default
input BatchInput

An instance of the BatchInput class for reading the data.

required
output BatchOutput

An instance of the BatchOutput class for saving the data.

required
state State

An instance of the State class for maintaining the state.

required
**kwargs

Additional keyword arguments.

{}

Using geniusrise to invoke via command line

genius ParseMOBI rise \
    batch \
        --bucket my_bucket \
        --s3_folder s3/input \
    batch \
        --bucket my_bucket \
        --s3_folder s3/output \
    none \
    process

Using geniusrise to invoke via YAML file

version: "1"
spouts:
    parse_mobi:
        name: "ParseMOBI"
        method: "process"
        input:
            type: "batch"
            args:
                bucket: "my_bucket"
                s3_folder: "s3/input"
        output:
            type: "batch"
            args:
                bucket: "my_bucket"
                s3_folder: "s3/output"

process(input_folder=None)

📖 Process MOBI files in the given input folder and extract images.

Parameters:

Name Type Description Default
input_folder str

The folder containing MOBI files to process.

None

This method iterates through each MOBI file in the specified folder and extracts the images.