Skip to content

Parse XPS files

Bases: Bolt

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

The ParseXPS class is designed to process XPS files. It takes an input folder containing XPS 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 ParseXPS 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_xps:
        name: "ParseXPS"
        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 XPS files in the given input folder and extract images.

Parameters:

Name Type Description Default
input_folder str

The folder containing XPS files to process.

None

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