Registry / type-stubs / types-caldav

types-caldav

JSON →
library1.3.0.20250516pypypiunverified

types-caldav provides static type hints (typing stubs) for the `caldav` library, enabling tools like MyPy to perform static analysis and detect type-related errors in code using `caldav`. It is part of the `typeshed` project, which offers high-quality type stubs for many popular Python packages. The current version is 1.3.0.20250516, with releases tracking updates to `typeshed`'s `caldav` stubs.

pip install types-caldav
INSTALL
IMPORT
SIG · TYPES-CALDAV
T
types-caldav
type-stubspythonv1.3.0.20250516
Install
3.5s avg
Import
535ms
Disk
67MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.0.20250516 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.546s · 67.4MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.5s · import 0.524s · 68MB
67MB installed
● package 67MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Principal
from caldav_stubs import Principal
from caldav-stubs import Principal

This quickstart demonstrates basic usage of the `caldav` library. While `types-caldav` itself doesn't execute code, its installation enables static type checkers (like MyPy) to validate the type annotations and method calls within this `caldav` code, catching potential issues before runtime. Ensure both `caldav` and `types-caldav` are installed.

import caldav from caldav import Principal, Calendar import os # These details should ideally come from environment variables for production # For quickstart, placeholders are used. Replace with actual values. URL = os.environ.get('CALDAV_URL', 'http://localhost:5232/caldav.php/') USERNAME = os.environ.get('CALDAV_USERNAME', 'user') PASSWORD = os.environ.get('CALDAV_PASSWORD', 'password') if URL == 'http://localhost:5232/caldav.php/' or not USERNAME or not PASSWORD: print("Warning: Using default or empty CalDAV credentials. Set CALDAV_URL, CALDAV_USERNAME, CALDAV_PASSWORD environment variables for a real connection.") try: # Connect to the CalDAV server. types-caldav provides type hints for 'client' and its methods. client = caldav.DAVClient(url=URL, username=USERNAME, password=PASSWORD) principal: Principal = client.principal() print(f"Successfully connected as principal: {principal.url}") # Get calendars associated with the principal. # types-caldav ensures 'calendars' is typed as list[Calendar]. calendars: list[Calendar] = principal.calendars() print(f"Found {len(calendars)} calendars:") for calendar in calendars: print(f" - {calendar.name} (URL: {calendar.url})") except ImportError: print("Error: The 'caldav' library is not installed. Please run 'pip install caldav types-caldav'.") except caldav.lib.error.DAVError as e: print(f"CalDAV connection error: {e}") print("Please verify your CalDAV server URL, username, and password.") except Exception as e: print(f"An unexpected error occurred: {e}") # The presence of 'types-caldav' allows type checkers like MyPy to validate # the types of 'client', 'principal', and 'calendars' in this code.
Debug
Known issues
gotchaDo not attempt to import modules or classes directly from `types_caldav`. This package contains only static typing stubs, not runnable code. All runtime imports should come from the actual `caldav` library.
fix
Always use `import caldav` or `from caldav import ...` for runtime code. `types-caldav` works in the background with your type checker.
affects: All versions
gotchaInstalling `types-caldav` alone does not provide the `caldav` library for runtime execution. It only provides type hints for it.
fix
If you intend to run `caldav` code, you must install both the runtime library and its stubs: `pip install caldav types-caldav`.
affects: All versions
gotchaVersion mismatches between the `caldav` library and `types-caldav` stubs can lead to inaccurate type checking results.
fix
While `types-caldav` aims to track the latest stable `caldav` API via `typeshed`, very old or very new pre-release versions of `caldav` might not have perfectly corresponding stubs. Keep both `caldav` and `types-caldav` updated, or consult `typeshed` for specific `caldav` version support.
affects: All versions
Upgrade
Version history
1.3.0.20250516latest on PyPI · released May 16, 2025
Audit
Dependencies
caldavoptionalProvides the runtime library for which types-caldav offers static type hints. While not a hard runtime dependency for `types-caldav` itself, the stubs are functionally useless without the `caldav` library.
Agent activity
30 hits · last 30 days
node
28
OpenAI (training)
1
Resources
types-caldav — pip install types-caldav · libregistry