GithubHelp home page GithubHelp logo

danesparza / pollen Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 356 KB

:sunflower: AWS Lambda based API service to get pollen forecast for a given zipcode

License: MIT License

Go 100.00%
pollen api aws-lambda service aws-xray handler

pollen's Introduction

pollen CircleCI

AWS Lambda based API service to get pollen data forecast for a given zipcode. It's designed to attempt to get pollen data from 3 sources in parallel and return the data from the service that responds first. Instrumented with AWS x-ray.

Quick start

To use this labmda handler, grab the pollen_handler.zip from the latest release and create a lambda function in your AWS account.

When creating the function on AWS ... in the Function code section be sure to upload the pollen_handler.zip, select the 'Go' runtime, and select 'pollen' as the handler name: Screenshot of lambda creation in AWS console

Testing the service

To test the service, create a simple test event for your Lambda function. The event should include the zipcode you want to get pollen data for:

{
  "zipcode": "30019"
}

You should get a nice JSON response that looks like this:

{
  "location": "DACULA, GA",
  "zip": "30019",
  "predominant_pollen": "Oak, Birch and Sycamore.",
  "startdate": "2019-04-18T13:00:33.548528198Z",
  "data": [
    10.2,
    1,
    7.9,
    10
  ],
  "service": "Nasacort",
  "version": "1.0.4.f3092bea655df439b7b3eaa3cfe9b628dec03cff"
}

What does the data mean?

Parameter Description
location The detected city/state location for the report
zip The zipcode that was passed to the Lambda function
predominant_pollen The predominant pollen currently detected in the area
startdate The date/time for the report
data An array of floats. This indicates the pollen indices by day, starting with today. In the case of the example above, today's pollen index is 10.2, tomorrow's pollen index is 1, the next day's index is 7.9, etc.
service The reporting service
version The version of the pollen Lambda service being used

How can use it outside of AWS?

Simple! Just use AWS API Gateway to setup a REST API that calls your new Lambda function.

AWS X-ray?

Yep -- the service is instrumented with AWS X-ray, so you can get an idea of runtime performance. Just navigate to X-Ray in your console to check it out.

pollen's People

Contributors

danesparza avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.