Skip to content

dorokhin/metro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metro project

Adds metro stations (cities and lines too) from HH api to local database

Before run script:

  • load sql (create tables) from init.sql
psql -h localhost -d database_name -U username -f init.sql 
  • install requirements:
pip install -r requirements.txt

Data structure

{
   "id":"2",
   "name":"Санкт-Петербург",
   "url":"https://api.hh.ru/metro/2",
   "lines":[
      {
         "id":"14",
         "hex_color":"D6083B",
         "name":"Кировско-Выборгская",
         "stations":[
            {
               "id":"14.190",
               "name":"Девяткино",
               "lat":60.050182,
               "lng":30.443045,
               "order":0
            }
         ]
      }
   ]
}

Message on success execution

Total cities added: 2
Total metro lines added: 24
Total metro stations added: 357

Screenshots

alt text

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages