<commit_before>H₂O Really?
===========

http://h2o-really.co.uk

H₂O Really? aims to set up a very basic monitoring database for water quality.
Data can be captured by anyone, concerning any water quality parameter, and is
available to anyone (i.e. this is an open data project).

Contributing
------------

If you want to help out:

* Check out this repo
* Make a virtualenv (e.g. `mkvirtualenv h2o_really`)
* `pip install requirements.txt`
* Set up PostGIS with hstore

  Outside your virtual environment, if you haven't ever installed GDAL before:

        sudo pip install numpy
        brew update
        brew install gdal


  For those on Mac OS X, we recommend using `Postgres.app`. In order to enable
  the spatial element, simply create a database (let’s call it h2o\_really) and then
  enable the spatial element:

        createdb -h localhost h2o_really && psql -h localhost h2o_really
        h2o_really=# CREATE EXTENSION postgis;
  
  Then you need the hstore extension:

        h2o_really=# CREATE EXTENSION hstore;
  
  In theory, that’s it...

  Note that we do -h localhost because the Postgres.app is not using the normal
  sockets approach, rather it binds to 0.0.0.0 (or 127.0.0.1 by default I
  think) on port 5432. If you’re using linux then probably you don’t need that
  bit.
* `./manage.py syncdb`
* `./manage.py migrate`
* Add/fix/commit stuff on a branch
* Submit a pull request

Load initial data
-----------------

With your server running, go to the admin site and add a License with the following information:
* name: OGL
* URL: http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/
* version: 2

With that added, you can run a script to load the initial data sets, eg:

    python scripts/load_gqahi_nutrients.py data/GQAHI_Nutrients/nitrate\ GQA\ grades\ 2009\ \(Wales\).csv --nutrient N

and likewise for the three other CSV files in the data directory.

Browse the API
--------------
After loading some data, you should be able to browse the API at, e.g.:

http://localhost:8000/api/v1/observations/measurements/

See `openwater/urls.py` and `observations/api/urls.py` for more information.<commit_msg>Stupid markdown not linkifying localhost.<commit_after>H₂O Really?
===========

http://h2o-really.co.uk

H₂O Really? aims to set up a very basic monitoring database for water quality.
Data can be captured by anyone, concerning any water quality parameter, and is
available to anyone (i.e. this is an open data project).

Contributing
------------

If you want to help out:

* Check out this repo
* Make a virtualenv (e.g. `mkvirtualenv h2o_really`)
* `pip install requirements.txt`
* Set up PostGIS with hstore

  Outside your virtual environment, if you haven't ever installed GDAL before:

        sudo pip install numpy
        brew update
        brew install gdal


  For those on Mac OS X, we recommend using `Postgres.app`. In order to enable
  the spatial element, simply create a database (let’s call it h2o\_really) and then
  enable the spatial element:

        createdb -h localhost h2o_really && psql -h localhost h2o_really
        h2o_really=# CREATE EXTENSION postgis;
  
  Then you need the hstore extension:

        h2o_really=# CREATE EXTENSION hstore;
  
  In theory, that’s it...

  Note that we do -h localhost because the Postgres.app is not using the normal
  sockets approach, rather it binds to 0.0.0.0 (or 127.0.0.1 by default I
  think) on port 5432. If you’re using linux then probably you don’t need that
  bit.
* `./manage.py syncdb`
* `./manage.py migrate`
* Add/fix/commit stuff on a branch
* Submit a pull request

Load initial data
-----------------

With your server running, go to the admin site and add a License with the following information:
* name: OGL
* URL: http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/
* version: 2

With that added, you can run a script to load the initial data sets, eg:

    python scripts/load_gqahi_nutrients.py data/GQAHI_Nutrients/nitrate\ GQA\ grades\ 2009\ \(Wales\).csv --nutrient N

and likewise for the three other CSV files in the data directory.

Browse the API
--------------
After loading some data, you should be able to browse the API at, e.g.:

http://1172.16.58.3:8000/api/v1/observations/measurements/

See `openwater/urls.py` and `observations/api/urls.py` for more information.
{'fraction_non_alphanumeric': 0.09832299563519412, 'fraction_numerical': 0.01677004364805881, 'mean_word_length': 3.166507177033493, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 5, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2782110', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1313, 'n_words': 569}