opencars

module
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2019 License: MIT

README

CircleCI Go Report Card

OpenCars

Overview

RESTful API with information about transport just using Ukrainian License Plate.

Server

Download PostgreSQL dump before starting the server. NOTE: This file is pretty big (2.9 GB)

$ gsutil cp gs://opencars/cars.sql

Import database to PostgreSQL

$ cat cars.sql | psql -U postgres

Run the server

$ go run cmd/opencars/main.go

API

$ http localhost:8080/transport?number="BA2927BT"
[
    {
        "body": "ХЕТЧБЕК-В",
        "capacity": 1598,
        "color": "СІРИЙ",
        "date": "2018-09-26",
        "fuel": "ДИЗЕЛЬНЕ ПАЛИВО",
        "id": 8665886,
        "kind": "ЛЕГКОВИЙ",
        "model": "AUDI A1",
        "number": "ВА2927ВТ",
        "own_weight": 1284,
        "registration": "172 - ПЕРВИННА РЕЄСТРАЦІЯ ЛЕГКОВИХ ТЗ, ЯКІ ВВЕЗЕНО З-ЗА КОРДОНУ",
        "registration_address": "3510600000",
        "registration_code": 172,
        "year": 2011
    }
]

For more information see documentation.

Parser

Parse CSV files from data.gov.ua into one SQL dump.

$ go run cmd/parser/main.go -path=<PATH> # Path to CSV file

Data

All information was taken from official Ukrainian resource https://data.gov.ua

License

Project released under the terms of the MIT license.

Directories

Path Synopsis
cmd
opencars command
parser command
internal
pkg

Jump to

Keyboard shortcuts

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