{"id":13558002,"url":"https://github.com/codeforamerica/cfapi","last_synced_at":"2025-04-03T12:31:29.396Z","repository":{"id":14142635,"uuid":"16848266","full_name":"codeforamerica/cfapi","owner":"codeforamerica","description":"The Code for America API. Tracks and motivates activity and participation across the civic technology movement.","archived":false,"fork":true,"pushed_at":"2021-04-30T17:49:56.000Z","size":1510,"stargazers_count":113,"open_issues_count":59,"forks_count":53,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-11-04T08:39:16.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://codeforamerica.org/api","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"chihacknight/civic-json-worker","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeforamerica.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-14T20:15:58.000Z","updated_at":"2024-04-16T22:41:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/codeforamerica/cfapi","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/codeforamerica%2Fcfapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforamerica%2Fcfapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforamerica%2Fcfapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforamerica%2Fcfapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeforamerica","download_url":"https://codeload.github.com/codeforamerica/cfapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247002356,"owners_count":20867447,"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-08-01T12:04:40.702Z","updated_at":"2025-04-03T12:31:27.589Z","avatar_url":"https://github.com/codeforamerica.png","language":"Python","readme":"[![Stories in Ready](https://badge.waffle.io/codeforamerica/cfapi.png?label=ready\u0026title=Ready)](https://waffle.io/codeforamerica/cfapi)\n[![Build Status](https://travis-ci.org/codeforamerica/cfapi.svg?branch=master)](https://travis-ci.org/codeforamerica/cfapi)\n\n# The Code for America API\n\n### What the CFAPI is\nCode for America has developed this API to track all the activity across the civic technology movement. Our goal is to measure and motivate the movement by recognizing participation. The CFAPI describes an organization's projects, stories, and events.\n\nThe tools that the Brigades and other groups use to do their fine deeds are all different. The CFAPI does the difficult job of being able to track these activities no matter what tools an organization is using. The participants don't need to change their activities to be included.\n\n### How it works\nTo get the information for the CfAPI, Code for America maintains a [list of civic tech organizations](https://github.com/codeforamerica/brigade-information/blob/master/organizations.json) and once an hour checks their activity on Meetup.com, their blog, and their GitHub projects. Other services and support for noncode projects are slowly being added. More technical details [below](https://github.com/codeforamerica/cfapi#installation).\n\n### Projects powered by the CFAPI\n* The Code for America \u003ca href=\"http://codeforamerica.org/brigade\"\u003eBrigade\u003c/a\u003e website\n\u003cbr/\u003e\u003ca href=\"http://codeforamerica.org/brigade\"\u003e\u003cimg src=\"http://i.imgur.com/C96yBLE.png\" width=\"500px\"\u003e\u003c/a\u003e\n\n* The Brigade \u003ca href=\"http://codeforamerica.org/brigade/projects\"\u003eProjects\u003c/a\u003e Page\n\u003cbr/\u003e\u003ca href=\"http://codeforamerica.org/brigade/projects\"\u003e\u003cimg src=\"http://i.imgur.com/Zv2zKvp.png\" width=\"500px\"/\u003e\u003c/a\u003e\n\n* \u003ca href=\"http://www.codeforamerica.org/geeks/civicissues\"\u003eThe Civic Tech Issue Finder\n\u003cbr/\u003e\u003cimg src=\"http://i.imgur.com/9aWV25e.png\" width=\"400px\"/\u003e\u003c/a\u003e\n\n* \u003ca href=\"https://twitter.com/civicissues\"\u003eThe Civic Issue Twitter Bot\n\u003cbr/\u003e\u003cimg src=\"http://i.imgur.com/Du9pLsu.png\" width=\"400px\"/\u003e\u003c/a\u003e\n\n* Lots of different Brigades websites\n\n\n### Example Response\nSee the full documentation at http://codeforamerica.org/api\n\nResponse for `http://codeforamerica.org/api/organizations/Code-for-San-Francisco`\n```\n{\n  \"all_events\": \"http://codeforamerica.org/api/organizations/Code-for-San-Francisco/events\",\n  \"all_issues\": \"http://codeforamerica.org/api/organizations/Code-for-San-Francisco/issues\",\n  \"all_projects\": \"http://codeforamerica.org/api/organizations/Code-for-San-Francisco/projects\",\n  \"all_stories\": \"http://codeforamerica.org/api/organizations/Code-for-San-Francisco/stories\",\n  \"api_url\": \"http://codeforamerica.org/api/organizations/Code-for-San-Francisco\",\n  \"city\": \"San Francisco, CA\",\n  \"current_events\": [\n    {\n      \"api_url\": \"http://codeforamerica.org/api/events/710\",\n      \"created_at\": \"2014-02-26 21:05:21\",\n      \"description\": null,\n      \"end_time\": null,\n      \"event_url\": \"http://www.meetup.com/Code-for-San-Francisco-Civic-Hack-Night/events/193535742/\",\n      \"id\": 710,\n      \"location\": null,\n      \"name\": \"Weekly Civic Hack Night\",\n      \"organization_name\": \"Code for San Francisco\",\n      \"start_time\": \"2014-08-27 18:30:00 -0700\"\n    },\n    ...\n  ],\n  \"current_projects\": [\n    {\n      api_url: \"http://codeforamerica.org/api/projects/122\",\n      categories: null,\n      code_url: \"https://github.com/sfbrigade/localfreeweb.org\",\n      description: \"Front end for the Local Free Web project\",\n      github_details: { ... },\n      id: 122,\n      issues: [ ... ],\n      last_updated: \"Thu, 24 Jul 2014 22:01:17 GMT\",\n      link_url: null,\n      name: \"localfreeweb.org\",\n      organization: {},\n      organization_name: \"Code for San Francisco\",\n      tags: [\"digital access\",\"bus stops\"],\n      type: null,\n      status: \"Official\"\n      commit_status: \"success\"\n    },\n    ...\n  ],\n  \"current_stories\": [\n    {\n      \"api_url\": \"http://codeforamerica.org/api/stories/10\",\n      \"id\": 10,\n      \"link\": \"https://groups.google.com/d/msg/code-for-san-francisco/9OewkHV-D1M/0UW_ye9UXc8J\",\n      \"organization_name\": \"Code for San Francisco\",\n      \"title\": \"Hack Night Project Pick List\",\n      \"type\": \"blog\"\n    },\n    ...\n  ],\n  \"id\" : \"Code-for-San-Francisco\",\n  \"events_url\": \"http://www.meetup.com/Code-for-San-Francisco-Civic-Hack-Night/\",\n  \"last_updated\": 1409087294,\n  \"latitude\": 37.7749,\n  \"longitude\": -122.4194,\n  \"name\": \"Code for San Francisco\",\n  \"past_events\": \"http://codeforamerica.org/api/organizations/Code-for-San-Francisco/past_events\",\n  \"projects_list_url\": \"https://docs.google.com/spreadsheet/pub?key=0ArHmv-6U1drqdDVGZzdiMVlkMnRJLXp2cm1ZTUhMOFE\u0026output=csv\",\n  \"rss\": \"\",\n  \"started_on\": \"2014-07-30\",\n  \"type\": \"Brigade\",\n  \"upcoming_events\": \"http://codeforamerica.org/api/organizations/Code-for-San-Francisco/upcoming_events\",\n  \"website\": \"http://codeforsanfrancisco.org/\"\n}\n```\n\n### History\nThe need for a way to show off good civic tech projects was apparent. Several Brigades had all started working on ways to track their projects. They were working separately on the same idea at the same time. The CFAPI is a generalization of the great work done by:\n\n\u003ca href=\"http://opencityapps.org\"\u003e\u003cimg src=\"http://chihacknight.org/images/sponsors/open-city-sm.jpg\" alt=\"Open City\"\u003e Open City \u003c/a\u003e\n\n\u003ca href=\"http://betanyc.org\"\u003e\u003cimg src=\"http://betanyc.us/images/apple70Gray.png\" alt=\"Beta NYC\"\u003e Beta NYC \u003c/a\u003e\n\n\u003ca href=\"http://www.meetup.com/Code-for-Boston/\"\u003e\u003cimg src=\"http://i.imgur.com/HlsvNQY.png\" alt=\"Code for Boston\"\u003e Code for Boston \u003c/a\u003e\n\n*For the full story behind this API, [read this](https://hackpad.com/Civic.json-planning-meeting-EusFEMPgMio#:h=Chicago's-Open-Gov-Hack-Night-).\n\nThis repository is forked from [Open City's Civic Json Worker](https://github.com/open-city/civic-json-worker)\n\n### Future\nWe hope that this experiment of tracking activity within a community is useful for other groups besides the civic technology movement. We will begin working with other groups to see if an instance of the CfAPI is useful for them.\n\nWe also want to add support for many more services to be included, such as events from Eventbrite. Our goal is for any organization to use any tool to do their work and we will integrate with them.\n\n### How to add your Brigade to the API\n\nSubmit a Pull Request with your brigade's information to the [Brigade Information repository](https://github.com/codeforamerica/brigade-information). Instructions are included in that repo's [README](https://github.com/codeforamerica/brigade-information/blob/master/README.md).\n\n### Civic.json\nTo add extra data about your projects to the CfAPI, include a `civic.json` file in the top level of your repo.\n\nCurrently we accept `status` and `tags` as fields in the civic.json.\n\nAn example civic.json file\n```\n{\n    \"status\": \"Production\",\n    \"tags\": [\"slack\", \"bot\", \"integration\", \"python\", \"flask\", \"glossary\", \"dictionary\"]\n}\n```\n\nThis project could then be easily found by searching the CfAPI like\n[http://codeforamerica.org/api/projects?q=production,slack,bot](http://codeforamerica.org/api/projects?q=production,slack,bot)\n\nThe `civic.json` idea comes from BetaNYC and still has an [active discussion](https://github.com/BetaNYC/civic.json/issues) about its spec.\n\n\n### Civic Tech Issue Finder\nOnce you've got your organization's GitHub projects on the API, all of your groups open GitHub Issues will be seen in the [Civic Tech Issue Finder](http://www.codeforamerica.org/geeks/civicissues). Use the label \"help wanted\" to get the most exposure. More info on that [project's README](https://github.com/codeforamerica/civic-issue-finder#civic-issue-finder).\n\n## Installation\n\nThe CFAPI is built on [Flask](http://flask.pocoo.org/) and Python. The `app.py` file describes the models and routes. The `run_update.py` file runs once an hour and collects all the data about the different Brigades. Both `tests.py` and `run_update_test.py` are automatically run by [Travis-CI](https://travis-ci.org/codeforamerica/cfapi) whenever a new commit is made. The production service lives on Heroku. Please contact [us](https://github.com/codeforamerica/cfapi#contacts) with any questions.\n\n### Development setup\n\n#### Requirements\n\n* PostgreSQL Database - [How To](https://github.com/codeforamerica/howto/blob/master/PostgreSQL.md)\n\n#### Environmental variables\n\n* `DATABASE_URL=[db connection string]` — My local example is `postgres:///cfapi`\n* `GITHUB_TOKEN=[GitHub API token]` — Read about setting that up here: http://developer.github.com/v3/oauth/\n* `MEETUP_KEY=[Meetup API Key]` — Read about setting that up here: https://secure.meetup.com/meetup_api/key/\n\nSet these up in a local `.env` file.\n\n#### Project setup\n\n* Set up a [virtual environment](https://github.com/codeforamerica/howto/blob/master/Python-Virtualenv.md)\n\n* Install the required libraries\n\n```\n$ pip install -r requirements.txt\n```\n\n* Set up a new database\n\n```\ncreatedb cfapi\npython app.py createdb\n```\n\n* Run the updater\n\nThe `run_update.py` script will be run on Heroku once an hour and populate the database. To run locally, try:\n\n```\npython run_update.py\n```\n\nYou can update just one organization if you need by using:\n\n```\npython run_update.py --name \"Beta NYC\"\n```\n\nFor quicker update testing, use a shorter list of orgs by calling run_update.py with the `--test` flag:\n\n```\npython run_update.py --test\n```\n\n* Start the API\n\n```\nenv `cat .env` python app.py runserver\n```\n\n* or use [foreman](http://theforeman.org/) to mimic how the CfAPI runs on Heroku.\n\n```\nforeman start\n```\n\n* Visit `localhost:5000` in your browser to see the results\n```\nhttp://localhost:5000/api/organizations/Code-for-America\n```\n\n### Deployment\n\nDeployment is typically on Heroku. Follow [this tutorial](https://devcenter.heroku.com/articles/getting-started-with-python) for basic information on how to setup the project.\n\n#### Environmental variables\n\nThese must be set:\n\n* `GITHUB_TOKEN`\n* `MEETUP_KEY` (if used)\n\n`DATABASE_URL` will be handled by Heroku.\n\n#### Project setup\n\n* Initialize the database\n\n```\nheroku run bash\npython -c 'from app import db; db.create_all()'\n```\n\n### Tests\n* Set up a new database\n\n```\ncreatedb civic_json_worker_test\npython -c 'from app import db; db.create_all()'\n\ncreatedb peopledbtest\npsql peopledbtest \u003c test/peopledbtest.pgsql\n```\n\n`green -vvv --run-coverage` to run everything at once.\n\n`green test/updater -vvv` to test the run_update process.\n\n`green test/updater -vvv --run-coverage` to test the run_update process with coverage.\n\n`green test/integration -vvv` to test the API.\n\n`green test/integration -vvv --run-coverage` to test the API with code coverage.\n\n\n### Codestyle (PEP8 and co.)\n\nThe project ships with flake8 to track style, perform a flake8 check by calling\n\n`flake8 . --exclude=migrations,test --ignore=E501,E711,E712`\n\n\n\n\n### Migrations\nMigrations are handled through [flask-migrate](https://github.com/miguelgrinberg/Flask-Migrate#flask-migrate)\n\nContacts\n--------\n\n* Andrew Hyder ([ondrae](https://github.com/ondrae))\n* Michal Migurski ([migurski](https://github.com/migurski))\n* Tomas Apodaca ([tmaybe](https://github.com/tmaybe))\n\nContributing\n------------\n\nHere are some ways *you* can contribute:\n\n* by reporting bugs\n* by suggesting new features\n* by translating to a new language\n* by writing or editing documentation\n* by writing code (**no patch is too small**: fix typos, add comments, clean up\n  inconsistent whitespace)\n* by refactoring code\n* by closing [issues][]\n* by reviewing patches\n* [financially][]\n\n[issues]: https://github.com/codeforamerica/cfapi/issues\n[financially]: https://secure.codeforamerica.org/page/contribute\n\n\nSubmitting an Issue\n-------------------\n\nWe use the [GitHub issue tracker][issues] to track bugs and features. Before\nsubmitting a bug report or feature request, check to make sure it hasn't\nalready been submitted. You can indicate support for an existing issue by\nvoting it up. When submitting a bug report, please include a [Gist][] that\nincludes a stack trace and any details that may be necessary to reproduce the\nbug.\n\n[gist]: https://gist.github.com/\n\nSubmitting a Pull Request\n-------------------------\n\n1. Fork the project.\n2. Create a topic branch.\n3. Implement your feature or bug fix.\n4. Write tests!\n5. Run a migration if needed.\n6. Commit and push your changes.\n7. Submit a pull request.\n\n\nCopyright\n---------\n\nCopyright (c) 2015 Code for America.\n","funding_links":[],"categories":["Python","others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeforamerica%2Fcfapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeforamerica%2Fcfapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeforamerica%2Fcfapi/lists"}