Skip to content

A set of Python functions that provides data read/write access to an ODM2 database by leveraging SQLAlchemy.

License

Notifications You must be signed in to change notification settings

ODM2/ODM2PythonAPI

Repository files navigation

ODM2 Python API

Build Status Build status

A Python-based application programmer's interface for the Observations Data Model 2 (ODM2).

List of current and planned functions included in the API

Documentation

For the latest documentation of the ODM2 Python API, see http://odm2.github.io/ODM2PythonAPI/

Installation

The easiest and most reliable way to install the ODM2 Python API (odm2api) is using the Conda package management system via either Anaconda or Miniconda. To start using conda (if it's not your system default), add conda to the PATH; on MacOSX and Linux, it's something like export PATH=$HOME/miniconda/bin:$PATH, but the exact path may vary.

To activate a conda environment, say, "myenv":

activate myenv  # On Windows
source activate myenv  # On MacOSX or Linux

Note: odm2api currently is only tested on Python 2.7. Some changes have been made to support Python 3.x, but they haven't been tested thoroughly.

Latest release, from conda-forge anaconda.org channel

The latest odm2api release is available on the conda-forge anaconda.org channel for all major OS paltforms (linux, OSX, win32/win64). To install it on an existing conda environment:

conda install -c conda-forge odm2api

All dependencies are installed, including Pandas and its dependencies (numpy, etc).

To create a new environment "myenv" with the odm2api package:

conda create -n myenv -c conda-forge python=2.7 odm2api

Installing the development version from the development branch on github

Note: We follow the Gitflow workflow for development.

  1. Download both requirements.txt and requirements-dev.txt.

    wget https://raw.githubusercontent.com/ODM2/ODM2PythonAPI/master/requirements.txt
    wget https://raw.githubusercontent.com/ODM2/ODM2PythonAPI/master/requirements-dev.txt
  2. Create conda environment odm2api_dev from the two requirements* text files.

    conda create -n odm2api_dev -c conda-forge python=2.7 --file requirements.txt --file requirements-dev.txt
  3. Activate conda environment.

    • MacOSX/Linux:
    source activate odm2api_dev
    • Windows:
    activate odm2api_dev
    
  4. Install the latest commit from the development branch

    pip install git+https://github.com/ODM2/ODM2PythonAPI.git@development#egg=odm2api

Credits

This work was supported by National Science Foundation Grants EAR-1224638 and ACI-1339834. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.