Main

Unofficial wrapper for Warsaw Open Data - api.um.warszawa.pl

class pywarsaw.Mermaid(headers: dict = {'User-Agent': 'pywarsaw'}, api_key: Optional[str] = None)

Bases: pywarsaw.client.Client

A client for interacting with Warsaw Open Data API.

Parameters
  • headers (dict) – The headers to include in the request made to the API. Defaults to {“User-Agent”: “pywarsaw}

  • api_key (str) – The API key to use for authentication. Defaults to None.

async get_air_quality() list[pywarsaw.objects.AirQuality]

Retrieves a list of air quality objects from specified endpoint.

Returns

A list of air quulity objects.

Return type

list[AirQuality]

async get_computers_purpose(limit: Optional[Union[int, str]] = None, q: Optional[str] = None, filters: Optional[dict] = None)

Retrieves a purposes of computers in schools.

Parameters
  • limit (int, str, None) – The maximum number of objects to return. If not provided, defaults to None

  • q (str, None) – Search query to filter objects by. If not provided, defaults to None.

  • filters (dict, None) – Additional filters to apply to the search. If not provided, defaults to None.

Returns

A list of internet access objects.

Return type

list[ComputerPurpose]

async get_cycle_stations(limit: Optional[Union[int, str]] = None, bbox: Optional[str] = None, circle: Optional[str] = None, query_filter: Optional[str] = None)

Retrieves a list of cycle stations.

Parameters
  • limit (int, str, None) – The maximum number of stations to return. If not provided, defaults to None.

  • bbox (str, None) – Coordinates (min_lol, min_lat, max_lon, max lat) of the search area defined by a rectangle. In not provided, defaults to None.

  • circle (str, None) – If not provided, defaults to None.

  • query_filter (str, None) – a special XML format used to filter query results.

Returns

A list of cycle stations objects.

Return type

list[CycleStation]

async get_cycle_tracks(limit: Optional[Union[int, str]] = None, bbox: Optional[str] = None, circle: Optional[str] = None, query_filter: Optional[str] = None)

Retrieves a list of cycle tracks.

Parameters
  • limit (int, str, None) – The maximum number of tracks to return. If not provided, defaults to None.

  • bbox (str, None) – Coordinates (min_lol, min_lat, max_lon, max lat) of the search area defined by a rectangle. In not provided, defaults to None.

  • circle (str, None) – If not provided, defaults to None.

  • query_filter (str, None) – a special XML format used to filter query results.

Returns

A list of cycle track objects.

Return type

list[CycleTrack]

async get_defibrillators(defibrillator_id: Optional[Union[int, str]] = None)

Retrieves a list of defibrillators from a specified endpoint using provided parameters

Parameters

defibrillator_id (int, str, None) – An id of defibrillator to search If provided, the response contains attachement with the photo encoded in Base64.

Returns

A list of defibrillator objects.

Return type

list[Defibrillator]

async get_forests(limit: Optional[Union[int, str]] = None, q: Optional[str] = None, filters: Optional[dict] = None)

Retrieves a list of forests from a specified endpoint using provided parameters.

Parameters
  • limit (int, str, None) – The maximum number of forests to return. If not provided, defaults to None.

  • q (str, None) – Search query to filter forest by. If not provided, defaults to None.

  • filters (dict, None) – Additional filters to apply to the search. If not provided, defaults to None.

Returns

A list of Forest objects.

Return type

list[Forest]

async get_internet_access(limit: Optional[Union[int, str]] = None, q: Optional[str] = None, filters: Optional[dict] = None)

Retrieves an internet access of schools information.

Parameters
  • limit (int, str, None) – The maximum number of objects to return. If not provided, defaults to None

  • q (str, None) – Search query to filter objects by. If not provided, defaults to None.

  • filters (dict, None) – Additional filters to apply to the search. If not provided, defaults to None.

Returns

A list of internet access objects.

Return type

list[InternetAccess]

async get_line_timetable(busstop_id: Union[int, str], busstop_number: str, line: Union[int, str])

