A Swift library for reading and writing CSV files with imperative row-by-row control and declarative Codable support.
CodableCSV is a Swift library for reading and writing CSV files. It provides both imperative row-by-row processing and declarative Codable-based encoding/decoding, solving the need for flexible and type-safe CSV handling in Swift applications. The library supports various data sources, extensive configuration, and adheres to the RFC4180 standard.
Swift developers working with CSV data, including those building data processing tools, import/export features, or applications requiring structured file I/O. It's particularly useful for projects needing both low-level control and high-level Codable integration.
Developers choose CodableCSV for its dual approach: imperative control for custom parsing and declarative Codable support for type safety. It stands out with its extensive configuration options, multi-platform support, and no external dependencies, making it a robust and flexible CSV solution for Swift.
Read and write CSV files row-by-row or through Swift's Codable interface.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides both imperative CSVReader/Writer for low-level control and declarative CSVDecoder/Encoder for Codable integration, allowing developers to choose the best approach for their use case.
Supports custom delimiters, escaping strategies, trimming, encoding, header handling, and more, as detailed in the configuration sections for readers and writers.
Works across Apple platforms and Ubuntu with no external dependencies, relying only on Swift Standard Library and Foundation, as shown in the badges and documentation.
Offers lazy decoding and row-by-row processing with buffering strategies to handle large CSV files without loading everything into memory, as explained in the lazy decoding and tips sections.
Nested Codable structures are not supported by default and require manual implementation of init(from:) and encode(to:) methods, which adds development overhead.
Using the Sequence syntax (e.g., for-in loops) with CSVReader does not throw errors, meaning invalid CSV data can lead to crashes instead of graceful error handling.
The wealth of configuration options and strategies (e.g., buffering, custom encoding/decoding) can be overwhelming for beginners or those needing quick setup.