Skip to content

PyBase is a python module to allow the storage of variables or other

Notifications You must be signed in to change notification settings

Illigo19/PyBase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

PyBase

PyBase is a python module to allow the storage of variables or other

Mini Wiki :

description and use of PyBase

-Initialization

To install the package : pip install PyBase-manager
introduce your code by :from PyBase import *

- initiator and spectator functions :

These functions are both unnecessary and mandatory.
The first : (obj).getData("myfile") It plays the role of dataName = open(myfile.txt, "at") and therefore can easily be replaced by it, but one of the two is required. Warning : Do not give the file extension (here .txt) It will not be able to find it.

The second : (obj).showData(data)the only purpose of this function is to display the complete contents of what has been recorded by PyBase

- Table and content management function

The record base functions from table and in its tables one and/or contents. So there are the functions related to the tables and those related to the contents

1) Table management :

newTab() (obj).newTab(data, "Name") 1 checks if the table already exists and if it already exists he does not recreate it. 2 does not care if a table of the same does not exist or not, can be dangerous because when deleting one of the tables, the 2 will be.

delTab() (obj).delTab(data, "Name") This function allows you to delete a complete table and with it are contained Here the 'Name' table will be deleted.

appendTab()(obj).appendTab(data, "Name", "Andrew")This function allows to add to a table (here 'Name') content (here 'Andrew')
The result in the file: tN::Name : {Andrew}

findTab()(obj).findTab(data, "Hello world")This boolean function only allows you to search for a table in the database, it returns True if the table exists.
Here we search for 'Hello world' among 'data'

2) Content management :



getCont()(obj).getCont(data, "Name") Allows to retrieve the contents of a table Here the table 'Name'

delCont()(obj).delCont(data, "Name", "Joseph") Deletes a particular content in a particular table Here, delete 'Joseph' in table 'Name'

replaceCont()(obj).replaceCont(data, "Name", "Chloé") replaces all the existing content of a table with the given content Here, replace the contents of 'Name' by 'Chloe'.

- More information



The constructor used is by default obj = PyBase.PyBase()
As well as 'data' comes from data = obj.getData("myfile")

The PyBase.py python isn't yet commented but it will be soon ;)

About

PyBase is a python module to allow the storage of variables or other

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages