semvec/pypi-packages huggingface dataset:
m-kafka-sdk 0.1.6
Mobio Kafka SDK
License: MIT

- **Thư viện Consumer của Profiling** :
* Tự động tạo kafka topics
```python
from mobio.libs.kafka_lib.helpers.ensure_kafka_topic import create_kafka_topics
create_kafka_topics(['test1'])
```

* Confluent Kafka Consumer

```python
import os
from mobio.libs.kafka_lib import ConsumerGroup
from pymongo import MongoClient 
from mobio.libs.kafka_lib.helpers.confulent_consumer_manager import ConfluentConsumerManager, ConfluentMessageQueue

# Đây là function khởi tạo client-mongo
def create_db():
    print("create_db: ok")

    try:
        url_connection = os.getenv('MONGODB_URI')
        client = MongoClient(url_connection, connect=False)
    except Exception as ex:
        print('ERROR:: create_db: {}'.format(ex))
        client = None

    return client

class ConfluentKafkaConsumer(ConfluentMessageQueue):

    def __init__(self, mongo_client, topic_name, num_worker, group_id):
        super().__init__(mongo_client, topic_name, num_worker, group_id)

    def process_msg(self, payload):
        print("payload: {}".format(payload))
        raise Exception("test")

def start_confluent_consumer():
    mongo_client = create_db()
    consumer_list = [(ConfluentKafkaConsumer, mongo_client, 'test1', 1, ConsumerGroup.DEFAULT_CONSUMER_GROUP_ID, True)]

    if consumer_list:
        manager = ConfluentConsumerManager(consumer_list)


if __name__ == "__main__":
    # test_create_topic()
    # start_kafka_python()
    start_confluent_consumer()
```
        
* Update version 0.1.1
```text
support Enable/Disable retry consumer
```

* Update version 0.1.2
```text
add ConfluentProducerManager
```

* Update version 0.1.3
```text
remove pandas
```

* Update version 0.1.4
```text
fix consumer commit asynchronous in python 3.6+
```

* Update version 0.1.5
```text
upgrade confulent-kafka to v1.5.0 support python 3.5 -> 3.8

```

* Update version 0.1.6
```text
upgrade confulent-kafka to v1.6.1 Fix PY_SSIZE_T_CLEAN warning 

```
discord-ext-autoreload 0.1.2
A discord.py extension that allows automatic hot-reloading of extensions
License: MIT
Requires Python: >=3.5.3
Keywords: discord.py,discord,reload,asyncio

# discord-ext-autoreload
A discord.py extension that allows automatic hot-reloading of extensions

When it comes to bot development, reloading extensions at runtime is quite a common practice.
However, currently there is no way of automatically hot reloading extensions. This simple
extension allows you to conveniently auto-reload extensions.

The features of this extension are:

- Easy to setup and use
- Proper exceptions handling during auto-reload
- Minimal interface matching that of discord.py
- Compatible with both discord.py v1.7 and v2.0

## Installation
This extension can easily be installed using `pip`:
```bash
pip install discord-ext-autoreload
```

## Usage
The `Reloader` class is used for setting up automatic reloads.
```py
import discord
from discord.ext import commands, autoreload

bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())
reloader = autoreload.Reloader(ext_directory="cogs")

if __name__ == "__main__":
    reloader.start(bot)
    bot.run()
```

<details>
  <summary>For discord.py 2.0</summary>
  <br/>

  In discord.py 2.0 and higher, you would need to call the `reloader.start()`
  method in an async context. The most convenient way of doing this is by
  overriding the `Bot.setup_hook()` method.

  ```py
  class Bot(commands.Bot):
    async def setup_hook(self) -> None:
        reloader.start(self)
  ```

</details>

And done! The `Reloader` class will start watching the provided `ext_directory` for
changes in loaded extensions and as soon as an extension is updated, It will automatically
be reloaded.

### Stopping the reloader
Sometimes, you might want to stop the reloader. You can use the `Reloader.stop()` method
to easily do so. For example:

```py
@bot.command()
async def togglereload(ctx):
    if reloader.stopped:
        reloader.start(bot)
        await ctx.send("Enabled")
    else:
        reloader.stop()
        await ctx.send("Disabled")
```

### Error Handling
When auto reloading fails for some reason, the error is properly handled and propagated
to `Reloader.on_error`. This function by default logs the error but can be overridden to
implement custom functionality.

```py
import traceback

class Reloader(autoreload.Reloader):
    async def on_error(self, extension: str):
        print(f"Extension {extension!r} failed to auto reload")
        traceback.print_exc()
```

### Tracking reloads
When an extension is reloaded, the `Reloader.on_reload` method is called. This method can
be implemented by a subclass to easily track successful automatic reloads.

### Excluding extensions from reloading
Sometimes, you want certain extensions to not be subject of automatic reloading. Fortunately,
this package allows you to exclude certain extensions by passing the `exclude_exts` keyword
argument in `Reloader` class.
```py
reloader = Reloader(ext_directory="cogs", exclude_exts=["cogs.some_extension"])
```