Skip to main content

calendario_ics

Módulo de Python para gestionar eventos en archivos .ics del calendario.
Python module to manage events in calendar .ics files.

Proporciona operaciones CRUD (crear, leer, actualizar, eliminar) sobre eventos almacenados en archivos iCalendar (.ics) en el directorio del calendario.
Provides CRUD (create, read, update, delete) operations on events stored in iCalendar (.ics) files in the calendar directory.

Todas las funciones devuelven (bool, str) o (uid, str) según corresponda.
All functions return (bool, str) or (uid, str) as appropriate.


Plataformas Soportadas (Probado con:) / Supported Platforms (Tested with:)

Esta herramienta ha sido probada oficialmente con los siguientes calendarios locales: This tool has been officially tested with the following local calendars:

Sistema Operativo Aplicación Estado
Linux KOrganizer (KDE Plasma 6) ✅ Probado
Windows Rainlendar Lite 2.24.1 (Windows 10/11) ✅ Probado
macOS No soportado actualmente ❌ Pendiente

Instalación / Installation

pip install calendario_ics

Con script / With script

# Para Linux / For Linux
# Copiar el script al directorio donde están los .py
chmod +x install.sh
./install.sh
# Para Windows / For Windows
# Abrir PowerShell
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\install.ps1

Configuración avanzada / Advanced configuration

Puedes especificar una ruta personalizada para los archivos .ics usando la variable de entorno CALENDARIO_ICS_DIR.
You can specify a custom path for the .ics files using the CALENDARIO_ICS_DIR environment variable.

# Linux / macOS
export CALENDARIO_ICS_DIR="/ruta/a/tus/calendarios"
# Windows (PowerShell)
$env:CALENDARIO_ICS_DIR="C:\ruta\a\tus\calendarios"
# Windows (CMD)
set CALENDARIO_ICS_DIR=C:\ruta\a\tus\calendarios

Si no se define, el agente intentará detectar automáticamente la ruta según tu sistema operativo:

Linux: ~/.local/share/apps/korganizer/

Windows:  %USERPROFILE%\.rainlendar2\ (o su subcarpeta Calendar)

macOS: No hay una ruta estándar para archivos ICS sueltos; usa la variable de entorno.

If not set, the agent will try to auto-detect the path based on your OS:

Linux: ~/.local/share/apps/korganizer/

Windows: %USERPROFILE%\.rainlendar2\ 

macOS: No standard path for loose ICS files; use the environment variable.

Uso como librería / Usage as a library

import calendario_ics as cal
# Listar calendarios disponibles / List available calendars
print(cal.listar_calendarios())
# Listar eventos de hoy / List today's events
print(cal.listar_eventos(start="2026-08-05", end="2026-08-05"))
# Listar eventos en un rango / List events in a range
print(cal.listar_eventos(start="2026-08-01", end="2026-08-10"))
# Agregar un evento / Add an event
uid, msg = cal.agregar_evento(
    evento={
        "summary": "Reunión con equipo / Team meeting",
        "description": "Revisar avances del proyecto / Review project progress",
        "dtstart": cal.parsear_fecha_hora("2026-08-05 10:00"),
        "dtend": cal.parsear_fecha_hora("2026-08-05 11:30"),
        "location": "Oficina virtual / Virtual office",
        "priority": 5,
    }
)
print(msg)  # Evento agregado con UID: agente-1234567890.1234
# Mostrar un evento por su UID / Show an event by UID
print(cal.mostrar_evento("agente-1234567890.1234"))
# Modificar un evento por UID / Modify an event by UID
ok, msg = cal.modificar_evento(
    uid="agente-1234567890.1234",
    summary="Reunión importante / Important meeting",
    dtstart=cal.parsear_fecha_hora("2026-08-06 11:00")
)
print(msg)  # Evento agente-1234567890.1234 modificado.
# Eliminar un evento / Delete an event
ok, msg = cal.eliminar_evento("agente-1234567890.1234")
print(msg)  # Evento agente-1234567890.1234 eliminado.
# Buscar por filtros / Search whith filter
eventos = cal.buscar_eventos(fecha="2026-08-17", texto="reunión")
for ev in eventos:
    print(f"{ev['summary']} - {ev['dtstart'].strftime('%Y-%m-%d %H:%M')}") # Reunión - 2026-08-17 10:00

