GithubHelp home page GithubHelp logo

django-vosi's Introduction

Django vosi package

Implementation of IVOA Support Interfaces as resuable Django app

Build Status Coverage Status http://img.shields.io/badge/license-APACHE-blue.svg?style=flat

This package implements the IVOA Support Interfaces. It was intially created for being used with the django-prov_vo package together with a web application like provenance-rave, but can be used with any other package/webapp implementing a Data Access Layer (DAL) interface for the virtual observatory (VO). Inspired by Daiquiri's VOSI implementation for TAP (django-daiquiri).

NOTE: This package does not (yet) include all VOSI features. Created using the VOSI specification version 1.1.

Installation

  • Download the package:

    git clone https://github.com/github/kristinriebe/django-vosi/
    
  • Package the prov_vo app:

    cd django-vosi
    python setup.py sdist
    
  • Switch to your main web application (or create it now with django-admin startproject <my_web_app>):

    cd ..
    cd <my_web_app>
    

    An example for a django project using this package is available at https://github.com/kristinriebe/provenance-rave

  • Install the vosi app (e.g. inside your virtual environment) using pip:

    pip install ../django-vosi/dist/django-vosi-0.1.tar.gz
    

    Alternatively, you can also add the following lines in your projects's settings.py:

    import sys
    sys.path.append('../django-vosi/')
    
  • Add vosi to your INSTALLED_APPS setting in settings.py like this:

    INSTALLED_APPS = [
        ...
        'vosi',
    ]
    
  • You could add the vosi URLconf to your project's urls.py like this:

    url(r'^vosi/', include('vosi.urls')),
    

    But most likely you need to copy the VOSI url's to the urls.py file of your main project/package providing the data access layer interface:

    from django.conf.urls import url, include
    import vosi.urls
    
    urlpatterns = [
      ...
      url(r'^availability/$', vosi.views.availability, name='vosi_availability'),
      url(r'^capabilities/$', vosi.views.capabilities, name='vosi_capabilities'),
    ]
    

    This is necessary, because the capabilities resource must be a sibling to the DAL resource, see Section 2 of DALI specification.

  • Install the requirements of this application, e.g. in a virtual environment:

    virtualenv -p /usr/bin/python2.7 env
    source env/bin/activate
    
    cd django-vosi
    pip install -r requirements.txt
    
  • Run python manage.py migrate to update the database and create the VOSI database tables.

  • Inser the VOSI data specific for your web application, see django-prov_vo for an example.

Testing

  • This django application can be tested standalone, outside the project. First create a virtual environment and install the required python (2.7) packages:

    virtualenv -p /usr/bin/python2.7 env
    source env/bin/activate
    
    pip install -r requirements.txt
    
  • Now switch to vosi and run:

    cd vosi
    python runtests.py
    
  • This runs all the tests stored in tests.

TODO

  • Implement tables endpoint as well
  • Improve renderer (use lxml?)
  • Include more features (missing attributes for availability)
  • Write more tests
  • Use admin interface to adjust availability options and set availability

django-vosi's People

Contributors

kristinriebe avatar

Watchers

James Cloos avatar  avatar

Forkers

bruot

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.