Giter Club home page Giter Club logo

alphagov.transactions-explorer's Introduction

Transactions Explorer

Build Status

Generates a static HTML version of the Transactions Explorer.

Prerequisites

This README expects you to have the virtualenv and virtualenvwrapper python packages installed. You can do this with the following command.

pip install virtualenv virtualenvwrapper

Using the app

You need to use a machine that has a web browser installed in order to authenticate with Google. If you're using a GDS machine, this means you should not perform any of these steps in the GDS development VM.

Set up a Python virtualenv, activate it, and then install required packages with pip install -r requirements.txt.

$ cd ~/govuk
$ git clone [email protected]:alphagov/transactions-explorer.git
$ cd transactions-explorer
$ mkvirtualenv transactions-explorer
$ pip install -r requirements.txt

After setting this up for the first time, you just need to run workon transactions-explorer in future.

Fetching data

First, ensure your Cabinet Office email account is authorised to access the Transactions Explorer spreadsheet.

Then:

  • Create a new installed application (of type "Native") in the Google APIs console, with "Drive API" service enabled, download the client_secrets.json file and store it in data/
  • Fetch the data through either of the methods below:
    • Run python fetch_csv.py. This will authenticate against Google in your browser, then download the Transactions Explorer document to data/services.csv. It can be parametrized with the following arguments:
      • --client-secrets: Google API client secrets JSON file (default: data/client_secrets.json)
      • --oauth-tokens: Google API OAuth tokens file (default: data/tokens.dat)
    • Run ./fetch_data.sh script. It will perform the above task, installing the required dependencies and using the default values.

Generating site

  • Generate the site with python create_pages.py. It can be parameterised with the following argument:
  • [alternative] Generate the site with ./build_artefact.sh script. It will run the above command with all the defaults.
  • [optional] symlink the contents of assets/javascripts to output/assets/javascripts for faster feedback than running create_pages each time.
  • run ./serve.sh
  • visit http://localhost:8080.
  • dance.

Testing

Unit tests can be run with ./run_tests.sh.

After generating the site as described above you can test it generated correctly by running nosetests (or nosetests -a feature to skip unit tests).

alphagov.transactions-explorer's People

Contributors

abersager avatar alexmuller avatar annapowellsmith avatar cliffshepp avatar gtrogers avatar jabley avatar jcbashdown avatar mattbostock avatar maxfliri avatar norm avatar phss avatar robyoung avatar roc avatar tombooth avatar

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.