Code Monkey home page Code Monkey logo

kolada's Introduction

Kolada API client

Kolada API client provides access to standardized key performance indicators (KPI) concerning Swedish municipalities and organizational units.

๐Ÿ”— For a detailed API description, please see github.com/Hypergene/kolada.

Getting started

npm install --save kolada

There are two main parts to the API metadata and actual data (see full API documentation).

Initialize

const Kolada = require('kolada');
const kolada = new Kolada();

All methods uses fetch under the hood

kolada.meta.kpi()
  .then(res => res.json())
  .then(json => console.log(json))

If passed "impossible" arguments an exception will be raised (with detailed error messages)

kolada.data.municipalities({ municipality: '1860' })
// Error: when passing municipality or ou you need to pass kpi or year too.

โ„น๏ธ The arguments: municipality, ou, kpi and year can either be strings or an array of strings.

Meta data

KPI(s)

kolada.meta.kpi() // all
kolada.meta.kpi({ id: ['N00945'] })

kolada.meta.kpiGroups() // all
// title search string (automatically uri-encoded)
kolada.meta.kpiGroups({ title: 'kostnad' })

Municipalities

kolada.meta.municipalities()
kolada.meta.municipalities({ id: ['1860'] })
kolada.meta.municipalityGroups()

Organizational Unit (OU)

kolada.meta.ou({ municipality: ['1860'] })

Data

Municipalities

kolada.data.municipalities({ kpi: 'N00945', year: 2008 })
kolada.data.municipalities({ municipality: '1860', year: [2008, 2009] })
kolada.data.municipalities({ municipality: '1860', year: 2009, fromDate: '2015-02-28' })

Organizational Unit (OU)

kolada.data.ou({ kpi: ['N15033'], year: [2007, 2008] });
kolada.data.ou({ ou: 'V15E144001301', kpi: 'N00945', year: 2009 });

See more examples in kitchen-sink.js.

๐Ÿ”— For detailed API documentation, see github.com/Hypergene/kolada.

Development

git clone https://github.com/buren/kolada
cd kolada

Install dependencies

npm install

Run kitchen sink (a.k.a the quasi test suite)

npm run kitchen-sink

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/buren/kolada.

License

The gem is available as open source under the terms of the MIT License.

kolada's People

Contributors

buren avatar dependabot-preview[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.