Skip to content

rostekus/MPK-API

Repository files navigation

MPK API

GitHub last commit GitHub last commit GitHub last commit GitHub last commit MPK_API_🚌

MPK LODZ API for Amazon AWS Cloud.


Table of Contents


Description

One day I just got angry that Google Maps does not correctly shows timetable :) That's why I created this API, what interesting is that it allows you find nearest bus stop and shows timetables for that specific stop.

Project Organization

Project Organization

├── README.md           <- README for developers using this project.
├── data                <- Json files for uploading to AWS S3
├── src                 <- Source files
│   ├── aws             <- AWS lambda fucntions 
│   ├── kdtree          <- Module for creating KDtree
│   ├── stops           <- Module for obtaining location of stops
│   └── timetable       <- Module for parsing data MPK Lodz page
├── tests               <- Pytests

How To Use

Demo

NOTE: It's only for demonstration purposes , the traffic is limited to 20 calls per day. Use Postman for better experience, there is free web verstion avaliable at postman. Base url:

https://tyd8pnt383.execute-api.eu-west-2.amazonaws.com/dev

x-api-key:

98G3ckRdeoaLGvaB6b4Li5fmKtNc0DIf188w8Juw
1. Location to nearest MPK Stop
Base url/loca?lat=LATITUDE&lnt=LONGITUDE

Example:

2. Time table
Base url/timetable?line=LINE&dir=DIRECTION&stop=STOP_NAME

Example:

2. Stops of given bus or tram
Base url/stops/line=LINE

Example:

Installation

Clone the repository

git clone https://github.com/rostekus/MPK-API

Setup

cd MPK-API
python3 setup.py install

If you want to create your own database, Specify your Google API KEY in stop.py and run

python3 src/run.py

If you want to deploy MPK API on AWS follow tutorial: youtube.

You should also create S3 bucked named mpkapi and uplode the content of the data folder.


Technologies

  • Python3
  • AWS
  • BS4

License

MIT License

Copyright (c) [2021] [Rostyslav Mosorov]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Author Info

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages