Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/realm/realm-cocoa-converter
A library that provides the ability to import/export Realm files from a variety of data container formats.
https://github.com/realm/realm-cocoa-converter
Last synced: 3 months ago
JSON representation
A library that provides the ability to import/export Realm files from a variety of data container formats.
- Host: GitHub
- URL: https://github.com/realm/realm-cocoa-converter
- Owner: realm
- License: apache-2.0
- Created: 2016-01-21T06:43:28.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-10-06T19:24:57.000Z (about 2 years ago)
- Last Synced: 2024-07-24T10:07:42.961Z (3 months ago)
- Language: Swift
- Size: 11.5 MB
- Stars: 219
- Watchers: 25
- Forks: 25
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - realm-cocoa-converter - A library that provides the ability to import/export Realm files from a variety of data container formats. (Database / Getting Started)
- awesome-macos-libraries - Realm Converter - A library that provides the ability to import/export Realm files from a variety of data container formats. Language: Swift. (Database)
- awesome-realm - Realm Converter - Utility framework to make it easier to get data both in and out of Realm (imports from CSV, XLSX and JSON). (Swift / <a name="swift-libs"></a>Swift Libraries and Components)
- awesome-ios-star - realm-cocoa-converter - A library that provides the ability to import/export Realm files from a variety of data container formats. (Database / Getting Started)
- fucking-awesome-ios - realm-cocoa-converter - A library that provides the ability to import/export Realm files from a variety of data container formats. (Database / Getting Started)
- fucking-awesome-ios - realm-cocoa-converter - A library that provides the ability to import/export Realm files from a variety of data container formats. (Database / Getting Started)
README
# Realm Converter
Realm Converter is an open source software utility framework to make it easier
to get data both in and out of Realm.
It has been built in Swift, but can also be easily utilized in Objective-C projects.## Technical Requirements
macOS: 10.9 or later
iOS: 10.0 or later## Features
### Schema Generator
* Provides an interface to analyze the intended files to import and produce
a compatible schema set that can be used to generate the Realm file### Importer
* Imports from CSV, XLSX and JSON.### Exporter
* Exports a Realm file to CSV.## Examples
Using Swift's Objective-C bridging, it's possible to use Realm Converter in Objective-C
as well; and all classes on the Objective-C side are pre-fixed with `RLM`.### Exporting a Realm file to CSV
```swift
let realmFilePath = '' // Absolute file path to my Realm file
let outputFolderPath = '' // Absolute path to the folder which will hold the CSV fileslet csvDataExporter = try! CSVDataExporter(realmFilePath: realmFilePath)
try! csvDataExporter.export(toFolderAtPath: outputFolderPath)
```### Generate a Realm file from CSV
```swift
var filePaths = [String]() // Array of file paths to each CSV file to include
let destinationRealmPath = '' // Path to the folder that will hold this Realm file// Analyze the files and produce a Realm-compatible schema
let generator = ImportSchemaGenerator(files: filePaths)
let schema = try! generator.generate()// Use the schema and files to create the Realm file, and import the data
let dataImporter = CSVDataImporter(files: filePaths)
try! dataImporter.import(toPath: destinationRealmPath, schema: schema)
```# License
Realm Converter is licensed under the Apache license. See the LICENSE file for details.