This is a patch release improving compatibility with different spreadsheet formats.
Closed issues:
- Cannot initialize SchemaType from invalid String value
extendedProperties
(#145) - Cannot initialize SchemaType from invalid String value
workbookmetadata
(#142)
Merged pull requests:
- Update dependencies (#147) via @ie-ahm-robox
- Add
purl.oclc.org
relationship schema type (#146) via @MaxDesiatov - Add
googleWorkbookMetadata
case to relationships (#143) via @MaxDesiatov - Add Xcode 12.3 to the
test.yml
workflow (#144) via @MaxDesiatov - Add Xcode 12.4 to the
test.yml
workflow (#149) via @MaxDesiatov
This release improves compatibility with different spreadsheet formats, simplifies cell font and formatting APIs, and drops support for Carthage. Additionally, Xcode 11.3 on macOS is now the oldest supported version for building CoreXLSX.
Breaking changes:
- Make
parseSharedStrings
return optional value (#122) via @MaxDesiatov - Test with Xcode 12, drop Carthage and Xcode 10 support (#140) via @MaxDesiatov
Closed issues:
- Unable to sort columns by
intValue
(#137) - Cannot initialize SchemaType from invalid String value (#136)
- Odd cell.s value (#134)
- 0.13.0 not available on Cocoapods (#133)
- Unable to read xlsx file (#130)
- Increase speed of parsing? (#127)
- .xlsx File not opening with XLSXFile() (#125)
- Getting Data From a specific Worksheet (#124)
- ArchiveEntryNotFound error (#121)
- Printing an empty cell? (#118)
- Handling encrypted spreadsheets? (#101)
Merged pull requests:
- Compare
ColumnReference
byintValue
(#139) via @MaxDesiatov - Add missing
SchemaType.webExtensionTaskPanes
(#138) via @MaxDesiatov - Add
font(in:)
andformat(in:)
functions (#135) via @MaxDesiatov - Test with Swift 5.3 for Linux (#132) via @MaxDesiatov
- Generate and publish docs with
swift-doc
(#131) via @MaxDesiatov - Add “person” to the relationship types (#126) via @texuf
- Fix parsing root relationships worksheet paths (#123) via @MaxDesiatov
This is a bugfix release with breaking changes that make count
property on MergeCells
and all
properties on Workbook.View
optional. Many thanks to
@Ethan-Chew and
@robgtsoftware for reporting these issues!
Closed issues:
Merged pull requests:
- Make Workbook.View properties optional (#120) via @MaxDesiatov
- Make count optional in MergeCells (#119) via @MaxDesiatov
The is a bugfix release with a breaking change, it makes size
and font
properties
optional on the RichText.Properties
type to improve compatibility with certain spreadsheets.
Thanks to @Ethan-Chew for reporting this in
#116.
This is a bugfix release that resolves an issue with parsing cells that contain time values. Thanks to @mb812 for reporting it!
Closed issues:
- Error parsing cells with Time value (#114)
file.parseWorksheetPathsAndNames()
wannaworkbook: <#Workbook#>
(#113)- XLSXFile not initialising when passing document directory path (#108)
Merged pull requests:
- Fix time values returned by Cell.dateValue (#115) via @MaxDesiatov
This is a feature release that enables compatibility with CryptoOffice for decrypting spreadsheets. Additionally, with 0.11.0 you can easily get worksheet names with a new parseWorksheetPathsAndNames
function on XLSXFile
and get rich text values from cells with a new richStringValue
function on Cell
.
Due to technical issues, Swift 5.0 CI job for Linux has been removed, so compatibility with Swift 5.0 on Linux can no longer be guaranteed. While CoreXLSX may continue to work with Swift 5.0 on Linux, please update to Swift 5.1 or later to avoid unexpected issues.
Thanks to @kobylyanets and @duodo2412 for their contributions to this release!
New APIs:
-
XLSXFile
now provides a new initializer that takes an argument ofData
type. This allows opening in-memory documents, the primary example being spreadsheets decrypted with CryptoOffice. -
XLSXFile
now has a newparseWorksheetPathsAndNames
function that returns an array of worksheet names and their paths in a given workbook, while previously you had to useparseWorksheetPaths
and match paths manually with results of theparseWorkbooks
function. -
Cell
now has arichStringValue
function that takes a result ofXLSXFile.parseSharedStrings
function and produces an array ofRichText
values. This makes it easier to query rich text content from cells, while previously you had to match cell values againstSharedStrings
manually.
Breaking change:
Due to the introduction of the new XLSXFile.init(data:)
initializer, the filepath
property on XLSXFile
no longer makes sense. This property was not used internally
in any way and in-memory files don't have any filepaths. If you need to refer to a
filepath of an .xlsx
file after you've parsed from your filesystem, you should
retain it manually and process it separately as you see fit.
Closed issues:
- API for matching sheet names to sheet paths (#105)
Merged pull requests:
- Bump XMLCoder dependency to 0.11.1 (#112) via @MaxDesiatov
- Add data XLSXFile.init, remove filepath property (#111) via @MaxDesiatov
- Add func parseWorksheetPathsAndNames on XLSXFile (#109) via @MaxDesiatov
- Drop support for Swift 5.0 on Linux (#110) via @MaxDesiatov
- Add ability to get cell value as RichText (#106) via @kobylyanets
This is a release with bugfixes and a few improvements to usability of the spreadsheet cell values API. Thanks to all contributors and users, you provide an invaluable amount of feedback and help!
New API:
The library now provides a simplified API to fetch string and date values from cells, which is much easier to use than the previous version (which is still available).
Here's how you can get all strings (including shared strings) in column "C" for example:
let sharedStrings = try file.parseSharedStrings()
let columnCStrings = worksheet.cells(atColumns: [ColumnReference("C")!])
.compactMap { $0.stringValue(sharedStrings) }
To parse a date value from a cell, use dateValue
property on the Cell
type:
let columnCDates = worksheet.cells(atColumns: [ColumnReference("C")!])
.compactMap { $0.dateValue }
Breaking change:
The type
property on Cell
is no longer of String
type. It was previously
used to check if cell's type is equal to "s"
, which denoted a shared string.
You should use enum values for that since this release, which for shared strings
now is (unsurprisingly) .sharedString
.
Closed issues:
- Xcode 11 installation and build (#90)
- Reading Date values from cell (#89)
- Can't open xml (#82)
- Not able to read Numeric data from Sheet (#81)
- Getting the value of a cell with number format? (#71)
- Opening xlsx file Document Directory, Crashes (#52)
Merged pull requests:
- officeDocument is misspelled in corePropreties Relationship (#95) via @mrkammoun
- Add cell type enum, date/sharedStrings helpers (#102) via @MaxDesiatov
- Make XLSXFile a class, not a struct (#100) via @MaxDesiatov
- Clarify lack of support for .xls files in README (#99) via @MaxDesiatov
- Clarify Xcode 11 and Xcode 10 project details (#98) via @MaxDesiatov
- Update dependencies to their latest versions (#96) via @MaxDesiatov
- Update SwiftFormat settings, add pre-commit (#97) via @MaxDesiatov
- Fix workbooks with no views, cleanup tests (#93) via @MaxDesiatov
- Test on Xcode 11.3 with macOS 10.15 (#92) via @MaxDesiatov
- Update ZIPFoundation to 0.9.10 (#91) via @MaxDesiatov
This release adds a new value to the Relationship.SchemaType
enum, which fixes
compatibility with some spreadsheet files. Thanks to
@mxcl for the bug report!
Fixed bugs:
- Cannot initialize SchemaType from invalid String value #87
Merged pull requests:
- Add
case customXml
to Relationship.SchemaType #88 (MaxDesiatov)
This release adds Linux support and improves compatibility with .xlsx
files
that contain shared strings. Thanks to
@CloseServer,
@funnel20 and
@LiewLi for bug reports and contributions!
Implemented enhancements:
- Bump XMLCoder to 0.9.0, add CI jobs for Linux, Xcode 11 #86 (MaxDesiatov)
Fixed bugs:
- Multi-line text in an Excel cell is parsed into single line in the
SharedStrings property
text
#83
Closed issues:
- I crashed while calling try file.parsesharedstrings () with an error #79
Merged pull requests:
- Bump line length limit in .swiftlint.yml #85 (MaxDesiatov)
- Make decoder.trimValueWhitespaces false, add test #84 (MaxDesiatov)
- Bump XMLCoder dependency to 0.8.0 #80 (MaxDesiatov)
- SharedString uniqueCount property can be nil #78 (LiewLi)
Feature and bugfix release that makes the library compatible with more
spreadsheet types. It also adds support for Comments
structure,
which can be parsed with the new parseComments
API.
Many thanks to @grin, @GoldenJoe and @LiewLi for reporting and fixing issues in this release.
Closed issues:
parseDocumentPaths
has internal protection, but is needed byparseDocumentRelationships
#74- Missing Documentation #73
Merged pull requests:
- Bump XMLCoder dependency to 0.7.0 #77 (MaxDesiatov)
- Fix non-macOS framework targets #76 (MaxDesiatov)
- missing
text
property when format is applied at the character level #72 (LiewLi) - Add comment support #70 (grin)
Bugfix release that improves compatibility with different spreadsheet types.
Thanks to @grin for reporting and fixing issues in this release.
Breaking changes:
All properties on struct Format
except fontId
and numberFormatId
are
now optional.
Additions:
New borderId
and fillId
properties on struct Format
.
Fixed bugs:
- Can't get cell string #58
- Can't load basic spreadsheets created in Google Docs #64
fillId
andborderId
attributes missing from CoreXLSX.Format #65
Merged pull requests:
- Fix decoding of Borders model type #69 (MaxDesiatov)
- Add fail flag to scripts #68 (hodovani)
- Move from Travis to Azure Pipelines #67 (MaxDesiatov)
- Add missing attributes #66 (grin)
Bugfix release that adds case externalLink
to Relationship.SchemaType
improving .xlsx compatibility.
This is a bugfix release with changes to the model API that improve compatibility with files containing formulas and varied shared string formats.
Specifically:
- new
struct Formula
added with a corresponding property onstruct Cell
- property
color
onstruct Properties
became optional properties
onstruct RichText
became optional- new
chartsheet
case added toenum Relationship
richText
onstruct SharedStrings
became an array, not optional
Closed issues:
- Error Domain=NSCocoaErrorDomain Code=4865 "Expected String but found null instead." #59
- Importing XLSX file #56
- Error ParseCellContent #51
- error
parseWorksheet
#50 - Couldn't find end of Start Tag c #37
Merged pull requests:
- Add
Formula
struct, fix other model types #61 (MaxDesiatov) - Bump
XMLCoder
dependency to 0.5, fixSharedStrings
#60 (MaxDesiatov)
This is a release with API additions and bug fixes.
This release of CoreXLSX can be integrated as a Swift 5 module if you're using Xcode 10.2, but support for Swift 4.2 and earlier Xcode 10 versions is also maintained.
Compatibility is improved for big files and files that internally contain namespaced XML. A few other previously reported compatibility issues are now fixed. Many thanks to everyone who reported the issues, the improvements in this release wouldn't be possible without your contribution!
Breaking changes:
Several properties on the model types became optional when there's no guarantee they are always available in files generated by different apps and tools.
Additions:
Now you can parse style information from the archive with the new
parseStyles()
function. Please refer to the Styles
model
for more details. Please note that not all XLSX files contain style
information, so you should be prepared to handle the errors thrown from
parseStyles()
function in that case.
Merged pull requests:
- Add testSpacePreserve to SharedStrings tests #57 (MaxDesiatov)
- Fix XML namespaces, bump ZIPFoundation dependency #55 (MaxDesiatov)
- Split package manifest for Swift 5 and Swift 4.2 #54 (MaxDesiatov)
- Update XMLCoder dependency to 0.4.0 #53 (MaxDesiatov)
- Add Styles with structs describing styles.xml #46 (MaxDesiatov)
- Add test to check sharedStrings order #44 (hodovani)
- Fix root paths in CoreXLSX, fix formatter & linter #43 (MaxDesiatov)
This is a release with API improvements and bug fixes. A big thank you to everyone who provided bug reports and contributions that made this release possible!
Breaking changes:
- A few properties on the model types were added with cleaner names and better fitting types. Most of the old versions of those properties were kept as deprecated, but you might get some breakage with optionality, where we couldn't find a good deprecation path.
Additions:
-
New
parseSharedStrings
function onXLSXFile
allows you get values of cells with shared string value. Quite frequently those strings are unavailable and are only referenced in the original model types you get withparseWorksheet
. -
Previously when addressing cells and columns you had to use a stringly-typed API. It was also not very convenient for specifying a range of columns. This is now fixed with the new type-safe
ColumnReference
struct, which conforms toComparable
andStrideable
. -
Following the addition of an error context to
XMLCoder
, which is the main dependency ofCoreXLSX
, it is now exposed onstruct XLSXFile
. Pass a non-zero value toerrorContextLength
argument (default is0
) ofXLSXFile
initializer and you'll get a snippet of XML that failed to parse in the debug description of the error value. -
Additional optional argument
bufferSize
was added toXLSXFile
initializer as a response to previous reports about problems with zip file extraction. The default value is 10 MiB, which seems to be enough in most cases, but you can still try passing a larger value for bigger files if you see that an XML file stops abruptly in the middle of the file. Unfortunately, we haven't found a good way to adjust this value dynamically based on the file size, but a sufficiently large value should work for all files, which is the default. -
Support for Carthage was added as well as support for tvOS and watchOS.
Bugfixes:
Some files that couldn't be previously parsed should now be handled better thanks to fixes in optionality and more properties added to the model types.
All changes:
- Set global version in project file, bump to 0.4.0 (#39) (MaxDesiatov)
- Update README.md (#40) @chriseidhof
- Expose
errorContextLength
onstruct XLSXFile
(#38) (MaxDesiatov) - Add
customProperties
relationship (#34) (NSMutableString) - Update XMLCoder and ZIPFoundation dependencies (#36) (MaxDesiatov)
- Update requirements in README.md (MaxDesiatov)
- Add extra relationship metadataThumbnail (#33) (NSMutableString)
- Refactor Worksheet and Pane values to optional (#31) (hodovani)
- Add bufferSize parameter to init (#30) (hodovani)
- Add more cases to
Relationship.SchemaType
(#25) (MaxDesiatov) - Add
public func parseDocumentRelationships
(#23) (MaxDesiatov) - Make Relationships public, add parseRelationships (#22) (MaxDesiatov)
- Add SharedStrings model, parse sharedStrings.xml (#8) (MaxDesiatov)
- Paste XML snippet into WorksheetTests as is (MaxDesiatov)
- Add a second XML snippet to WorksheetTests (MaxDesiatov)
- Clarify issue reporting in README.md (MaxDesiatov)
- Test newspaces in attributes in WorksheetTests (MaxDesiatov)
- More XML with newlines in WorksheetTests (MaxDesiatov)
- Add newline characters test to WorksheetTests (MaxDesiatov)
- Add cell with a single attribute to WorksheetTests (MaxDesiatov)
- Add rows and cells to WorksheetTests (MaxDesiatov)
- Update names and types of properties on Worksheet (#18) (MaxDesiatov)
- Rename sheetData on Worksheet and make it optional (#17) (MaxDesiatov)
- Add simple
Workbook
model with tests (#16) (MaxDesiatov) - Make
columns
property optional onWorksheet
(#14) (MaxDesiatov) - Fix example project after new files were added (#13) (MaxDesiatov)
- Remove
worksheetCache
private property as unused (#11) (MaxDesiatov) - Clarify platform setting for CocoaPods in README (MaxDesiatov)
- Clarify Carthage instructions in README.md (MaxDesiatov)
- Add API for filtering cells by rows and columns (#7) (MaxDesiatov)
- Add Carthage and support for tvOS and watchOS (#6) (MaxDesiatov)
- Implement
Strideable
onColumnReference
(#5) (MaxDesiatov) - Add ColumnReference type with new API (#3) (MaxDesiatov)
- Improve
Worksheet
model property naming (#2). Some properties onWorksheet
and its descendants had obscure names, most of that is fixed now with old names marked as deprecated.
- Refine README.md to include implementation details.
- Refine code comments and links in README.md
- Update README.md with instructions for Swift Package Manager.
- Cell by row/column filtering API with
worksheetCache
(#1) This new API allows users to filter all cells by a row or column reference. To avoid re-parsing of worksheets, a new privateworksheetCache
property is added onXLSXFile
.
- Added macOS 10.11 deployment target to the podspec
- Improved README, fixed podspec
- First release with reading support for basic .xlsx files