Giter VIP home page Giter VIP logo

realm-cocoa-converter's Introduction

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

let realmFilePath = '' // Absolute file path to my Realm file
let outputFolderPath = '' // Absolute path to the folder which will hold the CSV files

let csvDataExporter = try! CSVDataExporter(realmFilePath: realmFilePath)
try! csvDataExporter.export(toFolderAtPath: outputFolderPath)

Generate a Realm file from CSV

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.

realm-cocoa-converter's People

Contributors

bdash avatar bmunkholm avatar farktronix avatar jpsim avatar justinjiadev avatar stel avatar tgoyne avatar timoliver avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.