<commit_before>Bamboo
======


.. image:: https://secure.travis-ci.org/modilabs/bamboo.png?branch=master
  :target: http://travis-ci.org/modilabs/bamboo

Bamboo is a data analysis web service.
Bamboo is `open source <https://github.com/modilabs/bamboo>`_ software.

Bamboo supports a simple querying language to build calculations
(e.g. student teacher ratio) and aggregations (e.g. average number of students
per district) from datasets. These are updated as new data is received.


Dependencies
------------

* python
* mongodb

for numpy, pandas, and scipy (in requirements.pip):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

on Arch Linux: ``# pacman -S blas lapack gcc-fortran``

on Debian based: ``# apt-get install gfortran libatlas-base-dev``

Installation
------------
    
    ``./scripts/install.sh``

Running the server
------------------

    start mongodb on localhost and standard port

::

    cd bamboo
    python run_server.py

Testing
-------

    install nose testing requirements
    
    ``pip install -r requirements-test.pip``

    run tests

::

    cd bamboo
    ./test.sh

Documentation
-------------

Viewing Documentation
^^^^^^^^^^^^^^^^^^^^^

    The latest docs are available at http://bamboo.io/
    
Building Documentation
^^^^^^^^^^^^^^^^^^^^^^

::

    pip install -r requirements-docs.pip
    cd docs
    make html

Contributing Code
-----------------

To work on the code:

1. fork this github project
2. add tests for your new feature
3. add the code for your new feature
4. ensure all existing tests and your new tests are passing
5. submit a pull request

Example Usage
-------------

On the remote server
^^^^^^^^^^^^^^^^^^^^

    running the example basic commands

    ``./scripts/commands.sh``

    posting a dataset

    ``curl -X POST -d "url=http://formhub.org/mberg/forms/good_eats/data.csv" http://bamboo.io/datasets``

On your local server
^^^^^^^^^^^^^^^^^^^

    start the bamboo server as above, then

    run the example basic commands

    ``./scripts/commands.sh -l``

    make requests from your local server

    ``curl -X POST -d "url=http://formhub.org/mberg/forms/good_eats/data.csv" http://localhost:8080/datasets``<commit_msg>daemon instructions add some $s<commit_after>Bamboo
======


.. image:: https://secure.travis-ci.org/modilabs/bamboo.png?branch=master
  :target: http://travis-ci.org/modilabs/bamboo

Bamboo is a data analysis web service.
Bamboo is `open source <https://github.com/modilabs/bamboo>`_ software.

Bamboo supports a simple querying language to build calculations
(e.g. student teacher ratio) and aggregations (e.g. average number of students
per district) from datasets. These are updated as new data is received.


Dependencies
------------

* python
* mongodb

for numpy, pandas, and scipy (in requirements.pip):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

on Arch Linux: ``# pacman -S blas lapack gcc-fortran``

on Debian based: ``# apt-get install gfortran libatlas-base-dev``

Installation
------------
    
    ``$ ./scripts/install.sh``

Running the server
------------------

    start mongodb on localhost and standard port

::

    $ cd bamboo
    $ python run_server.py

Running the server as a daemon

------------------------------

    start mongodb on localhost and standard port

    1. create a user named 'bamboo', with home directory ``/home/bamboo``
    2. create a virtualenv using virtualenvwrapper called 'bamboo'
    3. place the bamboo root directory in ``/var/www/bamboo/current``

    start the daemon using:

    ``$ /var/www/bamboo/current/scripts/bamboo.sh start``

    stop the daemon using:

    ``$ /var/www/bamboo/current/scripts/bamboo.sh stop``


Testing
-------

    install nose testing requirements
    
    ``$ pip install -r requirements-test.pip``

    run tests

::

    $ cd bamboo
    $ ./test.sh

Documentation
-------------

Viewing Documentation
^^^^^^^^^^^^^^^^^^^^^

    The latest docs are available at http://bamboo.io/
    
Building Documentation
^^^^^^^^^^^^^^^^^^^^^^

::

    $ pip install -r requirements-docs.pip
    $ cd docs
    $ make html

Contributing Code
-----------------

To work on the code:

1. fork this github project
2. add tests for your new feature
3. add the code for your new feature
4. ensure all existing tests and your new tests are passing
5. submit a pull request

Example Usage
-------------

On the remote server
^^^^^^^^^^^^^^^^^^^^

    running the example basic commands

    ``$ ./scripts/commands.sh``

    posting a dataset

    ``$ curl -X POST -d "url=http://formhub.org/mberg/forms/good_eats/data.csv" http://bamboo.io/datasets``

On your local server
^^^^^^^^^^^^^^^^^^^

    start the bamboo server as above, then

    run the example basic commands

    ``$ ./scripts/commands.sh -l``

    make requests from your local server

    ``$ curl -X POST -d "url=http://formhub.org/mberg/forms/good_eats/data.csv" http://localhost:8080/datasets``
{'fraction_non_alphanumeric': 0.18680653621141818, 'fraction_numerical': 0.004236433326608836, 'mean_word_length': 2.796324655436447, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, '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': '2578076', 'n_tokens_mistral': 1559, 'n_tokens_neox': 1439, 'n_words': 492}