The library takes a dictionary of form {Sheet: {Cell: Value}} and updates the specified Excel file accordingly.
Project description
BMPxlsx
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.3.tar.gz
(2.4 kB
view hashes)