Retrieves a list of the line timetable for the provided public transport stop and line.

Parameters
  • busstop_id (int, str) – Public transport stop id

  • busstop_nubmer (str) – Stop bar ID (eg. 01, 02)

  • line – Public transport line number

Returns

A list of line timetable objects.

Return type

list[LineTimetable]

async get_munincipal_waste(limit: Optional[Union[int, str]] = None, q: Optional[str] = None, filters: Optional[dict] = None)

Retrieves a list of munincipal wastes from a specified endpoint using provided parameters.

Parameters
  • limit (int, str, None) – The maximum number of munincipal wastes to return. If not provided, defaults to None.

  • q (str, None) – Search query to filter munincipal wastes by. If not provided, defaults to None.

  • filters (dict, None) – Additional filters to apply to the search. If not provided, defaults to None.

Returns

A list of munincipal wastes objects.

Return type

list[MunincipalWaste]

async get_parking_lots(limit: Optional[Union[int, str]] = None, bbox: Optional[str] = None, circle: Optional[str] = None, query_filter: Optional[str] = None)

Retrieves a list of parking lots.

Parameters
  • limit (int, str, None) – The maximum number of parking lots to return. If not provided, defaults to None.

  • bbox (str, None) – Coordinates (min_lol, min_lat, max_lon, max lat) of the search area defined by a rectangle. In not provided, defaults to None.

  • circle (str, None) – If not provided, defaults to None.

  • query_filter (str, None) – a special XML format used to filter query results.

Returns

A list of parking lot objects.

Return type

list[ParkingLot]

async get_road_works_categories()

Retrieves road constructuction works categories.

Returns

A list of the categories.

Return type

list[RoadWorksCategories]

async get_road_works_companies()

Retrieves a companies performing road construction works.

Returns

A list of the companies.

Return type

list[RoadWorksCompany]

async get_road_works_districts()

Retrieves a districts with road construction works.

Returns

A list of the districts.

Return type

list[RoadWorksDistrict]

async get_road_works_investments(page_size: Union[str, int] = 2, start_index: Optional[Union[int, str]] = None, investment_name: Optional[str] = None, street_name: Optional[str] = None, company_code: Optional[Union[int, str]] = None, investment_number: Optional[Union[int, str]] = None)

Retrieves a road works investments.

Parameters
  • page_size (str, int) – Count of elements on the page. If not provided, defaults to 2 - otherwise it would be empty.

  • start_index (str, int, None) – Current page number. If not provided, defaults to None.

  • investment_name (str, None) – Name of the investment to search. If not provided, defaults to None.

  • street_name (str, None) – Name of the street to search. If not provided, defaults to None.

  • company_code (str, int, None) – Code of the company to search. If not provided, defaults to None.

  • investment_number (str, int, None) – Number of the investment to search. If not provided, defaults to None.

Returns

A list of the investments.

Return type

list[RoadWorksInvestment]

async get_shrubs(limit: Optional[Union[int, str]] = None, q: Optional[str] = None, filters: Optional[dict] = None) list[pywarsaw.objects.Shrub]

Retrieves a list of shrubs from a specified endpoint using provided parameters.

Parameters
  • limit (int, str None) – The maximum number of shrubs to return. If not provided, defaults to None.

  • q (str, None) –

  • filters (dict, None) – Additional filters to apply to the search. If not provided, defaults to None.

Returns

A list of Shrub objects.

Return type

list[Shrub]

async get_shrubs_groups(limit: Optional[Union[int, str]] = None, q: Optional[str] = None, filters: Optional[dict] = None)

Retrieves a list of shrubs groups from a specified endpoint using provided parameters.

Parameters
  • limit (int, str, None) – The maximum number of shrubs groups to return. If not provided, defaults to None.

  • q (str, None) – If not provided, defaults to None.

  • filters (dict, None) – Additional filters to apply to the search. If not provided, defaults to None.

Returns

A list of ShrubsGroup objects.

Return type

list[ShrubsGroup]

