semvec/pypi-packages huggingface dataset:
pyconfigurathon 0.1.2
Simple python package to use a json file as a configuration file
License: MIT
Requires Python: >=3.4,<4.0

#   PyConfigurathon

A python package for making it easy to use and manage configuration files in your python applications.

## Installation

#### Using poetry
    `poetry add pyconfigurathon`

#### Using pip
    `pip install pyconfigurathon`


## How to use

The recommended way to use this module is to have a module dedicated to your configuration. Eg. config.py

### Use with an absolute path to the configuration file:
```
from pyconfigurathon.configurator import configurator


def get_config(config_name, file_path="/path/to/file/settings.json"):
    cf = configurator(file_path)

    return cf.get(config_key=config_name)
```

### Use with a path to the configuration file relative to the config.py file
```
import os
from pyconfigurathon.configurator import configurator


def get_config(config_name, file="settings.json"):
    conf = configurator(os.path.join(os.path.dirname(__file__), file))

    return conf.get(config_key=config_name)
```

Please note that these are only examples to help you get started faster. There are other ways to use this package.
pybeauty 1.0
Python module for beautifully varying RGB colour sets which can be used for setting colours anywhere!
License: MIT
Keywords: Beauty,RGB,PyBeauty,Stunning backgrounds,colours,varying colours

# PyBeauty

Python module for beautifully varying RGB colour sets which can be used for setting colours anywhere!
This module basically varies RGB values in various random ranges via threading.Timer() executing continously after very
small interval of time i.e. in milliseconds hence resulting in beautiful transition of colours.

## Installation

Simply using PyPi:

```
pip install pybeauty
```

## Usage

Simply use this code (Modify according to your needs):

```python
from pybeauty import Beauty

def on_new_color(rgb_color):
    r_value = rgb_color[0]
    g_value = rgb_color[1]
    b_value = rgb_color[2]
    #Now you can do anything with the RGB values (set as background, set as text colour, etc..).

Beauty(Parameters, on_new_color) #Parameters is a dictionary for optional parameters (More about them specified below).
```

Optional Parameters that are available are listed below in Parameters section and have to be passed as a Dictionary (keys as name of parameters listed in Parameters section and value is your desired choice according to the options available for that parameter as specified in the Parameters section) which will be the first parameter for Beauty() constructor.

## Parameters
- ### mode (Optional)
  
  Specifies colour set in which the colours have to vary.
  
  - **Parameter Value Type:** str or list.
  
  - **Options for mode parameter**
    - **"dark":** Varies the colour in dark colours only (useful for dark mode projects).
    - **"light":** Varies the colour in light colours only (useful for light mode projects).
    - **[start_rgb, end_rgb]:** Varies the colour from start_rgb value (can be from 0 to 255) to end_rgb value (can be from 0 to 255).
  
  - **Default Value:** "" (i.e. varies from 0 to 255 RGB Values).

- ### start (Optional):
  
  Specefies colour in RGB format from which colours have to start varying.
  
  - **Input type for start parameter:** list [R_Value, G_Value, B_Value] (eg. [0, 0, 0] for black).
  
  - **Default Value:** [0, 0, 0] (for "dark", none or other mode parameter specified) and [255, 255, 255] (for "light" mode parameter specified).

- ### time (Optional):
  
  Specifies the time in milliseconds after which the colour is changed according to its range.
  Useful for decreasing the time when using on slow hardware for maintaining the smoothness.
  
  - **Parameter Value Type:** int.
  
  - **Default Value:** 40 ms (Just perfect for majority hardware types).
  
So go ahead and enjoy the beauty of time varying RGB colour sets!
m-profiling-sdk 0.1.1
Mobio Profiling Libs
License: MIT

- **Thư viện Consumer của Profiling** :
* Tự động tạo kafka topics
```python
from mobio.libs.kafka_consumer_lib.helpers.ensure_kafka_topic import create_kafka_topics
create_kafka_topics(['test1'])
```
* Kafka Python Consumer
    
