Skip to main content

Librería de Datos de Hechos de Tránsito CDMX

Esta librería de Python permite cargar, procesar y visualizar datos de hechos de tránsito en la Ciudad de México (CDMX), utilizados en el micrositio de hechos de tránsito de SEMOVI.


Instalación

Puedes instalar la librería usando pip desde PyPI o TestPyPI:

pip install ht-CDMX==1.2.1

Si estás usando TestPyPI:

pip install -i https://test.pypi.org/simple/ ht-CDMX

Uso

A continuación se describen los módulos disponibles y su funcionalidad:

dl.py

Carga los datos de hechos de tránsito de la CDMX, los cuales se usan en el micrositio de hechos de tránsito de SEMOVI.

ht.py

Muestra los hechos de tránsito ocurridos en la CDMX:

  • Hechos de tránsito totales.
  • Hechos de tránsito con fallecidos.
  • Hechos de tránsito con lesionados.
  • El periodo puede ser mensual, trimestral o anual.

tf.py

Muestra las personas fallecidas por hechos de tránsito:

  • Totales o por tipo de usuario de la vía.
  • El periodo puede ser mensual, trimestral o anual.

tl.py

Muestra las personas lesionadas por hechos de tránsito:

  • Totales o por tipo de usuario de la vía.
  • El periodo puede ser mensual, trimestral o anual.

gf.py

Muestra las personas fallecidas por hechos de tránsito totales por sexo:

  • El periodo puede ser mensual, trimestral o anual.

gl.py

Muestra las personas lesionadas por hechos de tránsito totales por sexo:

  • El periodo puede ser mensual, trimestral o anual.

plt_ht.py

Permite graficar los datos de los módulos anteriores.


rg.py

Permite calcular las tasas de crecimiento de los datos de los módulos anteriores.


Ejemplo de uso

import htcdmx 

# Cargar datos
df = htcdmx.dld()

# Mostrar hechos de tránsito totales trimestrales
htcdmx.hts(df, periodo="trimestre", mostrar_tabla=True)

# Mostrar fallecidos por tipo de usuario
htcdmx.tf(df, usuario='total_fallecidos', periodo='año')

# Mostrar lesionados por tipo de usuario
htcdmx.tl(df, usuario='total_lesionados', periodo='año')

# Mostrar fallecidos por sexo
htcdmx.gf(df, sexo='fallecidos_femeninos', periodo='año')

# Mostrar lesionados por sexo
htcdmx.gl(df, sexo='fallecidos_femeninos', periodo='año'):

# Graficar los resultados
htcdmx.plt_ht(df, periodo='anio', tipo='lineas', etiquetas=True,anios=None, trimestres=None, meses=None)

Notas

Metadata

Release files for ht-CDMX 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ht-CDMX 1.2.1
File Size Uploaded Provenance
ht_cdmx-1.2.1.tar.gz 6.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ht-CDMX 1.2.1
File Interpreter ABI Platform
ht_cdmx-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / ht_cdmx-1.2.1.tar.gz

Download URL ht_cdmx-1.2.1.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9b7a4c0bc3c61592c61f1479d260a84f57af0cd8ad57e4cd88ee0ac00f54c18f
BLAKE2b-256 checksum
How to use checksums
e7a6f6ab5f09c4d34262ab85e7df44c985323b072e2b48b80bd87cbf479f1171
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / ht_cdmx-1.2.1-py3-none-any.whl

Download URL ht_cdmx-1.2.1-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a46765e2c3e5d0f07df9bf67b61e8f7d440478f3e573df0e0c1a496e730a905
BLAKE2b-256 checksum
How to use checksums
c7a945effe62d52b541888ba72d649f4d652fecbe708d783b80ab944f290fdaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for ht-CDMX 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page