semvec/pypi-packages huggingface dataset:
db-converter 0.2.2
Data migration. MongoDB to MySQL - MySQL to MongoDB
Keywords: python,mongodb,mysql,database,MySQL to MongoDB,MongoDB to MySQL,data migration


# DB Converter - MySQL to MongoDB | MongoDB to MySQL
![db-converter-mysql-to-mongodb-mongodb-to-mysql](dbconverter_main_img.png)

This project is a python library that facilitates data conversion between MongoDB and MySQL databases.

## Installation

You can use the following command to install the project:

```bash
pip install db-converter
```

## Usage

By using this project, you can convert a specific table from a MySQL database to a MongoDB collection. 

You can also convert a specific collection from a MongoDB database to a MySQL table.

```python
from dbconverter.converter import Converter

# DW bilgileri
DATAWAREHOUSE_HOST = "000.00.0.00"
DATAWAREHOUSE_USER = "admin"
DATAWAREHOUSE_PASSWORD = "password"
port_number = 8080

uri = "mongodb+srv://admin:password!@cluster0.smovknl.mongodb.net/?retryWrites=true&w=majority"
mysql_bilgilerim = {'host': DATAWAREHOUSE_HOST, 'user': DATAWAREHOUSE_USER, 'password': DATAWAREHOUSE_PASSWORD,
                    'port': port_number, 'database': 'your_db_name'}

my_converter = Converter(uri, **mysql_bilgilerim)
my_converter.mysql_to_mongodb('test_table')
```

## Used Libraries
- `pandas`: Used for working with data frames.
- `pymongo`: Used for communicating with MongoDB.
- `pymysql`: Used for connecting to the MySQL database.


## Classes and Methods
`Converter`
- `__init__(self, mongo_uri, **kwargs)`: Creates an instance of Converter by taking MongoDB and MySQL connection information.
- `df_to_json(df) -> list` : Converts a DataFrame into JSON objects. 
- `mysql_to_mongodb(self, table_name=None)` : Converts data from a specific MySQL table to a MongoDB collection.

`MongoDb`
- `__init__(self, uri)`: Establishes a connection to MongoDB.
- `connect(self)` : Connects to the MongoDB server.
- `insert_data(self, json_data, collection)` : Inserts JSON data into the specified collection.
- `get_data(self, collection, query=None)` : Retrieves data from the specified collection.

`MySQLConnector`
- `__init__(self, host, user, password, port_number, database)` : Establishes a connection to MySQL.
- `connect(self)` : Connects to the MySQL database.
`disconnect(self)` : Closes the connection.
`fetch_data(self, table) -> pd.DataFrame` : Fetches data from the specified table and converts it into a DataFrame.

## Licence

This project is licensed under the MIT License. See the LICENSE file for more information.
seiketsu-async-api 1.0.4
A Python library to interact with a chat API

# Seiketsu-API

## Installation

Install the library using `pip`:

```
pip install seiketsu-async-api
```

## Usage

First, import the `ApiSeiketsu` class from the library:

```python
from api_seiketsu import ApiSeiketsu, ApiSeiketsuImage
```

### Initialize the ApiSeiketsu object

In the token field, insert your token, or the public one: `3rnPH1ooGMjui9fwf8y4Ueta9ivDJfbae0lTNtMRGoRddzMAhKDr=dgq7yyfJR8v`

Create an instance of the `ApiSeiketsu` class:

```python
token = 'your_token'
seiketsu = ApiSeiketsu(token)

```

### Read message

To get the latest message, call the `read_message` method:

```python
sender, message_text = seiketsu.read_message()
```

`sender` contains the sender's nickname, `message_text` contains the text of the message.


If you want `read_message` to run all the time you can loop:

```python
while True:
    sender, message_text = seiketsu.read_message()
    print(f'{sender}: {message_text}')
```

### Write message

To write a new chat message, call the `write_message` method, passing `alias` and `message_text` as arguments:

```python
seiketsu.write_message(alias="John", message_text="Hello, world!")
```

### Upload image

To upload an image, call the `upload_image` method, passing the image file as an argument.

```python
seiketsuImage = ApiSeiketsuImage()
image_file = open('C:\\folder\\image.png', 'rb')   # Use the correct file path to your image
image_url = seiketsuImage.upload_image(image_file)   # Call the upload_image function to upload the image
```

To display an image in chat, use the `write_message` method.

## Example

Here is a simple example demonstrating the use of the Seiketsu-API. Reads the last message, checks if the bot wrote it himself, if not, repeats it.

```python
from api_seiketsu import ApiSeiketsu

token = '3rnPH1ooGMjui9fwf8y4Ueta9ivDJfbae0lTNtMRGoRddzMAhKDr=dgq7yyfJR8v'
seiketsu = ApiSeiketsu(token) # Initialize seiketsu API

aliasBot = "TestBot" # Name for Bot

while True:
    # Waiting for a new message
    sender, message = seiketsu.read_message()

    # Checking that this is not a message from a bot
    if sender != aliasBot + '#BOT':
        # Sending a reply message
        seiketsu.write_message(alias=aliasBot, message_text=message)

    # Message output to console
    print(f'Repeated message: {aliasBot}: {message}')
```
coolmath1 0.5
A simple math library

# coolmath

A simple Python library for basic mathematical operations.

## Installation

You can install this library using pip:

```bash
pip install coolmath1
```
# Usage

```bash
from coolmath1 import add, subtract, multiply, divide

result_add = add(5, 3)
result_subtract = subtract(10, 4)
result_multiply = multiply(6, 7)
result_divide = divide(8, 2)

print(f"Addition: {result_add}")
print(f"Subtraction: {result_subtract}")
print(f"Multiplication: {result_multiply}")
print(f"Division: {result_divide}")