REST API for serving NHS ODS data
Python Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Docker
assets
docs
openods
sql
tests
.gitignore
.travis.yml
Dockerfile
LICENSE.md
Pipfile
Pipfile.lock
Procfile
README.md
RELEASE.md
entrypoint.sh
requirements-dev.txt
requirements.txt
run.py
runtime.txt

README.md

OpenODS

Continuous Integration

Builds are handled by Travis CI at https://travis-ci.org/open-ods/open-ods

master branch (stable releases) Build Status

develop branch (development) Build Status

Chat with us on Gitter! https://gitter.im/open-ods/open-ods

Latest Data File

The current Postgres database dump is openods_015_sep17_001.dump and can be downloaded from:

https://s3.amazonaws.com/openods-assets/database_backups/openods_015_sep17_001.dump

The Code

Pre-requisites

Necessary

  • Python 3.6+
  • Virtualenv pip install -g virtualenv
  • PostgreSQL (Postgres.app is simple for development on OSX)

Optional

Getting Started

  1. Clone this repository to your local machine

    $ git clone https://github.com/open-ods/open-ods.git
  2. In the terminal, navigate to the newly cloned repository on your machine

    $ cd ~/Source/open-ods
  3. Create a Python3 Virtualenv

    $ virtualenv -p python3 openods

    Check that python3 is installed properly by running python and checking the version number displayed.

    $ python --version
    Python 3.6.1
  4. Activate the virtualenv

    $ source env/bin/activate
  5. Install libmemcached (for caching using flask-heroku-cacheify)

    On OSX, you can use homebrew to easily install libMemcached

    $ brew install libmemcached

    On CentOS, you can use yum to install libmemcached and zlib

    sudo yum install zlib-devel libmemcached-devel

    If you're using another OS you will have to refer to appropriate instructions for your OS.

  6. Install the project dependencies from the requirements-dev.txt file.

    $ pip install -r requirements-dev.txt

    Note: requirements-dev.txt contains a list of all dependencies including those needed during the development process.

    When deploying to production, you would use the requirements.txt file to install dependencies.

  7. Now follow this guide to import the OpenODS data into your local database instance:

    Importing OpenODS data to your PostgreSQL instance

  8. Assuming all steps have completed successfully, you should be able to test that you can run OpenODS using the built-in Flask development server.

    From the project root, run:

    $ python run.py
    Database URL: postgresql://openods:openods@localhost:5432/openods
    Cache Timeout: 30
    APP Hostname: http://localhost:5000/api
    API Path: /api
    DEBUG: False
    
    * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
    

Using Docker

To get an instance of OpenODS running in Docker, follow this README

Source Data Attribution

Organisation Data Service, Health and Social Care Information Centre, licenced under the Open Government Licence v2.0 - Open Government Licence

More information on the Organisation Data Service can be found on the HSCIC website

License

This project is licensed under GNU GPL v3.

Copyright (c) 2017 Matt Stibbs and Tony Yates

See LICENSE.md.