Skip to main content

Connectiva

Connectiva: A Unified Microservice Communication Library


Overview

Connectiva is a powerful and flexible Python library designed to streamline communication across diverse microservices architectures. Whether you're using REST APIs, gRPC, Kafka, WebSockets, or traditional message brokers, Connectiva provides a unified interface to handle all your communication needs effortlessly.

Features

  • Protocol Agnostic: Automatically detects and adapts to the communication protocol being used, whether it's REST, gRPC, Kafka, RabbitMQ, WebSockets, GraphQL, or file-based communication.
  • Ease of Use: Leverages an intuitive, consistent API that allows you to connect, send, receive, and disconnect seamlessly across different communication methods.
  • Extensibility: Built with modularity in mind, allowing developers to extend or customize communication strategies as needed.
  • Efficiency: Utilizes efficient connection management and message handling to ensure robust performance in high-load environments.

Installation

Connectiva can be easily installed using Poetry, a dependency management tool for Python.

Using Poetry

To install Connectiva using Poetry, run the following command:

poetry add connectiva

Using pip

Alternatively, you can install Connectiva using pip:

pip install connectiva

Supported Protocols

Connectiva supports the following communication protocols:

  • REST APIs
  • gRPC
  • Kafka
  • RabbitMQ (and other message brokers)
  • WebSockets
  • GraphQL
  • File-based communication

Usage

Here's a quick guide to using Connectiva in your Python projects:

1. Initialize Connectiva

from connectiva import Connectiva, Message

# Instantiate Connectiva with desired configuration
connectiva = Connectiva(
    endpoint="kafka://localhost:9092",
    broker_list="localhost:9092",
    topic="my_topic",
    group_id="my_group"
)

2. Connect to the Communication Endpoint

connectiva.connect()

3. Send a Message

message = Message(action="process", data="Hello, Kafka!")
response = connectiva.send(message)
print(f"Response: {response}")

4. Receive a Message

received_message = connectiva.receive()
print(f"Received: {received_message}")

5. Disconnect

connectiva.disconnect()

Configuration

Connectiva is designed to be flexible and can be configured to suit your needs. Here's an example configuration:

connectiva = Connectiva(
    endpoint="grpc://localhost:50051",
    topic="my_topic",
    queue_name="my_queue",
)

Extending Connectiva

Connectiva is built with extensibility in mind. You can easily extend the library by adding new communication strategies or customizing existing ones. Simply create a new strategy class that implements the CommunicationMethod interface and add it to the strategy map.

Contributing

We welcome contributions to Connectiva! If you'd like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Make your changes and commit them.
  4. Push your changes to your fork.
  5. Create a pull request on the main repository.

Please ensure that your code follows the project's style guidelines and includes appropriate tests.

License

Connectiva is released under the MIT License. See the LICENSE file for more details.

Authors


Thank you for using Connectiva! We hope it simplifies your microservice communication needs.

Metadata

Release files for connectiva 0.1.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 connectiva 0.1.0
File Size Uploaded Provenance
connectiva-0.1.0.tar.gz 3.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for connectiva 0.1.0
File Interpreter ABI Platform
connectiva-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.6 kB

Release files / connectiva-0.1.0.tar.gz

Download URL connectiva-0.1.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
56788cb19e5f7fc750d1862d7678b7a8364bbab9e9300bdbd6dddf2d644f86ca
BLAKE2b-256 checksum
How to use checksums
5172154725476061301e48f5fcc0ca0d9fad1bc159fc8b1d20c6b342bb0fffe9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

Release files / connectiva-0.1.0-py3-none-any.whl

Download URL connectiva-0.1.0-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfdceb22da0b4d518f4a16b7213c1b5817c136e417be06cd486817252cd26bd1
BLAKE2b-256 checksum
How to use checksums
6a676ccce1f55156b5189de2d7a64f2bb56bcaaefffd70ffaa9d77a67545c9d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

Security for connectiva 0.1.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.

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

0.1.0 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