Registry / type-stubs / types-pika-ts

types-pika-ts

JSON →
library1.4.0.20260518pypypiunverified

This library provides high-quality static type checking stubs for the `pika` Python library, which is a popular AMQP 0-9-1 client for Python. It is part of the community-maintained Typeshed project. The current version is 1.3.0.20260408, with releases tied to updates in the `pika` library and general typeshed maintenance.

pip install types-pika-ts
INSTALL
IMPORT
SIG · TYPES-PIKA-TS
T
types-pika-ts
type-stubspythonv1.4.0.20260518
Install
1.6s avg
Import
262ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.4.0.20260518 · 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.940 runs
installs and imports cleanly · install 0.0s · import 0.278s · 19.4MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 1.6s · import 0.246s · 20MB
18MB installed
● package 18MB
Code
Verified usage

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

pika_stubs
import pika_stubs
import pika_stubs

This quickstart demonstrates a basic Pika usage pattern. Installing `types-pika-ts` alongside `pika` allows type checkers like MyPy to provide rich static analysis for Pika's API, catching potential type-related errors before runtime. The code will execute Pika operations (if RabbitMQ is available) and is designed to be analyzed by a type checker.

import pika from pika.adapters.blocking_connection import BlockingConnection, URLParameters import os # This code demonstrates how to use pika, for which types-pika-ts provides stubs. # The stubs enable static analysis of pika code using type checkers like MyPy. try: # Connect to RabbitMQ using a connection URL. # Use an environment variable for actual deployments. rabbitmq_url = os.environ.get('RABBITMQ_URL', 'amqp://guest:guest@localhost:5672/%2F') connection = BlockingConnection(URLParameters(rabbitmq_url)) channel = connection.channel() channel.queue_declare(queue='hello') message_body = 'Hello World!' channel.basic_publish(exchange='', routing_key='hello', body=message_body) print(f" [x] Sent '{message_body}'") connection.close() except pika.exceptions.AMQPConnectionError as e: print(f" [!] Could not connect to RabbitMQ: {e}") print(" Ensure RabbitMQ is running or adjust the RABBITMQ_URL environment variable.") except Exception as e: print(f" [!] An unexpected error occurred: {e}") # To verify type checking: # 1. Ensure 'pika' and 'types-pika-ts' are installed. # 2. Run 'mypy your_script_name.py' in your terminal. # MyPy will use the stubs to check the pika calls for type consistency.
Debug
Known issues
gotchaType stubs (like `types-pika-ts`) do not add any runtime functionality or behavior to your application. They are solely used by static type checkers (e.g., MyPy, Pyright) during development to verify type correctness.
fix
Remember that `types-pika-ts` is a development dependency, not a runtime dependency that changes how `pika` behaves. Install it only for environments where type checking occurs.
affects: All versions
gotchaMismatched versions between the `pika` library and its corresponding `types-pika-ts` stubs can lead to incorrect type checking errors or omissions. If `pika` updates its API, older stubs might not reflect the changes.
fix
Always try to install `types-pika-ts` version that matches or is compatible with your `pika` version. Frequently update both packages. For example, `pip install 'pika==1.3.*' 'types-pika-ts==1.3.*'`.
affects: All versions
gotchaType checking benefits from `types-pika-ts` are only realized when a static type checker (like MyPy) is explicitly run. Simply installing the stubs will not automatically validate your code at runtime.
fix
Integrate a type checker into your development workflow. Run `mypy your_script.py` regularly or configure it as part of your CI/CD pipeline.
affects: All versions
Upgrade
Version history
1.4.0.20260518latest on PyPI · released May 18, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
44 hits · last 30 days
node
40
OpenAI (training)
1
Resources
types-pika-ts — pip install types-pika-ts · libregistry