client-python

Python client for HAPI

https://github.com/hapi-server/client-python

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.4%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

Python client for HAPI

Basic Info
  • Host: GitHub
  • Owner: hapi-server
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: master
  • Size: 734 KB
Statistics
  • Stars: 16
  • Watchers: 7
  • Forks: 10
  • Open Issues: 24
  • Releases: 3
Created almost 9 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License Code of conduct Citation Zenodo

README.md

DOI Build Status

HAPI Client for Python

Basic usage examples for various HAPI servers are given in hapi_demo.py and the Examples section of a Jupyter Notebook hosted on Google Colab: Open In Colab.

Installation

```bash pip install hapiclient --upgrade

or

pip install 'git+https://github.com/hapi-server/client-python' --upgrade ```

The optional hapiplot package provides basic preview plotting capabilities of data from a HAPI server. The Plotting section of the hapiclient Jupyter Notebook shows how to plot the output of hapiclient using many other plotting libraries.

To install hapiplot, use

```bash python -m pip install hapiplot --upgrade

or

python -m pip install 'git+https://github.com/hapi-server/plot-python' --upgrade ```

See the Appendix for a fail-safe installation method.

Basic Example

```python

Get Dst index from CDAWeb HAPI server

from hapiclient import hapi

See http://hapi-server.org/servers/ for a list of

other HAPI servers and datasets.

server = 'https://cdaweb.gsfc.nasa.gov/hapi' dataset = 'OMNI2H0MRG1HR' start = '2003-09-01T00:00:00' stop = '2003-12-01T00:00:00' parameters = 'DST1800' opts = {'logging': True}

Get data

data, meta = hapi(server, dataset, parameters, start, stop, **opts) print(meta) print(data)

Plot all parameters

from hapiplot import hapiplot hapiplot(data, meta) ```

Documentation

Basic usage examples for various HAPI servers are given in hapi_demo.py and the Examples section of a Jupyter Notebook hosted on Google Colab.

See http://hapi-server.org/servers/ for a list of HAPI servers and datasets.

All of the features are extensively demonstrated in hapi_demo.ipynb, a Jupyter Notebook that can be viewed an executed on Google Colab.

Metadata Model

See also the examples in the Metadata Model section of the hapiclient Jupyter Notebook.

The HAPI client metadata model is intentionally minimal and closely follows that of the HAPI metadata model. We expect that another library will be developed that allows high-level search and grouping of information from HAPI servers. See also issue #106.

Data Model and Time Format

See also the examples in the Data Model section of the hapiclient Jupyter Notebook. The examples include

  1. Fast and well-tested conversion from ISO 8601 timestamp strings to Python datetime objects
  2. Putting the content of data in a Pandas DataFrame object
  3. Creating an Astropy NDArray

A request for data of the form data, meta = hapi(server, dataset, parameters, start, stop)

returns the Numpy N-D array data and a Python dictionary meta from a HAPI-compliant data server server. The structure of data and meta mirrors the structure of a response from a HAPI server.

The HAPI client data model is intentionally basic. There is an ongoing discussion of a data model for Heliophysics data among the PyHC community. When this data model is complete, a function that converts data and meta to that data model will be included in the hapiclient package.

Development

bash git clone https://github.com/hapi-server/client-python cd client-python; python -m pip install -e .

or, create an isolated Anaconda installation (downloads and installs latest Miniconda3) using

``` bash make install PYTHON=python3.6

Execute command displayed to activate isolated environment

```

The command pip install -e . creates symlinks so that the local package is used instead of an installed package. You may need to execute python -m pip uninstall hapiclient to ensure the local package is used. To check the version installed, use python -m pip list | grep hapiclient.

To run tests before a commit, execute

bash make repository-test

To run an individual unit test in a Python session, use, e.g.,

python from hapiclient.test.test_hapi import test_reader_short test_reader_short()

Contact

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

Owner

  • Name: HAPI
  • Login: hapi-server
  • Kind: organization

Heliophysics Application Programmer’s Interface (HAPI) specification for a set of services to enable access to data and metadata.

Citation (CITATION.cff)

cff-version: 0.2.1
message: "If you use this software, please cite it as below."
authors:
  - family-names: Robert S.
    given-names: Weigel
    orcid: https://orcid.org/0000-0002-9521-5228
title: hapi-server/client-python: 
version: v0.2.1
date-released: 2021-10-06

GitHub Events

Total
  • Issues event: 12
  • Watch event: 6
  • Delete event: 10
  • Issue comment event: 8
  • Push event: 7
  • Pull request event: 6
  • Create event: 4
Last Year
  • Issues event: 12
  • Watch event: 6
  • Delete event: 10
  • Issue comment event: 8
  • Push event: 7
  • Pull request event: 6
  • Create event: 4

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 7
  • Total pull requests: 2
  • Average time to close issues: 6 months
  • Average time to close pull requests: 2 minutes
  • Total issue authors: 4
  • Total pull request authors: 1
  • Average comments per issue: 1.29
  • Average comments per pull request: 0.5
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 6
  • Pull requests: 2
  • Average time to close issues: 11 days
  • Average time to close pull requests: 2 minutes
  • Issue authors: 3
  • Pull request authors: 1
  • Average comments per issue: 0.67
  • Average comments per pull request: 0.5
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • rweigel (6)
  • sapols (1)
  • dstansby (1)
  • jameswilburlewis (1)
Pull Request Authors
  • rweigel (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

setup.py pypi
  • isodate >=0.6.0