Giter Site home page Giter Site logo

onaio / onadata Goto Github PK

View Code? Open in Web Editor NEW
181.0 54.0 131.0 37.91 MB

Collect, Analyze and Share

Home Page: https://ona.io

License: Other

Shell 0.56% Python 81.56% HTML 3.85% Makefile 0.05% CSS 1.28% JavaScript 12.33% Dockerfile 0.01% Less 0.36%

onadata's Introduction

Ona Platform

Collect, Analyze and Share Data!

https://app.codacy.com/project/badge/Grade/68c96351c8b24d5c9062a9c8247142f2

About

Ona is derived from the excellent formhub platform developed by the Sustainable Engineering Lab at Columbia University.

Installation

See the installation documentation.

Docker

Install Docker and Docker Compose.

docker-compose up

# create super user
# -----------------
docker exec -it onadata_web_1 bash

# activate virtual envirenment
source /srv/.virtualenv/bin/activate

python manage.py createsuperuser

It should be accessible via http://localhost:8000. The settings are in onadata/settings/docker.py.

On registration check the console for the activation links, the default email backend is django.core.mail.backends.console.EmailBackend. See Django Docs for details.

Contributing

If you would like to contribute code please read Contributing Code to Ona Data.

Edit top level requirements in the file requirements/base.in. Use
pip-compile to update requirements/base.pip. You will need to update requirements.pip and set lxml==3.6.0, for some unknown reason pip-compile seems to pick a lower version of lxml when openpyxl requires lxml>=3.3.4.
pip-compile --output-file requirements/base.pip requirements/base.in

Copy pre-commit.sh into .git/hooks/pre-commit, it ensures staged python flake8 are in acceptable code style and conventions.

cp pre-commit.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

Security Acknowledgments

We would like to thank the following security researchers for responsibly disclosing security issues:

Name Date Severity Contribution
Danish Tariq 1st April 2018 Medium Users able to create projects in other user accounts

Code Structure

  • api - This app provides the API functionality mostly made up of viewsets
  • logger - This app serves XForms to and receives submissions from ODK Collect and Enketo.
  • viewer - This app provides a csv and xls export of the data stored in logger. This app uses a data dictionary as produced by pyxform. It also provides a map and single survey view.
  • main - This app is the glue that brings logger and viewer together.

Localization

To generate a locale from scratch (ex. Spanish)

django-admin.py makemessages -l es -e py,html,email,txt ;
for app in {main,viewer} ; do cd onadata/apps/${app} && django-admin.py makemessages -d djangojs -l es && cd - ; done

To update PO files

django-admin.py makemessages -a ;
for app in {main,viewer} ; do cd onadata/apps/${app} && django-admin.py makemessages -d djangojs -a && cd - ; done

To compile MO files and update live translations

django-admin.py compilemessages ;
for app in {main,viewer} ; do cd onadata/apps/${app} && django-admin.py compilemessages && cd - ; done

Api Documentation

Generate the API documentation and serve via Django using:

cd docs
make html
python manage.py collectstatic

Generate sphinx docs for new code using autodoc.

Run sphinx in autobuild mode using:

sphinx-autobuild docs docs/_build/html

Requires sphinx-autobuild, install with pip install sphinx-autobuild.

Django Debug Toolbar

  • $ pip install django-debug-toolbar
  • Use/see onadata/settings/debug_toolbar_settings/py
  • Access api endpoint on the browser and use .debug as the format extension e.g /api/v1/projects.debug

Upgrading existing installation to django 1.9+

Requirements

  • Postgres 9.4 or higher
  • xcode-select version 2343 or higher

Upgrading from a pervious Ona setup Ensure you upgrade all your pip requirements using the following command:

pip install -r requirements/base.pip

Fake initial migration of guardian, django_digest, registration. Migrate contenttypes app first.

python manage.py migrate contenttypes
python manage.py migrate --fake-initial django_digest
python manage.py migrate --fake-initial guardian
python manage.py migrate --fake-initial registration
python manage.py migrate

Major django changes affecting Ona * The DATABASES settings key depricates the use of the autocommit setting in the OPTIONS dictionary.

onadata's People

Contributors

amarder avatar antonatem avatar bmarika avatar davisraym avatar denniswambua avatar dorey avatar frankapiyo avatar geoffreymuchai avatar ivermac avatar katembu avatar kelvin-muchiri avatar kipsigei avatar larryweya avatar lincmba avatar mberg avatar mejymejy avatar modilabs-bumblebee avatar modilabs-starscream avatar moshthepitt avatar mrmoje avatar pld avatar prabhasp avatar prajjwol avatar rgaudin avatar royrutto avatar tomcoder avatar ukanga avatar urbanslug avatar wambere avatar winnytroy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onadata's Issues

Basic summary stats Count (API Call)

For any form ability to view the number of submissions by submission date.

Alternatively, be able to pass a parameter of a column name and have it return the frequency of the number of submissions per type.

ie) pass a column called surveyor to return number of surveys done by surveyor or by "district" if that column is passed.

Propose implementing this via the API first as it would allow us to serve basic needs like.

Question - if we do this via pandas does it mean we have to load the data in memory for each field we want to query or can we pass multiple columns in a single api call?

Optionally - we might want to support passing multiple columns to the API and it returning a count for each back as dictionary objects.

Submission count by day summaries by project

In the future, we'll want to be able to view the number of submission counts by day by survey.

This will allow us to create a github like view of form submission counts. We probably want to have run these updates periodically and store them in a summary table.

Remove links on top of page

Remove

  • What is OnaData?
  • How does it work?

We can add back when we have content.

I'll create some content quick for the about page.

Map option now showing up?

I just checked some data and the map option is no longer showing up on forms I know had spatial data before.

Can we check asap into this?

Home page text changes

Change intro text to:

Collect, Analyze and Share Data

Use mobile phones and the web to quickly collect, analyze and share data securely. Whether you are mapping, monitoring or enumerating - OnaData is your trusted solution.

POSTing to the /orgs API endpoint without a name causes a 500

From an API user perspective, a JSON with invalid fields and the error would be perfect. Currently, posting to the same URL with an existing org name give back a json with a key named 'org' and a value 'Organizationmy-organisationalreadyexists.' which is very helpful.

Strategy for deprecating the api function in main.views

To avoid maintaining duplicate functionality, the function api in onadata.apps.main.views should be replaced with an API call.

The list method in onadata.apps.api.viewsets.DataViewSet seems like the appropriate end point.

@ukanga @larryweya what do you think? how can we generate the URL for the API endpoint in the view?

PostgreSQL backup script

As Ona we want to easily backup our database to have copies for testing and to guard against data loss.

Deliverables:

  • add backup script for PostgreSQL
  • maybe refactor or organize similarly to MySQL script (but maybe not)

Implement CSV export without pandas

As ona tech we want minimal dependencies, fast builds, and refactored code.

Deliverables:

  • Reimplement CSV pattern using same pattern as other exports and not using pandas
  • Refactor or abstract any export code as necessary
  • Perhaps create a lib/export project to house export related code

View summary submission counts [UI]

Once in a project page (or current form list) view the number of submissions by day as a bar graph similar to the way github shows commits.

screen shot 2013-11-20 at 1 47 26 pm

Initially we probably want to do submissions by day. Over time we might want to sample by weeks.

On the form summary page, we will provide more advanced views of submission times, including counts of other columns, etc.

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.