diff --git a/README.md b/README.md index 8ab5cf8..fd843f4 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ # Installation To install the package, use pip: ```bash -pip install dbsconnector==1.1 +pip install dbsconnector==1.2 ``` # How to use this package? @@ -25,43 +25,58 @@ pip install dbsconnector==1.1 ## Connecting to csv ```py # import the module: -from dbsconnector import databases -# load the data: -df = databases.load_csv(filepath='sample.csv', delimiter=',') -# display the data: -df +from dbsconnector.databases import CSV + +# load csv file: +df = CSV().load_csv(filepath="filedir/filename.csv", delimiter=",") + +# convert dataframe to csv file: +CSV().to_csv(data=df, filepath="filepath.csv") ``` + ## Connecting to Excel ```py # import the module: -from dbsconnector import databases +from dbsconnector.databases import Excel + # load the data: -df = databases.load_excelsheet(filepath='sample.xlsx', sheet_name='sample_sheet') -# display the data: -df +df = Excel().load_excelsheet(filepath='filedir/filename.xlsx', sheet_name='sheet_name') + +# convert dataframe to excel sheet: +Excel().to_excel(data=df, filepath='filedir/filename.xlsx', sheet_name='sheet_name') ``` + ## Connecting to gsheet ```py # import the module: -from dbsconnector import databases +from dbsconnector.databases import GSheet + # load the data: -df = databases.load_gsheet(gsheet_id='17r9f4BL7sjmdLBnt92OdQP3CHK5bdT3hozg6DUJXGqU',sheet_name='sample_sheet') -# display the data: -df +df = GSheet().load_gsheet(gsheet_id='17r9f4BL7sjmdLBnt92OdQP3CHK5bdT3hozg6DUJXGqU',sheet_name='sample_sheet') ``` + ## Connecting to MongoDB ```py # import the module: -from dbsconnector import databases -# load the data: -df = databases.load_mongodbdata(host='localhost', database='sample_database', collection='sample_collection') -# display the data: -df +from dbsconnector.databases import MongoDB + +# load data from mongodb: +df = MongoDB(host_url="mongodb://localhost:27017").load_data(database="database_name", collection_name="collection_name") + +# upload data to mongodb: +MongoDB(host_url="mongodb://localhost:27017").upload_data(database="database_name", collection_name="collection_name", data=df) + +# upload any kind of objects (preprocessor object or ML model object) to mongodb: +MongoDB(host_url="mongodb://localhost:27017").upload_object(database="database_name", collection_name="collection_name", object_name="preprocessor_object", object_=preprocessor) + +# loading object from mongodb: +pre_obj = MongoDB(host_url="mongodb://localhost:27017").load_object(database="database_name", collection_name="collection_name", object_name="preprocessor_object") ``` + # Contributions * Contributions are welcome! Please open an issue or submit a pull request on GitHub for adding new features, fixing bugs, or improving documentation. Open-source collaboration is highly encouraged! diff --git a/setup.py b/setup.py index 65253f8..4de6492 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ # setup: # basic info: PKG_NAME = 'dbsconnector' -__version__ = '1.1' +__version__ = '1.2' AUTHOR_USER_NAME = 'yuvaneshkm' AUTHOR_EMAIL = 'yuvaneshkm05@gmail.com' REPO_NAME = 'dbsconnector'