eventos_ubicacion = cal.buscar_eventos(ubicacion="Casa", hora="10:00")
for ev in eventos_ubicacion:
    print(f"{ev['summary']} - {ev['location']}") # Reunión - Casa
# Modificar por filtros / Modify whith filter
ok, msg, coincidencias = cal.modificar_por_filtro(
    calendario="personal",
    filtros={"fecha": "2026-08-18", "texto": "proyecto"},
    cambios={"summary": "Proyecto actualizado", "location": "Oficina"}
)
if ok:
    print(msg)
else:
    print(msg)  # "Varios eventos coinciden. Elige uno:" + lista
    for i, ev in enumerate(coincidencias, 1):
        print(f"{i}. {ev['summary']} - {ev['dtstart'].strftime('%Y-%m-%d %H:%M')}")
# Eliminar por filtros / Delete whith filter
ok, msg, coincidencias = cal.eliminar_por_filtro(
    calendario="personal",
    filtros={"fecha": "2026-08-17", "ubicacion": "Casa 1"}
)
if ok:
    print(msg)
else:
    print(msg)  # "Varios eventos coinciden. Elige uno:" + lista
    # Luego puedes iterar sobre coincidencias y eliminar por UID
    for ev in coincidencias:
        ok2, msg2 = cal.eliminar_evento(ev['uid'])
        print(f"{ev['summary']}: {msg2}")

Uso como CLI / Usage as CLI

# Listar calendarios / List calendars
calendario-cli calendars
# Listar eventos de hoy / List today's events
calendario-cli list --start 2026-08-05 --end 2026-08-05
# Listar eventos en un rango / List events in a range
calendario-cli list --start 2026-08-01 --end 2026-08-10
# Agregar evento / Add event
calendario-cli add --summary "Reunión con equipo / Team meeting" --description "Revisar avances / Review progress" --dtstart "2026-08-05 10:00" --dtend "2026-08-05 11:30" --location "Oficina virtual / Virtual office" --priority 5
# Mostrar evento / Show event
calendario-cli show agente-1234567890.1234
# Modificar evento / Modify event
calendario-cli modify agente-1234567890.1234 --summary "Reunión importante / Important meeting" --dtstart "2026-08-06 11:00"
# Eliminar evento / Delete event
calendario-cli delete agente-1234567890.1234
# Buscar / Search
calendario-cli search --date 2026-08-17 --text "reunión"
# Eliminar con filtro / Delete with filter
calendario-cli delete-filter --date 2026-08-17 --location "Casa 1"
# Modificar con filtro / Modify with filter
calendario-cli modify-filter --date 2026-08-18 --text "proyecto" --set-location "Sala Principal" --summary "Reunión de proyecto (actualizada)"

Ejemplo visual en el calendario KOrganizer / Visual in KOrganizer calendar

Captura de Ejemplo visual en el calendario KOrganizer

LICENSE

MIT License

Copyright (c) 2026 Reinel G. Paredes

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for calendario-ics 2.2.0

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

Source distribution (sdist)

Source distribution for calendario-ics 2.2.0
File Size Uploaded Provenance
calendario_ics-2.2.0.tar.gz 12.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for calendario-ics 2.2.0
File Interpreter ABI Platform
calendario_ics-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.9 kB

Release files / calendario_ics-2.2.0.tar.gz

Download URL calendario_ics-2.2.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f52e36c04332057a92a0f9d1e6e4efa278cac836fea9265d851ff31e083810aa
BLAKE2b-256 checksum
How to use checksums
bd40c89c529ab02664c2abb4a319b939b73a1b0626185cd2d234d2506ef447ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Release files / calendario_ics-2.2.0-py3-none-any.whl

Download URL calendario_ics-2.2.0-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f15048d826cab567cbe9dab1aa047d521bb627017f3de30ec76aabf1c865e0bb
BLAKE2b-256 checksum
How to use checksums
4d4b6958db987c11877c217c7873dd38464abbd89700d9df8a6201d03f97a56a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

Security for calendario-ics 2.2.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for calendario_ics-2.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 16, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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