-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
50 lines (35 loc) · 1.47 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Disco
Disco is minimalist password encoded database system made in python, that emphasizes simplicity and efficiency
# Installation
```
pip install DiscoDB
```
# Examples
## making a new database and table
```python
import DiscoDB
myclient = DiscoDB.Disco() # initialize database client
myclient.addDatabase('example') # make a new database called 'example'
# you can also specify a custom password instead of the default "12345678" and a custom salt instead of 'salt_'
# by setting the arguments pw and sl respectively
print(myclient['example']) # use a db_client[db_name] syntax to access database
myclient['example'].addTable('mytable', {'column1': [], 'column2': []})
# in the example above we first access our database by using myclient['example']
# next we use the addTable method to add a new table to our database called 'mytable'
# the second argument is a dictionary containing column names 'column1' and 'column2' and their initial values (empty in both case)
```
## saving a database
```python
...
myDatabase['example'].commit()
# the commit method saves the database in a file with the .dd extension encoded with an elliptic curve
```
## loading a database
if you already have a database, to access it you can follow the example below
```python
import DiscoDB
myclient = DiscoDB.Disco()
myclient.loadDatabase('example')
# if you used the default settings when making your database this is enough else you can specify the pw and sl argument again
print(myclient['example'])
```