Giter Club home page Giter Club logo

cacheur's Introduction

npm version Dependency Status Build Status Code Climate Test Coverage

About

cacheur is a Node.js CLI tool for caching and transforming API results. It is built with modularity and simplicity in mind.

This application should work stable enough, but is still in heavy development.

Install

Install globally

$ npm install -g cacheur

Usage

Run cacheur

# Within the project dir cacheur can be called directly:
cacheur

# It is possible to manually set the project directory:
cacheur --dir "/C/Dropbox/Software Projekte/cbmodel/caches/"

Set up project

cacheur excepts a project directory that contains config files, containing the specific job settings and a project wide global _setting.yaml file.

Example Jobs

See: /examples

Cache an generic JSON API

http:
  url: https://api.github.com/repos/jquery/jquery/issues
  queryString:
    state: open

This will make a http request to the GitHub API at given url and cache the result. The optional queryString object may contain URL parameters. In this case ?state=open will be appended to the url. The cache will be updated every 10 seconds.

Fetch a CSV file

cacheExpiration: 360
timeout: 180
retryDelay: 30

http:
  url: https://data.cityofnewyork.us/api/views/5b3a-rs48/rows.csv?accessType=DOWNLOAD

This fetches a bigger CSV file from, renews the cache every 360 seconds. It will wait 180 seconds before timeout (this might however be shortened by your network settings). If the request fails, cacheur will retry after 30 seconds.

Cache an SemanticMediaWiki ASK Query

Roadmap

  • Transform data formats (CSV to JSON object)
  • Support JSON Path Queries though an ?q= param

Run cacheur as a linux service

License

MIT © Simon Heimler

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.