Git Product home page Git Product logo

active_importer's Introduction

ActiveImporter

![Gitter](https://badges.gitter.im/Join Chat.svg)

ARCHIVED

Define importers that load tabular data from spreadsheets or CSV files into any ActiveRecord-like ORM.

Installation

Add this line to your application's Gemfile:

gem 'active_importer'

And then execute:

$ bundle

Or install it yourself as:

$ gem install active_importer

Usage

Define classes that you instruct on how to import data into data models.

class EmployeeImporter < ActiveImporter::Base
  imports Employee

  column 'First name', :first_name
  column 'Last name', :last_name
  column 'Department', :department do |department_name|
    Department.find_by(name: department_name)
  end
end

The importer defines what data model it imports data into, and how columns in the data source map to fields in the model. Also, by providing a block, the source value can be processed before being stored, as shown with the 'Department' column in the example above.

Once defined, importers can be invoked to import a given data file.

EmployeeImporter.import('/path/to/file.xls')

The data file is expected to contain columns with titles corresponding to the columns declared. Any extra columns are ignored. Any errors while processing the data file does not interrupt the whole process. Instead, errors are notified via some callbacks defined in the importer (see below).

Documentation

For mote detailed information about the different aspects of importing data with active_importer, refer to the following sections in the wiki.

Getting started

Diving in

Advanced features

Contributing

Contributions are welcome! Take a look at our contributions guide for details.

active_importer's People

Contributors

afiebig avatar gitter-badger avatar gnapse avatar

Watchers

 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.