Skip to main content

Heliophysics API

Project description

Installation

Standard Method

Operating system command line:

pip install hapiclient

Fail-safe

Python command line:

import os
print(os.popen("pip install hapiclient").read())

The above executes and displays the output of the operating system command pip install hapiclient using the shell environment associated with that installation of Python.

This method addresses a problem often encountered when attempting to use pip packages in Anaconda. To use a pip package in Anaconda, one must use the version of pip installed with Anaconda (it is usually under a subdirectory with the name anaconda/) as opposed to the one installed with the operating system. To see the location of pip used in a given Python session, enter print(os.popen("which pip").read()).

Documentation

See the help string by entering help(hapi) on the Python command line.

All of the features are extensively demonstrated in hapi_demo.ipynb.

Demo

The hapi_demo.py shows example usage of this package.

Jypyter Notebook

To execute the demo in a Jupyter Notebook, execute

curl -L -O https://rawgithub.com/hapi-server/client-python/master/hapi_demo.ipynb
jupyter-notebook hapi_demo.ipynb

(A web page should open. To run code in a cell after editng it, enter SHIFT+ENTER.)

Python Command Line

The following Python commands downloads and executes the demo.

Python 2

# D/L and save hapi_demo.py
import urllib
url = 'https://github.com/hapi-server/client-python/raw/master/hapi_demo.py'
urllib.urlretrieve(url,'hapi_demo.py')
exec(open("hapi_demo.py").read(), globals())

Python 3

# D/L and save hapi_demo.py
import urllib.request
url = 'https://github.com/hapi-server/client-python/raw/master/hapi_demo.py'
urllib.request.urlretrieve(url,'hapi_demo.py')
exec(open("hapi_demo.py").read(), globals())

Development

git clone https://github.com/hapi-server/client-python
cd client-python; python setup.py develop

(The command python setup.py develop creates symlinks so that the local package is used instead of an installed package.)

Note that the scripts are written to match syntax/capabilities/interface of the HAPI MATLAB client.

Contact

Submit bug reports and feature requests on the repository issue tracker.

Bob Weigel rweigel@gmu.edu

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hapiclient-0.0.6.tar.gz (16.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page