agate-excel adds read support for Excel files (xls and xlsx) to agate.
- agate http://agate.rtfd.org
- Documentation: http://agate-excel.rtfd.org
- Repository: https://github.com/wireservice/agate-excel
- Issues: https://github.com/wireservice/agate-excel/issues
pip install agate-excel
For details on development or supported platforms see the agate documentation.
agate-excel uses a monkey patching pattern to add read for xls and xlsx files support to all
import agate import agateexcel
Importing agate-excel adds methods to
agate.Table. Once you’ve imported it, you can create tables from both XLS and XLSX files.
table = agate.Table.from_xls('examples/test.xls') print(table) table = agate.Table.from_xlsx('examples/test.xlsx') print(table)
Both methods accept a
sheet argument to specify which sheet to create the table from.
from_xls(cls, path, sheet=None)¶
Parse an XLS file.
- path – Path to an XLS file to load or a file-like object for one.
- sheet – The name of a worksheet to load. If not specified then the first sheet will be used.
from_xlsx(cls, path, sheet=None)¶
Parse an XLSX file.
- path – Path to an XLSX file to load or a file or file-like object for one.
- sheet – The name or integer index of a worksheet to load. If not specified then the “active” sheet will be used.
- Fix bug in handling of
Nonein boolean columns for XLS. (#11)
- Removed usage of deprecated openpyxl method
- Remove monkeypatching.
- Upgrade required agate version to
- Ensure columns with numbers for names (e.g. years) are parsed as strings.
- Initial version.
The MIT License
Copyright (c) 2015 Christopher Groskopf and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.