0.9.1 • Published 2 years ago

@i2i3i/open-data-in-sapporo v0.9.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Open-Data in Sapporo

Sapporo city, Hokkaido opens public data for developing Smart City Sapporo.

Data-Smart City Sapporo page makes those data available to the public.

I have made a SDK to access easily the data even though api endpoints are already accessible in the page above.

One remarkable point is that I have curated api endpoints and params using crawler. If you are interested in that method, please refer to the file.

Usage

  • Install
npm i @i2i3i/open-data-in-sapporo
  • Group, Resource id and Params

This Json file lists up all data which were curated by the abovementioned method. Next example will show you how to use those data.

  • Examples

    This example indicates Group statistics_sapporo, Resource id 821c83f6-492b-44db-bbde-fca9d2774645 with several options.

import odisap from '@i2i3i/open-data-in-sapporo';

// With no optinos
const func1 = async () => {
  const res = await odisap(
    'statistics_sapporo',
    '821c83f6-492b-44db-bbde-fca9d2774645'
  );

  console.log('result', res.result);
  console.log('records', res.result.records);
};

await func1();

// With options (limit, offset)
const func2 = async () => {
  const res = await odisap(
    'statistics_sapporo',
    '821c83f6-492b-44db-bbde-fca9d2774645',
    { limit: 5, offset: 3 }
  );

  console.log('result', res.result);
  console.log('records', res.result.records);
};

await func2();

// With options (params)
const func3 = async () => {
  const res = await odisap(
    'statistics_sapporo',
    '821c83f6-492b-44db-bbde-fca9d2774645',
    {
      params: { '年 度': '2008年度' },
    }
  );

  console.log('result', res.result);
  console.log('records', res.result.records);
};

await func3();

Properties

Refer to the docs.

Notice

The data list still has some space to develop. So there are a few attributes which haven't been implemented yet in the current version. Future function will apply those developing parts.

0.9.1

2 years ago

0.9.0

2 years ago