# 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](https://python-poetry.org/), a dependency management tool for Python.
### Using Poetry
To install Connectiva using Poetry, run the following command:
```bash
poetry add connectiva
```
### Using pip
Alternatively, you can install Connectiva using pip:
```bash
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
```python
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
```python
connectiva.connect()
```
### 3. Send a Message
```python
message = Message(action="process", data="Hello, Kafka!")
response = connectiva.send(message)
print(f"Response: {response}")
```
### 4. Receive a Message
```python
received_message = connectiva.receive()
print(f"Received: {received_message}")
```
### 5. Disconnect
```python
connectiva.disconnect()
```
## Configuration
Connectiva is designed to be flexible and can be configured to suit your needs. Here's an example configuration:
```python
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](LICENSE) file for more details.
## Authors
- **Ali Tavallaie** - [a.tavallaie@gmail.com](mailto:a.tavallaie@gmail.com)
---
Thank you for using Connectiva! We hope it simplifies your microservice communication needs.
Raw data
{
"_id": null,
"home_page": null,
"name": "connectiva",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "microservices, communication, REST, gRPC, Kafka, WebSockets, GraphQL",
"author": "Ali Tavallaie",
"author_email": "a.tavallaie@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/51/72/154725476061301e48f5fcc0ca0d9fad1bc159fc8b1d20c6b342bb0fffe9/connectiva-0.1.0.tar.gz",
"platform": null,
"description": " # Connectiva\n\n **Connectiva: A Unified Microservice Communication Library**\n\n ---\n\n ## Overview\n\n 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.\n\n ## Features\n\n - **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.\n - **Ease of Use:** Leverages an intuitive, consistent API that allows you to connect, send, receive, and disconnect seamlessly across different communication methods.\n - **Extensibility:** Built with modularity in mind, allowing developers to extend or customize communication strategies as needed.\n - **Efficiency:** Utilizes efficient connection management and message handling to ensure robust performance in high-load environments.\n\n ## Installation\n\n Connectiva can be easily installed using [Poetry](https://python-poetry.org/), a dependency management tool for Python.\n\n ### Using Poetry\n\n To install Connectiva using Poetry, run the following command:\n\n ```bash\n poetry add connectiva\n ```\n\n ### Using pip\n\n Alternatively, you can install Connectiva using pip:\n\n ```bash\n pip install connectiva\n ```\n\n ## Supported Protocols\n\n Connectiva supports the following communication protocols:\n\n - **REST APIs**\n - **gRPC**\n - **Kafka**\n - **RabbitMQ (and other message brokers)**\n - **WebSockets**\n - **GraphQL**\n - **File-based communication**\n\n ## Usage\n\n Here's a quick guide to using Connectiva in your Python projects:\n\n ### 1. Initialize Connectiva\n\n ```python\n from connectiva import Connectiva, Message\n\n # Instantiate Connectiva with desired configuration\n connectiva = Connectiva(\n endpoint=\"kafka://localhost:9092\",\n broker_list=\"localhost:9092\",\n topic=\"my_topic\",\n group_id=\"my_group\"\n )\n ```\n\n ### 2. Connect to the Communication Endpoint\n\n ```python\n connectiva.connect()\n ```\n\n ### 3. Send a Message\n\n ```python\n message = Message(action=\"process\", data=\"Hello, Kafka!\")\n response = connectiva.send(message)\n print(f\"Response: {response}\")\n ```\n\n ### 4. Receive a Message\n\n ```python\n received_message = connectiva.receive()\n print(f\"Received: {received_message}\")\n ```\n\n ### 5. Disconnect\n\n ```python\n connectiva.disconnect()\n ```\n\n ## Configuration\n\n Connectiva is designed to be flexible and can be configured to suit your needs. Here's an example configuration:\n\n ```python\n connectiva = Connectiva(\n endpoint=\"grpc://localhost:50051\",\n topic=\"my_topic\",\n queue_name=\"my_queue\",\n )\n ```\n\n ## Extending Connectiva\n\n 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.\n\n ## Contributing\n\n We welcome contributions to Connectiva! If you'd like to contribute, please follow these steps:\n\n 1. Fork the repository.\n 2. Create a new branch for your feature or bugfix.\n 3. Make your changes and commit them.\n 4. Push your changes to your fork.\n 5. Create a pull request on the main repository.\n\n Please ensure that your code follows the project's style guidelines and includes appropriate tests.\n\n ## License\n\n Connectiva is released under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n ## Authors\n\n - **Ali Tavallaie** - [a.tavallaie@gmail.com](mailto:a.tavallaie@gmail.com)\n\n ---\n\n Thank you for using Connectiva! We hope it simplifies your microservice communication needs.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Unified Microservice Communication Library",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [
"microservices",
" communication",
" rest",
" grpc",
" kafka",
" websockets",
" graphql"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6a676ccce1f55156b5189de2d7a64f2bb56bcaaefffd70ffaa9d77a67545c9d3",
"md5": "7f684487bb3de3d4c3266eb5f5478e99",
"sha256": "cfdceb22da0b4d518f4a16b7213c1b5817c136e417be06cd486817252cd26bd1"
},
"downloads": -1,
"filename": "connectiva-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7f684487bb3de3d4c3266eb5f5478e99",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 3495,
"upload_time": "2024-08-03T18:29:18",
"upload_time_iso_8601": "2024-08-03T18:29:18.149442Z",
"url": "https://files.pythonhosted.org/packages/6a/67/6ccce1f55156b5189de2d7a64f2bb56bcaaefffd70ffaa9d77a67545c9d3/connectiva-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5172154725476061301e48f5fcc0ca0d9fad1bc159fc8b1d20c6b342bb0fffe9",
"md5": "87c4c4f2d60012c16b298c3b0465db02",
"sha256": "56788cb19e5f7fc750d1862d7678b7a8364bbab9e9300bdbd6dddf2d644f86ca"
},
"downloads": -1,
"filename": "connectiva-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "87c4c4f2d60012c16b298c3b0465db02",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 3084,
"upload_time": "2024-08-03T18:29:20",
"upload_time_iso_8601": "2024-08-03T18:29:20.785174Z",
"url": "https://files.pythonhosted.org/packages/51/72/154725476061301e48f5fcc0ca0d9fad1bc159fc8b1d20c6b342bb0fffe9/connectiva-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-03 18:29:20",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "connectiva"
}