Skip to main content

The library takes a dictionary of form {Sheet: {Cell: Value}} and updates the specified Excel file accordingly.

Project description

BMPxlsx

Build Status

The library takes a dictionary of form {Sheet: {Cell: Value}} and updates the specified Excel file accordingly.

This function was created in support of the Model My Watershed Web application WikiWatersheds that models Best Management Practice (BMP) impacts to reducing water quality impacts. (https://modelmywatershed.org/)

https://pypi.org/project/BMPxlsx/

Example Function Run

## Function(dataDictionary, FileName)

## Dictionary - {"SHEET": {"CELL": VALUE, "CELL": VALUE}}

datadict = {
'Sheet1': {'D1': 123.4, 'D2': 567.8},
'Sheet2': {'D1': 123.4, 'D2': 567.8},
'Sheet3': {'D1': 123.4, 'D2': 567.8},
}

## Full Path to File

loc = os.getcwd()
fnme = 'MMW_BMP_Spreadsheet_Tool(Skippack).xlsx'
file = os.path.join(loc, fnme)

## Run Function

writer = BMPxlsx.Writer(file)
input1 = {'Sheet1': {'D1': 13.4, 'D2': 47.8},
        'Sheet2': {'D1': 23.4, 'D2': 57.8},
        'Sheet3': {'D1': 33.4, 'D2': 67.8},
    }
input2 = {'Sheet1': {'D1': 23.4, 'D2': 57.8},
        'Sheet2': {'D1': 33.4, 'D2': 67.8},
        'Sheet3': {'D1': 43.4, 'D2': 77.8},
    }
writer.write(input1)
writer.close()

Installation

BMPxlsx was written and for Python version 2.7.15

$ pip install BMPxslx

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

BMPxlsx-0.0.2.tar.gz (2.4 kB view hashes)

Uploaded Source

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