Skip to content

Commit

Permalink
updated_version_1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvaneshkm committed Sep 27, 2024
1 parent 5b28806 commit 8c405c3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 20 deletions.
53 changes: 34 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,66 @@
# Installation
To install the package, use pip:
```bash
pip install dbsconnector==1.1
pip install dbsconnector==1.2
```

# How to use this package?

## 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!

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 8c405c3

Please sign in to comment.