```python
from mobio.libs.kafka_consumer_lib.helpers.kafka_python_consumer_manager_v2 import KafkaPythonConsumerManagerV2, KafkaPythonMessageQueue
from mobio.libs.kafka_consumer_lib import ConsumerGroup
import os
from pymongo import MongoClient

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

    try:
        url_connection = os.getenv('PROFILING_MONGODB_URI')
        client = MongoClient(url_connection, connect=False)
    except Exception as ex:
        print('ERROR BaseModel::create_db: %r', ex)
        client = None

    return client

# Đây là class xử lý message
class KafkaPythonConsumer(KafkaPythonMessageQueue):
    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):
        try:
            print('payload: {}'.format(payload))
        except Exception as e:
            print("ThreadMergeConsumer::ERR: {}".format(e))

# Đây là function khởi tạo consumers
def start_kafka_python():
    mongo_client = create_db()
    # FORMAT: CLASS, CLIENT-MONGO, TOPIC, NUMBER_CONSUMER, GROUP_NAME
    consumer_list = [(KafkaPythonConsumer, mongo_client, 'test1', 1, ConsumerGroup.DEFAULT_CONSUMER_GROUP_ID)]

    if consumer_list:
        manager = KafkaPythonConsumerManagerV2(consumer_list)
if __name__ == "__main__":
    start_kafka_python()
```
    
* Confluent Kafka Consumer

```python
import os
from mobio.libs.kafka_consumer_lib import ConsumerGroup
from pymongo import MongoClient 
from mobio.libs.kafka_consumer_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('PROFILING_MONGODB_URI')
        client = MongoClient(url_connection, connect=False)
    except Exception as ex:
        print('ERROR BaseModel::create_db: %r', 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)]

    if consumer_list:
        manager = ConfluentConsumerManager(consumer_list)


if __name__ == "__main__":
    # test_create_topic()
    # start_kafka_python()
    start_confluent_consumer()
```
        
** Update version 0.1.1
* support Enable/Disable retry consumer
regressionAlgorithm 0.1
Linear Regression Algorithm
License: MIT
Keywords: linear-regression,machine-learning,supervise-learning

# POLINOMIAL REGRESSION ALGORITHM

```bash
pip3 install regressionAlgorithm
```
## POLYNOMIAL ORDER 1

!['formula'](https://i.postimg.cc/R3qrYY4P/least-squared.png)

```python
from regressionAlgorithm import PolynomialOrderOne
import matplotlib.pyplot as plt

# value
x = [1,2,3,4,5]
y = [5,4,3,2,1]

# intial
rl = PolynomialOrderOne()
rl.fit(x,y)
rl.start()

# get data
print(rl.plot())
print(rl.line())

# data visualization

plt.figure(figsize=(10,7))
plt.scatter(x,y)
plt.plot(x, rl.line())
plt.savefig("visual.png")

# r squared
print(rl.r_squared()) # result 1.0

# r value
print(rl.r_value()) # result -1.0
```
![graph.png](https://i.postimg.cc/hvd4PJR2/graph.png)

### PREDICT Y VALUE
```python
...
x = 10
# formula (y = a + b * x) = (y = a + b * 10)
print(rl.predict(x)) # result -4.0
```

## POLYNOMIAL ORDER 2

!['formula](https://i.postimg.cc/18vhJShn/kuadratik.png)

```python
from regressionAlgorithm import PolynomialOrderTwo
import matplotlib.pyplot as plt

# value
x = [1,2,3,4,5]
y = [5,4,3,2,1]

# intial
q = PolynomialOrderTwo()
q.fit(x,y)
q.start()

# result
print(q.plot())
print(q.r_square())

# data visualization
plt.figure(figsize=(10,7))
plt.scatter(x,y, color="blue")
plt.plot(x, k.draw_line(), color="red")
plt.savefig("quadratic.png")
```
![quadratic.png](https://i.postimg.cc/G2wVdprj/quadratic.png)

### PREDICT Y VALUE

```python
...
x_pred = 5

# formula y = a + b * x + c * square(x) -> y = a + b * x_red + c * square(x_pred)
print(q.predict(x_pred)) # result 0.9999999999997522
```