orchetect/swift-textfile
Read and write text files in Swift on Apple platforms, Linux, and Android.
Overview
The main types provided:
| Type | Description | | --------------- | ------------------------------------------------------------ | | PlainTextFile | Read text file content from disk or from data in memory, with modestly robust text encoding auto-detection. | | CSV | Read and write CSV files. Reading implements the same text encoding auto-detection schema as PlainTextFile. | | TSV | Read and write TSV files. Reading implements the same text encoding auto-detection schema as PlainTextFile. | | StringTable | A basic abstraction for manipulating a matrix of strings (row and columns). |
Installation
Swift Package Manager (SPM)
To add this package to an Xcode app project, use:
https://github.com/orchetect/swift-textfile as the URL.
To add this package to a Swift package, add the dependency to your package and target in Package.swift:
let package = Package(
dependencies: [
.package(url: "https://github.com/orchetect/swift-textfile", from: "0.5.2")
],
targets: [
.target(
dependencies: [
.product(name: "TextFile", package: "swift-textfile")
]
)
]
)Roadmap
Future library additions could bring additional table data text file formats.
License
Licensed under the MIT license. See LICENSE for details.
Community & Support
Please do not email maintainers for technical support. Several options are available for issues and questions:
- Questions and feature ideas can be posted to Discussions.
- If an issue is a verifiable bug with reproducible steps it may be posted in Issues.
Contributions
Contributions are welcome. Posting in Discussions first prior to new submitting PRs for features or modifications is encouraged.
Code Quality & AI Contribution Policy
In an effort to maintain a consistent level of code quality and safety, this repository was built by hand and is maintained without the use of AI code generation.
AI-assisted contributions are welcome, but must remain modest in scope, maintain the same degree of quality and care, and be thoroughly vetted before acceptance.
Legacy
This repository was formerly known as swift-textfile-tools, and previously TextFileKit.
Package Metadata
Repository: orchetect/swift-textfile
Default branch: main
README: README.md