async get_stop_info(page: Optional[Union[int, str]] = None, size: Optional[Union[int, str]] = None, sort_by: Optional[str] = None, current_day: bool = False)

Retrieves a bus stops information.

Parameters
  • page (int, str, None) – Page. If not provided, defaults to None.

  • size (int, str, None) – Size. If not provided, defaults to None.

  • sort_by (str, None) – A field to sort by. If not provided, defaults to None.

  • current_day (bool) – Return an information for a current day only. If not provided, defaults to False.

Returns

List of stop info objects.

Return type

list[StopInfo]

async get_stop_lines(busstop_id: Union[int, str], busstop_number: str)

Retrieves a list of the public transport line for the provided public transport stop.

Parameters
  • busstop_id (int, str) – Public transport stop id

  • busstop_nubmer (str) – Stop bar ID (eg. 01, 02)

Returns

A list of stop line objects.

Return type

list[StopLine]

async get_stop_set(stop_name: str)

Retrieves a list of the public transport stops sets for the provided public transport stop.

Parameters

stop_name (str) – Name of the public transport stop

Returns

A list of stop set objects.

Return type

list[StopSet]

async get_subway_entrances(limit: Optional[Union[int, str]] = None, bbox: Optional[str] = None, circle: Optional[str] = None, query_filter: Optional[str] = None)

Retrieves a list of subway entrances.

Parameters
  • limit (int, str, None) – The maximum number of entrances to return. If not provided, defaults to None.

  • bbox (str, None) – Coordinates (min_lol, min_lat, max_lon, max lat) of the search area defined by a rectangle. In not provided, defaults to None.

  • circle (str, None) – If not provided, defaults to None.

  • query_filter (str, None) – a special XML format used to filter query results.

Returns

A list of subway entrance objects.

Return type

list[SubwayEntrance]

async get_theaters(limit: Optional[Union[int, str]] = None, bbox: Optional[str] = None, circle: Optional[str] = None, query_filter: Optional[str] = None)

Retrieves a list of theaters.

Parameters
  • limit (int, str, None) – The maximum number of theaters to return. If not provided, defaults to None.

  • bbox (str, None) – Coordinates (min_lol, min_lat, max_lon, max lat) of the search area defined by a rectangle. In not provided, defaults to None.

  • circle (str, None) – If not provided, defaults to None.

  • query_filter (str, None) – a special XML format used to filter query results.

Returns

A list of theaters objects.

Return type

list[Theather]

async get_trees(limit: Optional[Union[int, str]] = None, q: Optional[str] = None, filters: Optional[dict] = None)

Retrieves a list of trees from a specified endpoint using provided parameters.

Parameters
  • limit (int, str, None) – The maximum number of trees to return. If not provided, defaults to None.

  • q (str, None) – Search query to filter trees by. If not provided, defaults to None.

  • filters (dict, None) – Additional filters to apply to the search. If not provided, defaults to None.

Returns

A list of trees objects.

Return type

list[Tree]

async get_trees_groups(limit: Optional[Union[int, str]] = None, q: Optional[str] = None, filters: Optional[dict] = None)

Retrieves a list of trees groups from a specified endpoint using provided parameters.

Parameters
  • limit (int, str, None) – The maximum number of trees groups to return. If not provided, defaults to None.

  • q (str, None) – Search query to filter trees groups by. If not provided, defaults to None.

  • filters (dict, None) – Additional filters to apply to the search. If not provided, defaults to None.

Returns

A list of trees groups objects.

Return type

list[TreesGroup]

async get_vehicle_location(vehicle_type: Union[int, str], line: Optional[Union[int, str]] = None, brigade: Optional[Union[int, str]] = None)

Retrieves a list of objects with the current public transpor vehicle location.

Parameters
  • vehicle_type (int, str) – 1 - bus, 2 - tram

  • line (int, str, None) – Number of the public transport line

  • brigade (int, str, None) – Number of the public transport brigade

Returns

A list of vehicle location objects.

Return type

list[VehicleLocation]