Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/captpyrite/primitivedb

The most primitive way of storing data inside a database!
https://github.com/captpyrite/primitivedb

flask pandas python

Last synced: 3 days ago
JSON representation

The most primitive way of storing data inside a database!

Awesome Lists containing this project

README

        

Primitive-Database (primitveDB)

![logo](https://user-images.githubusercontent.com/79488582/183230798-31b73d18-3154-4928-b746-4e89ac9f486d.jpg)

# About PrimitiveDB
Primitive-Database is a lightweight databasing library written in Python3. It uses CSV(Comma Separated Values) file(s) to store data, making it easy to perform simple and minimalistic tasks with great and stable performance.

# Installation

```
pip install primitiveDB
```
* Tested on windows and Linux only



# Using PrimitiveDB

Server

Creating a simple vertical database

```python
from primitiveDB.server import Server

Server.init.db()
Server.init.id()

Server.init.columns(["Name", #Title for column 1
"Age", #Title for column 2
"Address"]) #Title for column 3

Server.init.auth()

# IP PORT
Server.init.uri("0.0.0.0" , 8080) #Server IP is `http://localhost:8080` or `http://127.0.0.1:8080`

Server.run()
```


Client


Connecting to the database

```python
from primitiveDB.client import Client

DB = client.connect()
DB.set_auth()
```

Fetching data from the database

```python
from primitiveDB.client import Client

DB = client.connect()
DB.set_auth()

DB_data = DB.fetch() #returns a pandas.datafraem
print(DB_data)
```

Inserting data into the database

```python
from primitiveDB.client import Client

DB = client.connect()
DB.set_auth()

DB_data = DB.fetch()

DB_data["Name"] = ["Jack", # Adding `Jack` to first row into Names
"James"] # Adding `Jill` to second row into Names

DB_data["Age"] = [10, # Adding the age for `Jack`
07] # Adding the age for `James`

DB_data["Adress"] = ["123 NAME ST", # Adding the adress for `Jack`
"123 MAIN ST"] # Adding the adress for `James`

DB.insert(DB_data)
```