A Swift library for reading and writing CSV files with support for Decodable serialization and RFC4180 compliance.
CSV.swift is a Swift library for reading and writing CSV (Comma-Separated Values) files. It provides tools to parse CSV data from strings or files, serialize rows into Decodable objects, and generate CSV output, solving the problem of handling tabular data in Swift applications.
Swift developers working with CSV data in iOS, macOS, or server-side applications, particularly those needing type-safe parsing or integration with Swift's Codable system.
Developers choose CSV.swift for its native Swift API, support for Decodable serialization, and adherence to RFC4180, offering a lightweight and idiomatic alternative to manual CSV handling or heavier data processing libraries.
CSV reading and writing library written in Swift.
Directly serialize CSV rows into Swift structs using Decodable protocol with CSVRowDecoder, as shown in the README example for converting rows to objects like DecodableExample.
Access fields intuitively via subscript notation with header names (e.g., csv["id"]!), reducing reliance on column indices and improving code readability.
Adheres to the standard CSV format specification, ensuring reliable parsing and generation for interoperability with other systems and tools.
Supports reading from strings or file streams and writing to memory or files, with customizable character encodings like UTF16, as demonstrated in the code examples.
The library lacks built-in async/await or concurrent parsing features, which can limit performance for large file processing in modern Swift applications.
Examples in the README use force-unwrapping (!) and require manual try-catch blocks, leading to potentially cumbersome error management in production code.
Focused on RFC4180 compliance, it may not support non-standard delimiters or complex escaping rules, restricting flexibility for unconventional CSV variants.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.