Skip to main content

Python Wrapper for openpyxl

Project description

openpyxl

This module provides wrapper for openpyxl.

Installation

pip install takeme-openpyxl

Usage (Reader)

import takeme_openpyxl

INPUT_FILE_NAME = 'input.xlsx'
INPUT_COLUMNS = {
    'column1': {
        'label': 'Label 1',
        'column': 'A'
    },
    'column2': {
        'label': 'Label 2',
        'column': 'B'
    }
}

reader = takeme_openpyxl.ExcelReader(INPUT_FILE_NAME, INPUT_COLUMNS)
if reader.validate_labels() === True:
    row1_column1 = reader.get_value('column1')
    row1_column2 = reader.get_value('column2')
    print('Column1: {}, Column2: {}'.format(row1_column1, row1_column2))

    reader.next_row()

    row2_column1 = reader.get_value('column1')
    row2_column2 = reader.get_value('column2')
    print('Column1: {}, Column2: {}'.format(row1_column1, row1_column2))

reader.close()

Usage (Writer)

OUTPUT_FILE_NAME = 'output.xlsx'
OUTPUT_COLUMNS = {
    'column1': {
        'label': 'Label 1',
        'column': 'A'
    },
    'column2': {
        'label': 'Label 2',
        'column': 'B'
    }
}

writer = takeme_openpyxl.ExcelWriter(OUTPUT_COLUMNS)
writer.write('column1', 'Row1: Column1')
writer.write('column2', 'Row1: Column2')

writer.next_row()

writer.write('column1', 'Row2: Column1')
writer.write('column2', 'Row2: Column2')

writer.flush(OUTPUT_FILE_NAME)

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

takeme_openpyxl-1.0.3.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

takeme_openpyxl-1.0.3-py3-none-any.whl (16.1 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