Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


csv2osdi is a command-line utility to upload a CSV file of people into an OSDI compliant system. It features the ability to assign tags on a per row basis and has a configurable schema for csv files.

It can also verify that the remote system has the necessary tags before the upload. (Some systems require them to be created in advance)

For systems that do not natively support phone numbers, csv2osdi can be configured to map them to custom fields on the remote system.

Action Network requires this


csv2osdi requires a working AEP and osdi:person_signup_helper to operate.

Install and Usage

  1. Clone this repository
  2. Run '''bundle install'''
  3. Copy config-sample.yml to config.yml
  4. Edit config to your liking
  5. run ./csv2osdi

If you are on Windows, run bundle exec ruby csv2osdi.rb

csv2osdi comes with a sample CSV and config-sample to test with.



# filename for csv file
csv: sample.csv

# Your OSDI API Token
osdi_api_token: <%= ENV['OSDI_API_TOKEN'] %>

# Your OSDI system's AEP URL

# Content Type for OSDI requests.
request_content_type: application/json #(default: application/json)

# Start at the following row
# offset: 2 # default 0

# Limit number of rows, good for testing.  Additive to offset
#row_limit: 4 # default none

# Before doing upload, make sure the remote system has the needed tags created already and it not, abort.
verify_tags_first: true

# number of times to retry a given row. Useful for timeouts
max_retries: 5

# Log file
#log_file: output.log

# show detailed HTTP logs of requests
http_log: false

# just log OSDI signup helper objects
osdi_log: false

# the schema representing your CSV file structure
# For each field, set the column number with a zero based integer.
# Eg, the first column is column 0
# this schema is for the included sample.csv file which has columns:
0 1 2 3 4 5 6 7 8 9 10 11 12 13
Household ID Last First Middle YoB MoB DoB Address City State Zip Email Volunteer_tag color
  email_address: 11
  given_name: 2 #first name
  family_name: 1 # last name
  #mobile_phone: 3
  locality: 8 # city
  region: 9 # state
  postal_code: 10 # zip code

  # set any column to be the specified custom field on the remote system
    favorite_color: 13

  # the presence of any value in the specified column means that this row should be tagged with the specified tag name
    volunteer: 12
    #foobar: 13
    #volunteer_master: 14

  # if your system does not natively support phone numbers, they can be inserted into custom fields named below
    mobile_phone: mobile_phone
    home_phone: mobile_phone


You can specify a log file which csv2osdi will write it's output to in addition to STDOUT.

Example output

INFO 2017-04-01 05:17:30 +0000: csv2osdi Starting up, chillin with
INFO 2017-04-01 05:17:31 +0000: All needed tags are present.  Proceeding.
INFO 2017-04-01 05:17:31 +0000: Uploading with offset 0 and limit NONE
INFO 2017-04-01 05:17:31 +0000: Uploaded row 0 Lawrence Woodard with tags volunteer as
INFO 2017-04-01 05:17:32 +0000: Uploaded row 1 Joshua Carter with tags volunteer as
INFO 2017-04-01 05:17:33 +0000: Uploaded row 2 Melissa Scott with tags volunteer as
INFO 2017-04-01 05:17:34 +0000: Uploaded row 3 Richard Mcclain with tags volunteer as
INFO 2017-04-01 05:17:35 +0000: Uploaded row 4 Scott Jefferson with tags volunteer as
INFO 2017-04-01 05:17:36 +0000: Uploaded row 5 Johnny Mathis with tags volunteer as
INFO 2017-04-01 05:17:37 +0000: Uploaded row 6 Frank Charles with tags  as
INFO 2017-04-01 05:17:37 +0000: Uploaded row 7 Walter Gamble with tags  as
INFO 2017-04-01 05:17:38 +0000: Uploaded row 8 Scott Williams with tags  as
INFO 2017-04-01 05:17:38 +0000: csv2osdi finished.  Total rows 9 Successes 9 Failures 0


OSDI API Reference

OSDI Informational Site



Copyright 2017 Josh Cohen


csv2osdi - Import a CSV to an OSDI system



No releases published


No packages published