GithubHelp home page GithubHelp logo

steveklabnik / donors-choose Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markmcspadden/donors_choose-data

3.0 3.0 1.0 81 KB

Library for working with the DonorsChoose.org dataset made available for the Hacking Education contest

Ruby 100.00%

donors-choose's Introduction

donors_choose

This library sprung from the 2011 Hacking Education contest for DonorsChoose.org. (http://www.donorschoose.org/hacking-education)

The DonorsChoose::Data module match up the normalized data provided by DonorsChoose.org to classes that inherit from ActiveRecord::Base.

This gem assumes you have loaded the DonorsChoose.org datasets into a PostgreSQL database and normalized the data. See the contest documentation for more information.

Usage

  gem install donors_choose
  
project = DonorsChoose::Data::Project.first
project.donations
school = DonorsChoose::Data::School.last
school.teachers

Rails

If you’d like to use it in Rails, just add the following to your Gemfile:

gem 'donors_choose'

Stand alone

If you’d like to use it stand alone, do the following:

Create a database.yml, very similar to what you’d have in Rails:

adapter: postgresql
host: localhost
username: postgres
password: password
port: 5432
database: donors_choose_data
schema_search_path: public

Then, drop into irb, require the gem, and establish the db connection

terminal$ irb
irb(main):001:0> require 'rubygems'
irb(main):001:0> require 'donors_choose'
irb(main):001:0> DonorsChoose::Data.connect(YAML.load(File.read('database.yml')))
irb(main):001:0> DonorsChoose::Data::Project.first

donors-choose's People

Contributors

markmcspadden avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

aniketpn

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.