Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. CodableCSV

CodableCSV

MITSwift0.6.7

A Swift library for reading and writing CSV files with imperative row-by-row control and declarative Codable support.

GitHubGitHub
483 stars75 forks0 contributors

What is CodableCSV?

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.

Target Audience

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.

Value Proposition

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.

Overview

Read and write CSV files row-by-row or through Swift's Codable interface.

Use Cases

Best For

  • Parsing large CSV files row-by-row to manage memory efficiently
  • Encoding and decoding Swift structs or classes to/from CSV using Codable
  • Handling CSV files with custom delimiters, encodings, or escaping strategies
  • Building cross-platform Swift applications that require CSV import/export functionality
  • Processing CSV data from various sources like strings, files, or streams
  • Ensuring RFC4180 compliance in CSV generation and parsing

Not Ideal For

  • Projects in non-Swift ecosystems requiring CSV processing
  • Simple CSV tasks where a lightweight, single-purpose library would suffice
  • Applications needing out-of-the-box support for deeply nested Codable structures without custom coding
  • Real-time data streaming scenarios where minimal parsing overhead is critical

Pros & Cons

Pros

Dual Interface Flexibility

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.

Extensive Configuration Options

Supports custom delimiters, escaping strategies, trimming, encoding, header handling, and more, as detailed in the configuration sections for readers and writers.

Multiplatform and Dependency-Free

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.

Memory Efficiency for Large Files

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.

Cons

Complex Nested Data Handling

Nested Codable structures are not supported by default and require manual implementation of init(from:) and encode(to:) methods, which adds development overhead.

Error Handling Gaps in Imperative Use

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.

Steep Configuration Learning Curve

The wealth of configuration options and strategies (e.g., buffering, custom encoding/decoding) can be overwhelming for beginners or those needing quick setup.

Frequently Asked Questions

Quick Stats

Stars483
Forks75
Contributors0
Open Issues10
Last commit2 years ago
CreatedSince 2018

Tags

#declarative-programming#encoder#csv-reader#codable#data-serialization#csv-writer#swift-package-manager#csv-parsing#file-io#csv#multi-platform#rfc4180#swift#swift-library#decoder#csv-parser

Built With

F
Foundation
S
Swift

Included in

iOS51.7kSwift26.0k
Auto-fetched 9 hours ago

Related Projects

CSV.swiftCSV.swift

CSV reading and writing library written in Swift.

Stars730
Forks84
Last commit1 year ago
CSwiftVCSwiftV

A csv parser written in swift conforming to rfc4180

Stars172
Forks45
Last commit3 years ago
CSVParserCSVParser

A swift package for read and write CSV file

Stars83
Forks12
Last commit7 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub