Package: menousdb
<title>Document</title>
    <style>
        .container{
            align-items: center;
        }
        .image{
            max-height:200px;
        }
    </style>IntroductionMenous DB is a simple and elegant key value database. It uses a structured file system to store key values. The database is written in python and can be used directly in python using the menousdb pip package.InstallationYou can install the menousdb module by using the pip package manager. You can install the package manager on all platforms by using the following commands:For Linux use the following commands

$ sudo apt update
$ sudo apt upgrade
$ sudo apt-get install python3-pipFor Mac OS use homebrew to install pip

$ brew install python3-pipNext we will use the pip package manager to install the library. Make sure you have pip set up properly and you can access it through your terminal window.(Windows)

$ pip install menousdb 

(Mac OS and Linux)

$ pip3 install menousdbDocumentationImporting the moduleTo import the menousdb import simply usefrommenousdbimport*Initializing the databaseTo create a database from scratch use:# Using the imported class from the import statementdb=MenousDB(url="http://localhost:5555/",key="YOUR API KEY",database="DATABASE")# Checking if the database existsifnotdb.checkDbExists():# If not create the databasedb.createDb()Checking if the database exists# isCreated is either True or FalseisCreated=db.checkDbExists()Reading the entire databaseTo read the entire database we will use the readDb method. The readDb method returns a dictionary that can be converted to a dataframe.data=db.readDb()Deleting the entire databaseTo delete the entire database we will use the deleteDb method.ifdb.checkDbExists():db.deleteDb()else:print("Database not found")Creating a new tableTo create a new table, the parameters are the name of the table and the attributes of the new table. The attributes parameter must be a list of strings.# Defining the table name and attributestable_name="test"attributes=["name","age","gender"]# Creating a new table using the defined variabledb.createTable(table_name,attributes)Checking if a table existsTo check if a table exists you can use the following which will return  a boolean value of True or False.# Defining the table nametable_name="test"# Cheking the table existsisCreate=db.checkTableExists(table_name)Inserting values into the databaseTo insert new values into the table you can use the following code. The parameter values must be a dictionary whose order of keys must exactly match the order of the attributes passed in the creation of the table.# Defining table name and valuestable_name=testvalues={"name":"John Doe","age":"15","gender":"male"}db.insertIntoTable(table=table_name,values=values)Selecting the entire tableTo get the complete data of a table use the following code:table_name="test"# Getting all the data in the tabledata=db.getTable(table_name)Selecting Values with conditionsTo search for values with conditions you can use the following code. The parameters required are the table name and the conditions which will be a dictionary.table_name="test"conditions={"name":"John Doe"}# Contains all the values where the name is John Doedata=db.selectWhere(table=table_name,conditions=conditions)Selecting columnsTo select only specefic columns from the table you can use the following code. The parameters include the table name and a list of names of columns you want to select.table_name="test"columns=["name","age"]# contains all the column valuesselectedData=db.selectColumns(table_name,columns)Selecting columns with conditionsTo select columns with conditions you can use the following code. The parameters include the table name, the target columns and the conditions. conditions will be a dictionary and columns will be an array.table_name="test"columns=["name","age"]conditions={"name":"John Doe"}data=db.selectColumnsWhere(table_name,columns,conditions)Updating valuesTo update the values in the table we need the conditions and the replacement values. The parameters are the table name, the conditions and the replacement values.table_name="test"conditions={"name":"John Doe"}values={"name":"William Smith"}# This will replace the value of every row where the# name is John Doe to William Smithdb.updateWhere(table=table_name,conditions=conditions,values=values)Deleting valuesTo delete values from a table with conditions use the following code. The parameters are the table name and the conditions.table_name="test"conditions={"name":"John Doe",}db.deleteWhere(table=table_name,conditions=conditions)Deleting the entire tableTo delete the entire table just use the deleteTable functions. Its only parameter is the table name.table_name="test"db.deleteTable(table_name)Getting all the databasesTo get a list of all the databases use the following code.databases=db.getDatabases()