Coder Social home page Coder Social logo

fake-csv's Introduction

fake-csv

Create fake CSV data with faker-ruby

Install gems with bundle install

Update template.yml with fake CSV definition

Run ruby fake_csv.rb to produce the output file fake.csv

Supported Data

name

Generates a first and last name separated by a space

- name: name
  type: name

integer

Generates an integer between min and max values

- name: age
  type: integer
  options:
    min: 18
    max: 100

date

Generates a date between min and max values

- name: dob
  type: date
  options:
    min: 1930-01-01
    max: 2020-01-01

postcode

Generates a UK style postcode

- name: postcode
  type: postcode

id

Generates an ID in the style of US SSN, e.g 552-56-3593

- name: patient_id
  type: id

enum

Selects a value from a supplied list. Values can be weighted

- name: gender
  type: enum
  options:
    list:
    - m
    - f
- name: ethnicity
  type: enum
  options:
    list:
    - value: white
      weight: 70
    - value: black
      weight: 30

Example output

name,age,dob,postcode,gender,ethnicity,hospital_id,patient_id
Porter Keebler,61,2014-08-05,H5D 6BB,f,white,hosp5678,422-68-4172
Evelyn Considine,100,2016-11-20,WE4 1EY,f,white,hosp5678,403-39-4811

fake-csv's People

Contributors

mtawse 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.