0.2.2 • Published 8 years ago

osmcal v0.2.2

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

osmcal

Library for parsing OpenStreetMap Calendar from (https://wiki.openstreetmap.org)

Summary

OSMCAL ia be a small library, that allowes to parse the wiki openstreetmap calendar and converts it to a more machine readable JSON format.

In Future there can be more features like:

  • parsing geocoordinates from wiki
  • -> add your wishes to github

Status

There is a very rudimentary parser i have written for the weeklyosm team, so that they can easily publish the calendar. This version was implemented with regex, and i have started to create a clean version based on PEGJS as a parser (try to get more compatibility with the different data, given in the wiki).

The library is not ready for use yet. In the meantime have a look at: https://thefive.sabic.uberspace.de/calendar/preview.

For OSMCAL i have used pegjs to parse the wiki page, and generate the Events.

The V0.2.0 allowes you to use the JSON converter in a npm module.

Software Build Status

Master:develop:
Build StatusBuild Status
codecov.iocodecov.io

Timeline for code coverage on development branch: (Every dot is a month) codecov.io

Timeline for code coverage on master branch: (Every dot is a month) codecov.io

How to install

use

npm install osmcal

To install the module. The API is instable at the moment (April 2015), but this will change in near future.

Support the Developer

Please put all remarks, suggestions, bugs in the github issue tracker.

API to use

The API is very simple for now:

var parse = require('osmcal');

let jsonevents = parse.calendarToJSON();

This results in

{
  "version": "0.1",
  "generator": "TheFive Wiki Calendar Parser",
  "time": "2015-12-06T00:00:00.000Z",
  "filter": {},
  "copyright": "The data is taken from http://wiki.openstreetmap.org/wiki/Template:Calendar and follows its license rules.",
  "events": [
    {
      "country": "Spain",
      "countryLink": "https://wiki.openstreetmap.org/wiki/Spain",
      "town": "Zaragoza",
      "townLink": "https://wiki.openstreetmap.org/wiki/Zaragoza",
      "desc": "Curso de OpenStreetMap",
      "descLink": [
        "http://osluz.unizar.es/content/curso-de-openstreetmap"
      ],
      "type": "speaking",
      "flags": [
        "Spain",
        "Zaragoza"
      ],
      "big": false,
      "bold": false,
      "startDate": "2015-11-16",
      "endDate": "2015-11-30"
    },
  ],
  "errors": []
}

In case of any error while parsing, the whole wiki string and the pegjs Error message is added to the error array.