The contracts API is a Flask app that provides a RESTful API for managing business processes around contracts
The contracts-api is in its very early stages. We are still in the process of figuring out both the structure of the API (what should the endpoints be? How should the underlying data structures fit together?), and the data model (what are the core components of a contract?).
The contract api is a project of the 2015 Pittsburgh Code for America fellowship team
The contracts API is a Flask app. It uses Postgres for a database, and the "Kindergarten stack" of peewee and marshmallow for ORM and serialization.
It is highly recommended that you use use virtualenv (and virtualenvwrapper for convenience). For a how-to on getting set up, please consult this howto. It is recommended that you use postgres.app to handle your Postgres (assuming you are developing on OSX).
Use the following commands to bootstrap your environment:
# clone the repo
git clone https://github.com/codeforamerica/contracts-api
# change into the repo directory
cd contracts-api
# install python dependencies
pip install -r requirements/dev.txt
# bring the database up to speed
python manage.py migrate_up
# run the server
python manage.py server
As the app expands in functionality, this section will be updated.
In order to run the tests, you will need to create a test database. You can follow the same procedures outlined in the install section. By default, the database should be named contracts_api_test
:
psql
create database test_contracts_api;
Tests are located in the contracts_api_test
directory. To run the tests, run
PYTHONPATH=. nosetests contracts_api_test/
from inside the root directory. For more coverage information, run
PYTHONPATH=. nosetests contracts_api_test/ -v --with-coverage --cover-package=contracts_api --cover-erase
See LICENCE.md.