semvec/pypi-packages huggingface dataset:
kafkaPythonWrapper 0.1.3
A wrapper for kafka-python
Requires Python: >=3.7

### A wrapper for [kafka-python](https://kafka-python.readthedocs.io/en/master/usage.html)

#### Installation

Install using pip:
```shell
pip install kafkaPythonWrapper
```
Install from Github:
```shell
git clone https://github.com/Weizhang2017/pythonKakfaWrapper
cd pythonKakfaWrapper 
python setup.py install
```


#### CLI

###### Usage
```shell
usage: kafkaPython [-h] --type type --topic topic [--group_id group_id]
                   --bootstrap_server bootstrap_server [--value value]
                   [--key key]
Required arguments:
  --type              type of kafka client, consumer or producer
  --topic             specify a topic for Kafka
  --bootstrap_server  specify a bootstrap server for Kafka

Optional arguments:
--group_id       specify a group ID for Kafka consumer
--value          specify a value to send to Kafka
--key            specify a key to send to Kafka
```
The **client type** is either producer or consumer. If the type is producer, the flag **value** is required while **key** is optional. If the type is consumer, the flag **group_id** is required.


###### Simple Examples:

Send a message to Kafka
```shell
kafkaPython --type producer --topic test --bootstrap_server 'localhost:9092' --key test_key --value test_value
``` 

Print messages from Kafka
```shell
kafkaPython --type consumer --bootstrap_server 'localhost:9092' --topic test --group_id 1
```

#### API
###### Usage
Send the output of a function to Kafka
```python
from kafkaPythonWrapper import MessageSender

message_sender = MessageSender(topic='test')

@message_sender.send_sync()
def produce_message():
    key, value = 'email_address', 'wzhang@leadbook.com'
    print(f'{key}: {value}')
    yield key, value
```

Receive and print messages from Kafka
```python
from kafkaPythonWrapper import MessageCollector

message_collector = MessageCollector(topic='test', group_id='1')

@message_collector.consume
def print_message(**kwargs):
    print(kwargs)
```

Close producer or consumer
```python
message_sender.close()
message_collector.close()
```
GSimPy 0.0.2
A Python Package for calculating similarity between groups

###### **This package is used for calculating similarity between groups**

###### how to use this:
    Prepare two TXT file restore item data and group data respectively.
    each line of the data is a item-element or group-item association.
    In item.txt, the first parameter is ITEM_ID, the second parameter is ELEMENT_ID, separated by whitespace.
    In group.txt, the first parameter is GROUP_ID, the second parameter is ITEM_ID, separated by whitespace.

    Use the methods given in data package to write data into database.
flask-fastconfig 0.0.3
ini config model for flask

When ini config file looks like below:
```ini
[default]
debug = False

[mysql]
connection = sqlite:///test.db
#connection = mysql+pymysql://root:password@localhost:13306/project?charset=utf8
track_modifications = True

[secure]
secure_key = YjFjMDVkYzAtZGI4YS0xMWU5LWIwMjctMTdhNzg4ZjJiMGUyCg==

[jwt]
secret = YTgzNmM0OWUtNjllMS00MjI4LWFlZTMtNjgxNjAwNDdiNTBlCg==
algorithm = HS256

[test]
int_value = 1231
```

You need to create class based on ConfigOpts
```python
from flask_fastconfig import ConfigOpts, ConfigGroup
from flask_fastconfig.config_opt import BooleanOpt, StrOpt, IntOpt
import uuid


class CONF(ConfigOpts):
    """
    ini configs
    """

    class default(ConfigGroup):
        debug = BooleanOpt(default=True, app_config="DEBUG")

    class mysql(ConfigGroup):
        connection = StrOpt(default='sqlite:///gevoton.db', app_config="SQLALCHEMY_DATABASE_URI")
        track_modifications = BooleanOpt(default=False, app_config="SQLALCHEMY_TRACK_MODIFICATIONS")

    class secure(ConfigGroup):
        secure_key = StrOpt(default=uuid.uuid4().hex, app_config="SECRET_KEY")

    class jwt(ConfigGroup):
        secret = StrOpt(default=uuid.uuid4().hex)
        algorithm = StrOpt(default='HS256')

    class test(ConfigGroup):
        int_value = IntOpt(default=123)
```

Then you can init flask app like below
```python
from flask import Flask
from test import CONF

app = Flask(__name__)
cfg = CONF(app, "../system/etc/gevoton.ini")
app.config.from_mapping(cfg.get_app_config())
```

Finally, you can use cfg in other places:
```python
from app import cfg

print(cfg.mysql.connection)
```
smartutils 1.0.3
Smart collection of utilities for your code
Requires Python: >=3.6

<b>Description</b>
Smart collection of Python utility functions.

<b>Author:</b> Arockia Arulnathan A

<b>Sample Usage:</b>

<pre>
from smartutils.timeutil import get_exec_time
@get_exec_time
def sample():
    print("hi")
</pre>