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 details)

Uploaded Source

File details

Details for the file hapiclient-0.0.6.tar.gz.

File metadata

  • Download URL: hapiclient-0.0.6.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for hapiclient-0.0.6.tar.gz
Algorithm Hash digest
SHA256 e5e619c156f9ebedaa7892ca69ad1eef51f188dc8d283f8252dc6135c3d1af0c
MD5 a7878ce76c48c5452e5f2cf39162b6e5
BLAKE2b-256 17fce0481c52cd3c0219616d02c99d5bb240266ef587b665e5ca2c3fb09c5418

See more details on using hashes here.

Supported by

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