go-data-gov-gr-sdk

command module
v0.0.0-...-bcb8294 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

Codacy Badge codebeat badge Fluent Go Testing Quality Gate Status codecov Go Report Card GoDoc

go-data-gov-gr-sdk

A Go based SDK to access the public data provided by the Greek Government and are available at https://www.data.gov.gr/

Quick Start

Get your API Token

Submit the form found here You will receive by email an API token. You will use it to access the data in the example below

Add the SDK as a dependency to your project

go get github.com/ppapapetrou76/go-data-gov-gr-sdk

or if you are using go modules ( recommended )

go mod download github.com/ppapapetrou76/go-data-gov-gr-sdk

Implement a client to read some data
package main

import (
	"fmt"
	"os"
	"time"

	"github.com/ppapapetrou76/go-data-gov-gr-sdk/api"
	"github.com/ppapapetrou76/go-data-gov-gr-sdk/pkg/vaccination"
)

func main() {
	// Fetches the vaccination data for the last 6 days for all areas
	client := api.NewClient("<YOUR_API_TOKEN_HERE>")
	vaccinationData, err := vaccination.Get(client,
		api.NewDefaultGetParams(api.SetDateFrom(time.Now().Add(-fiveDays))),
	)
	if err != nil {
		panic(err)
	}
	// Filter by a specific region
	for _, d := range vaccinationData.FilterByArea("ΘΕΣΣΑΛΟΝΙΚΗΣ") {
		fmt.Fprintf(os.Stdout, "Area:%s, Vaccinations on %v:%d\n", d.Area, d.ReferenceDate, d.DayTotal)
	}
}

Implemented endpoints

To be implemented soon

  • Business and Economy (Small businesses, industry, imports, exports and trade)
  • Crime and Justice (Courts, police, prison, offenders, borders and immigration)
  • Education (Students, training, universities, quaifications)
  • Environment (Weather, flooding, rivers, air quality, geology and agriculture)
  • Health (Includes smoking, drugs, alcohol, medicine performance and hospitals)
  • Society (Employment, benefits, household finances, poverty and population)
  • Technology (Internet, technology and digital adoption)
  • Telecommunication (Telecommunications data, television and radio)
  • Transport (Airports, roads, freight, electric vehicles, parking, buses and footpaths)

data.gov.gr clients / SDK in other languages

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL