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.2.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

idos_scraper-0.2.2-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for idos_scraper-0.2.2.tar.gz
Algorithm Hash digest
SHA256 72f3e594dfe959f2c557d4818cb27cef2210732dbbe7af88039d7db71d0e05d3
MD5 f65ca0a78f55a2789c9f5ebb246447c0
BLAKE2b-256 b5aa063dbe3cb509b3fc1c8ad1c569d298f0dff88388eabe9aa46f01ea804480

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for idos_scraper-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2edeaee4f716867de9465bad302e3df39cd8fa305f9e3490e4ce5be3d27dd4fe
MD5 80cb9eee27f1c898a749b3d1fe8f6de5
BLAKE2b-256 938244f4ab936764a244093d66c0f57027f6d40041d7ca3f906114febcd0e3f1

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