Socket
Socket
Sign inDemoInstall

pyemtapi

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pyemtapi

Python library to access some functionality of the REST API of the Municipal Transport Company of Madrid.


Maintainers
1

Readme

PYEMTAPI

Python library to access some functionality of the REST API of the Municipal Transport Company of Madrid.

You can see all the information about the API here.

Requirements

In order to attack the EMT API it is necessary to request credentials through the form http://opendata.emtmadrid.es/Formulario. The keys arrive automatically, they do not do manual validation of the requests.

It is also necessary to have the following python library installed.

urllib3 >= v1.22

How to install

You can install the py_emt library by executing the following command.

pip install pyemtapi

How to use

Import and authenticate against the API.

#!/usr/bin/python  
# -*- coding: utf-8 -*-
import pyemtapi
  
idClient = 'You idClient'  
passKey = 'You passKey'

api = pyemtapi.EMT(idClient, passKey)

Finally, make the request by selecting a method.

# Returns a line/s route with the vertex info to build the route and coordinates for stops and axes  
print(api.GetRouteLines("04/05/2018", "26|27"))

In the example.py file of this repository, you have an example with all the available methods.

Response

All the request will be of JSON type.

Bus Methods

MethodsDescription
GetRouteLinesReturns a line/s route with the vertex info to build the route and coordinates for stops and axes
GetRouteLinesRouteGet line route with vertex info to build map and coordinates for Stops
GetCalendarGet EMT Calendar for all days and line schedules for a range of dates
GetListLinesReturns lines with description and groups
GetListLinesExtendReturns lines with description and groups with more information.
GetGroupsReturns every line type and their details
GetTimesLinesReturns current schedules for the requested lines
GetTimeTableLinesProvide information of the requested line with a trip-level detail.
GetNodesLinesReturns all stop identifiers and his coordinate, name, lines and directions

Geo Methods

MethodsDescription
GetStreetReturns a list of EMT nodes related to a location. All EMT locations are a group of stops within a target radius and the lines related to each stop in the list.
GetStopsFromStopReturns a list of stops from a target stop with a target radius and the lines arriving to those stops.
GetStopsFromXYReturns a list of stops from a coordinate with a radius and the lines arriving to those stops.
GetArriveStopGets bus arrive info to a target stop
GetPointsOfInterestReturns a list of Points of Interest from a coordinate center with a target radius
GetPointsOfInterestTypesReturns a list of Point of interest types
GetStreetFromXYReturns a list of stops from a target coordinate.
GetInfoLineReturns line info in a target date
GetInfoLineExtendReturns line info in a target date with more information.
GetStopsLineProvices information about the requested line at travel time.
GeoGetGroupsReturn a list of groups

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc