expdb
Python library and CLI for exporting MySQL databases
Installation
-
Pre-requisites
MySQL server
Python 3.9+
-
Using
git
- Clone the repository to your local machine
git clone https://github.com/Devansh3712/expdb.git
- Install
python setup.py install
-
Using PyPI
- Windows
pip install expdb
- Linux/MacOS
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
from expdb import JSON
OBJ = JSON(username = "root", password = "root", database = "test")
EXPORT = OBJ.exportmany(tables = ["users", "sales"])