@@ -4,18 +4,20 @@ Simple to use image handler for python sqlite3.
44# Functions
55Function Name | Parameters | Returns
66------------- | ---------- | -------
7- ** init** | ** databasePath** : * str* <br > ** tableName** : * str* | - |
8- ** startConnection** | - | - |
9- ** imageSelector** | ** path** : * str* | ** bytesContent** : * bytes* <br > ** extensionType** : * str* |
10- ** addImage** | ** imageName** : * str* <br > ** imageBytes** : * bytes* <br > ** extensionType** : * str* | - |
11- ** getSaveImage** | ** imageName** : * str* <br > ** savePath** : * str* | - |
12- ** isImageExists** | ** imageName** : * str* | ** isExists** : * bool* |
13- ** deleteImage** | ** imageName** : * str* | - |
14- ** updateImage** | ** imageName** : * str* <br > ** newImageBytes** : * bytes* <br > ** newExtensionType** : * str* | - |
7+ ** [ init] [ 1 ] ** | ** databasePath** : * str* <br > ** tableName** : * str* | - |
8+ ** [ startConnection] [ 2 ] ** | - | - |
9+ ** [ imageSelector] [ 3 ] ** | ** path** : * str* | ** bytesContent** : * bytes* <br > ** extensionType** : * str* |
10+ ** [ addImage] [ 4 ] ** | ** imageName** : * str* <br > ** imageBytes** : * bytes* <br > ** extensionType** : * str* | - |
11+ ** [ getSaveImage] [ 5 ] ** | ** imageName** : * str* <br > ** savePath** : * str* | - |
12+ ** [ isImageExists] [ 6 ] ** | ** imageName** : * str* | ** isExists** : * bool* |
13+ ** [ deleteImage] [ 7 ] ** | ** imageName** : * str* | - |
14+ ** [ updateImage] [ 8 ] ** | ** imageName** : * str* <br > ** newImageBytes** : * bytes* <br > ** newExtensionType** : * str* | - |
1515
1616<br >
1717
18+
1819[ See definitions] ( #definitions )
20+ [ 1 ] : #-__init__(self,-databasePath-:-str-=-"database.db",-tableName-:-str-=-"images")-->-None
1921
2022# Usage
2123- <h3 > Importing & Creating Handler </h3 >
@@ -74,6 +76,54 @@ print("Bytes Length: " + str(len(bytesOfImage)) + "\nExtension Type: " + extensi
7476
7577# Definitions
7678
79+ ### __ init__ (self, databasePath : str = "database.db", tableName : str = "images") -> None
80+
81+ - Sets the * self.databasePath* , * self.tableName* and calls * startConnection()* func.
82+
83+ <hr >
84+
85+ ### startConnection(self) -> None
86+
87+ - Starts the connection with SQLite Database.
88+
89+ <hr >
90+
91+ ### imageSelector(self, path : str = None) -> bytesContent[ bytes] , extensionType[ str]
92+
93+ - Selects an image and returns the image's * bytes content* and * extension type* .
94+ - ** bytesContent[ bytes] :** * Bytes content of image.*
95+ - ** extensionType[ str] :** * Extension type like png, jpg or something...*
96+
97+ <hr >
98+
99+ ### addImage(self, imageName : str, imageBytes : bytes, extensionType : str = "png") -> None
100+
101+ - Adds an image to database.
102+
103+ <hr >
104+
105+ ### getSaveImage(self, imageName : str = None, savePath : str = "savedImage") -> None
106+
107+ - Saves the * previously saved image in the database* as an * image to the given path* .
108+
109+ <hr >
110+
111+ ### isImageExists(self, imageName : str = None) -> isExists[ bool]
112+
113+ - Checks if image exists in database * by image name* .
114+ - ** isExists[ bool] :** * True if image exists in the database otherwise False*
115+
116+ <hr >
117+
118+ ### deleteImage(self, imageName : str = None) -> None
119+
120+ - Deletes image * by name in database* .
121+
122+ <hr >
123+
124+ ### updateImage(self, imageName : str = None, newImageBytes : bytes = None, newExtensionType : str = None) -> None
125+
126+ - Updates image * by name in database* .
77127
78128# TODO's
79129- [x] Write a readme file
@@ -83,5 +133,5 @@ print("Bytes Length: " + str(len(bytesOfImage)) + "\nExtension Type: " + extensi
83133- [x] Raise some errors
84134- [x] Add Usage to readme
85135- [x] Upload to pypi
86- - [ ] Write a description of each function for README
136+ - [x ] Write a description of each function for README
87137- [ ] Add some cmd things
0 commit comments