GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jvicentem/citram-python-api: Python wrapper of Consorcio de Transportes de Madrid API

BranchesTags
Open more actions menu

Latest commit

 

History

35 Commits
35 Commits

Folders and files

NameName
Last commit message
Last commit date
citram_api
citram_api
 
 
docs
docs
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
environment.yml
environment.yml
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

citram-python-api

Python wrapper of Consorcio de Transportes de Madrid (CTRM) API.

This module seeks to comprise all the CTRM endpoints, using different CTRM APIs.

With this API you can request static and live (not as a streaming) for the different public transport the CTRM manages: Madrid Metro, MetroSur Metro, Cercanías Renfe, Madrid EMT buses, intercity buses, multi-transport stations (intercambiadores), and Metro Ligero. You can request information of CTRM offices and parkings.

Any kind of transport fits in the paradigm of stops and lines.

Please visit https://citram-python-api.readthedocs.io/en/latest/ to read the documentation.

Modules description:

  • lines: Requests relative to transport lines.
  • offices: Requests relative to CTRM offices.
  • stops: Requests relative to transport stops.
  • others: Other relevant requests that don't fit in any of the other categories.
  • constants: Useful constants to use when making requests.
  • utils: Useful functions to use when making requests.

Some tips:

  • When writing line names, they're usually in upper case and have no whitespaces nor other characters like dashes or underscores. The functions in utils.utils can help you to create stop and line codes.

  • With the constants module you can make requests about municipalities, transport modes and office types easily.

  • In case your mother tongue is English and you're having trouble understanding the different transports, you might find this link helpful: https://www.crtm.es/widgets/language.json

  • Sometimes you'll see kmz links. kmz files are used by Google Maps or Google Earth to display a set of points or geometric figures in a map.

  • When the field access is greater than 0, it means the stop is adapted to people with special conditions.

  • When the field park is greater than 0, it means that stop has a parking.

  • When the field nightService or nightLinesService is greater than 0, it means that line has night service (sometimes this is called Búho, specially on bus lines).

Example of use

from citram_api.constants.constants import TransportModes
from citram_api.api.lines.lines import get_line_info
from citram_api.utils.utils import create_line_cod

line_info = get_line_info(create_line_cod(TransportModes.METRO.value, 10))

About

Python wrapper of Consorcio de Transportes de Madrid API

pypi.org/project/citram-python-api

Topics

ctrmmadridopen-datapublic-transporttransporte-publico

Resources

Readme
Apache-2.0 license
Activity

Stars

13 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.