{"id":16200941,"url":"https://github.com/marks/nces-school-data","last_synced_at":"2025-04-07T18:16:26.641Z","repository":{"id":20983036,"uuid":"24272265","full_name":"marks/nces-school-data","owner":"marks","description":"Some code to programmatically get data from NCES (the National Center for Education Statistics)","archived":false,"fork":false,"pushed_at":"2014-10-04T21:20:46.000Z","size":208,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T20:14:56.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-20T19:27:55.000Z","updated_at":"2014-09-26T15:44:21.000Z","dependencies_parsed_at":"2022-07-31T04:47:54.050Z","dependency_job_id":null,"html_url":"https://github.com/marks/nces-school-data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marks%2Fnces-school-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marks%2Fnces-school-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marks%2Fnces-school-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marks%2Fnces-school-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marks","download_url":"https://codeload.github.com/marks/nces-school-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704572,"owners_count":20982298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T09:34:55.633Z","updated_at":"2025-04-07T18:16:26.611Z","avatar_url":"https://github.com/marks.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"nces-data\n=========\n\nLocal Quick Start\n-----------------\n1. Tweak variables in `config/app.yml` and `config/mongoid.yml`\n2. Run `bundle install`\n3. Run `bundle exec rake download_and_insert:schools`\n4. Run `bundle exec rake download_and_insert:school_districts`\n5. Run `bundle exec rake download_and_insert:school_district_finances`\n6. Your specificed MongoDB instance should have three collections full of your data -- one for each take task.\n7. To start the web server to access API endpoints listed below, run `foreman start web`\n\nHeroku Instructions\n-------------------\n*Under development*\n\n1. First things first, follow the 'Local Quick Start' steps\n2. Add MongoHQ add on: `heroku addons:add mongohq`\n3. Run `git commit -am \"initial commit\" \u0026\u0026 git push heroku master` to commit and push this code to Heroku\n4. Run `bundle exec rake mongodb:push_local_to_mongohq` to upload the data you downloaded locally to the remote heroku database\n5. Run `heroku info` and copy and paste the `Web URL` into your web browser of choice.\n\nAPI endpoints\n-------------\nFor each model (currently `School`, `SchoolDistrict`, `SchoolDistrictFinance`) the following endpoints are available (where `MODEL` is the model name and `ID` is a document ID):\n- `/stats.json` returns a JSON array of all document IDs\n- `/MODEL/ids.json` returns a JSON array of all document IDs\n- `/MODEL/first.json` returns a JSON associative array of the first document's data\n- `/MODEL/ID.json` returns a JSON associative array of the first document's data\n- `/MODEL/by_primary_key.json?id=PRIMARY_KEY_ID` returns an array of JSON associative arrays of the matches.\n - for example, `/School/by_primary_key.json?id=010000201670` does a School.where(:NCESSCH =\u003e \"010000201670\") query. The primary key is defined by the model's `important_header_key` method.\n- `/MODEL/all.csv` sends a CSV file to the client with all documents' data\n\nNotes\n-----\n- Used `(Model.first.as_json.keys - [\"_id\",\"c_at\",\"u_at\"]).each{|f| puts \"field :#{f}, :type =\u003e String\"}` from `irb` to get list of fields for lib/models/*.rb` files -- this was essential getting `.to_csv` to work\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarks%2Fnces-school-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarks%2Fnces-school-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarks%2Fnces-school-data/lists"}