Giter VIP home page Giter VIP logo

voyager-clients's Introduction

version-shield downloads-shield docs-build-shield contributors-shield license-shield issues-shield

Voyager

Advisory

โš ๏ธ This library is now archived. Development will continue at phasewalk1/nasa-rs.

Overview

Voyager is a swiss army knife library for the NASA Open APIs. It is designed to bundle all the NASA APIs into a single package. Voyager can be used to gather data from a variety of NASA's endpoints, including: Picture of The Day, Solar Flares, Magnetic Storms, Near Earth Objects etc.

Future versions of voyager will strive to incorporate more endpoints, until all of them are integrated.

Crate Usage

Key Store

First create a .env file at the root of your project and add a variable named "API_KEY" with your API key from NASA as it's value. Make sure to add .env to your gitignore!

Sample progam with voyager_client

    use voyager_client::{donki, timing};
    use voyager_client::response::*;

    use serde_json::Value as JsonValue;

    fn main() {
        // instantiate a base client
        let base = donki::SolarFlare::new();

        // setup range for query params
        let start = String::from("2021-01-01");
        let end = String::from("2022-01-01");

        // query the endpoint
        let res: Response = base.query(start, end).unwrap();

        // manipulating responses..
        let json: JsonValue = res.json().unwrap();
        let bytes_vec: Vec<u8> = res.bytedump().unwrap();
    }

This is a very simple program using voyager_client. We instantiate our base client for the Coronal Mass Ejection endpoint, and setup our timing parameters for our query. Then we pass the start and end dates into the query function. This will return a JSON string in prettyfied format.

Contributing

The entire library can be found in lib.rs, as well as it's documentation. main.rs is a small executable that contains unit-tests for the voyager_client crate. All contributors are welcome! Simply clone this repository and work on a new branch, when you are ready you can open a PR.

The .cargo directory contains a config file that defines some aliases that are handy for test-driven development. In the root directory you can run:

    cargo unit-test

This is a quick way to run all unit tests defined in main.rs.

You can also run:

    cargo doc-test

voyager-clients's People

Contributors

ethgallucci avatar phasewalk1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

voyager-clients's Issues

Neo base client needs 0.2.2 upgrades

I noticed the neo base client still holds the start and end fields in its struct rather than in its query params. Will push these changes today and step up the minor version to 0.2.3. Also going to update the CLI to support 0 argument calls and have it display the help command output upon a 0 argument call.

API Key Config

API Key config files need to be saved to a relative path. Should be /Users/[username]. Solve this by using the users module to grab the username of the user configuring voyager. Save the API key there so it's easily accessible for voyager to read when making queries.

v0.4.0 - Full Rewrite

This a signaling proposal to perform a full rewrite of voyager-clients to bring in more composability. As it stands, the foundation of voyager-clients is not modular enough for developers to add new functionality. By introducing primitive interfaces for OpenAPI clients and their parameters, we can bootstrap a more abstract core API within voyager-clients to allow for maximum flexibility in each clients unique implementation, while also providing a common interface for all clients.

All work is being done here on a downstream fork hosted at phasewalk1/nerva, and this issue will serve as a roadmap for v0.4.0.

  • Create primitive interfaces for clients and parameters. This includes deprecating the treatment of parameters as raw Strings. Instead, we use enums and impl Params on them.
  • Create a prelude module for common re-exports of core components.
  • Use core traits to define and implement every client that NASA's OpenAPIs provide.
  • Write really good documenation!

Clients Status

  • Apod
  • Neo (Feed)
  • Neo (Lookup)
  • Neo (Browse)
  • CME (Donki)
  • GST (Donki)
  • IPS (Donki)
  • FLR (Donki)
  • SEP (Donki)
  • MPC (Donki)
  • RBE (Donki)
  • HSS (Donki)
  • Earth
  • EONET
  • EPIC
  • Exoplanet
  • Genelab
  • Insight
  • Mars Rover Photos
  • NASA Image and Video (NIMVI)
  • TechTransfer
  • Satellite Situation Center
  • SSD/CNEOS
  • Techport
  • TLE

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.