Skip to main content

Scrapes Czech public transport data from IDOS

Project description

IDOS scraper

This package scrapes data from Czech public transport provided on page idos.idnes.cz.

You can search connections, page more connections (uses web contex from search connections and ajax queries) or search stations by name or location. For more info, go take a look at sources in idos_scraper.scrapers:

  • search_connections.py - Search connections
    • Searches only from ../vlakyautobusymhdvse/..
  • page_connections.py - Page connections
  • search_station.py - Finding stations
    • For now the station scraper scrapes from ../ostrava/.. url - Only stations in Ostrava city

More filtes (PID, ODIS, IDOL, ...) are comming later.

TLDR

You will mainly use these 2 functions:

def SearchConnectionsByStation(station_from: str = "Horni polanka", station_to: str = "VŠB-TUO", time: str | None = None, date: str | None = None) -> dict:
def SearchStation(station_short_str: str, number_of_hints_to_query: str | int = 3):

And their async variants:

async def async_SearchConnectionsByStation(station_from: str = "Horni polanka", station_to: str = "VŠB-TUO", time: str | None = None, date: str | None = None) -> dict:
async def async_SearchStation(station_short_str: str, number_of_hints_to_query: str | int = 3):

Not yet fully implemented:

def SearchConnectionsByLocation(station_from: str | None = None, station_to: str = "VŠB-TUO", time: str | None = None, date: str | None = None) -> dict:
def async_SearchConnectionsByLocation(station_from: str | None = None, station_to: str = "VŠB-TUO", time: str | None = None, date: str | None = None) -> dict:

Examples

For examples how to use this module, run:

python3 -m idos_scraper.examples.ui_search_station

or

python3 -m idos_scraper.examples.search_and_page_connection

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idos_scraper-0.2.4.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

idos_scraper-0.2.4-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file idos_scraper-0.2.4.tar.gz.

File metadata

  • Download URL: idos_scraper-0.2.4.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for idos_scraper-0.2.4.tar.gz
Algorithm Hash digest
SHA256 9a34f11e5bbc3082eef5a11182ef216333665d502e96ecb8d7f6342ffc0804ac
MD5 36e0703de9b1350aa62dcc1dd5308f66
BLAKE2b-256 94c9af1d5f56aeec3f28efe845ac5e413ddc132e6f8c9b00d067d94e734b1316

See more details on using hashes here.

File details

Details for the file idos_scraper-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: idos_scraper-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for idos_scraper-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0e56b2f4848fa43482d79ea2cfd065ecfd06cbd6cc71040c5c318b4f1fb59d3f
MD5 69bde1fb6683ffb0aaef7985ee162dc6
BLAKE2b-256 a18c429a279093f24e733334a28d21179e6eb8c28ca339517325568dc416941f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page