Metadata-Version: 2.1
Name: expdb
Version: 1.0
Summary: Python Library and CLI for exporting MySQL databases
Home-page: https://github.com/Devansh3712/expdb
Author: Devansh Singh
Author-email: devanshamity@gmail.com
License: MIT
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE

<h1 align = "center"> expdb </h1>
<p align = "center"><i> Python library and CLI for exporting MySQL databases </i></p>

<p align = "center">
  <a href = "https://www.python.org"><img src="https://img.shields.io/badge/python%20-%2314354C.svg?&style=for-the-badge&logo=python&logoColor=white"/></a>
  <a href = "https://www.mysql.com/"><img src=https://img.shields.io/badge/MySQL-00000F?style=for-the-badge&logo=mysql&logoColor=white/></a>
  <a href = "./LICENSE"><img src = "https://img.shields.io/github/license/Devansh3712/PySQL?style=for-the-badge"></a>
</p>

---

## Installation

- Pre-requisites
    - `MySQL server`
    - `Python 3.9+`

- Using `git`
    - Clone the repository to your local machine
    ```console
    git clone https://github.com/Devansh3712/expdb.git
    ```
    - Install
    ```console
    python setup.py install
    ```

- Using PyPI
    - Windows
    ```console
    pip install expdb
    ```
    - Linux/MacOS
    ```console
    pip3 install expdb
    ```

## Usage

- CLI
    ```
    Usage: expdb [OPTIONS] COMMAND [ARGS]...

    CLI for exporting MySQL databases in various file formats

    Available formats: BIN, CSV, JSON, SQL

    Options:
    --help  Show this message and exit.

    Commands:
    exportall   Export all tables from a database
    exportdb    Export a whole database in SQL file format
    exportmany  Export multiple tables from a database
    exportone   Export a single table from a database
    ```
    - `exportall`
    Exports all tables in the input database

    - `exportdb`
    Export a whole database in SQL format

    - `exportmany`
    Export multiple tables from the input database

    - `exportone`
    Export a single table from the input database

- Library

```python
from expdb import JSON

OBJ = JSON(username = "root", password = "root", database = "test")
EXPORT = OBJ.exportmany(tables = ["users", "sales"])
```


