bearDB


NamebearDB JSON
Version 1.1.2 PyPI version JSON
download
home_pagehttps://github.com/teddyoweh/Beardb
SummaryDatabase system implementing encrypted versions JSON of data. Easy to access, manage and deploy remotely
upload_time2022-12-23 01:13:54
maintainer
docs_urlNone
authorTeddy Oweh
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements cryptography dotenv
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![logo](https://www.beardb.net/assets/logo.d0f8a85f.png)
# bearDB
Database system implementing AES encrypted versions JSON of data. Easy to access, manage and deploy remotely

[Web Documentation](https://beardb.net)

 ## Database Architecture
 
 ```
Project
  -Database
    -Bucket
       -Data
 ```
## Outline
- [Install Libraries](#install-libraries)
- [Import Libraries](#import-libraries)
- [Initialize Project](#initialize-project)
- [Insert Data into Bucket](#insert-data-into-bucket)
- [Fetch Data From ID](#fetch-data-from-id)
- [Fetch Data From Query](#fetch-data-from-query)
- [Updata Data in Bucket From Query](#updata-data-in-bucket-from-query)
- [Update Data From Bucket From ID](#update-data-from-bucket-from-id)
- [Delete Data From Bucket From Query](#delete-data-from-bucket-from-query)
- [Working With BeardbAPI](#working-with-beardbapi)

### Install Libraries
```sh
$ python3 -m pip install bearDB
```

#### Import Libraries
```py
from beardb.beardb import Beardb
from beardb.beardb import Bucket
```
#### Initialize Project
```py

project = Beardb('projectname')
project.load_database('class') 
```
#### Initialize Bucket(DataBase File)

```py
users = Bucket(project=project, bucket_name='users') # Project variable defined in the initialization 
```

#### Insert Data into Bucket
```py
data = {
       'name':'Teddy Oweh',
       'Random Data':'Golf'
}
users.insert(data=data)
 
```
 
 

#### Fetch Data From ID
```py

userinfo = users.fetchbyID(id="ae0ca44e-5301-11ed-8d24-a6bd5a94b3a6")

```


#### Fetch Data From Query
```py
query= {
       'name':'Teddy Oweh',
       'Random Data':'Golf'
}
userinfo = users.fetchData(query=query)

```

#### Updata Data in Bucket From Query
```py
query= {
       'name':'Teddy Oweh',
       'Random Data':'Golf'
}
newdata = {
       'name':'Teddy Oweh',
       'Random Data':'Ping Pong',
       'Added Data':'College'
       
}

users.update(query=query,data=newdata)

```

#### Update Data From Bucket From ID
```py
  
newdata = {
       'name':'Teddy Oweh',
       'Random Data':'Ping Pong',
       'Added Data':'College'
       
}

users.updatebyId(id='ae0ca44e-5301-11ed-8d24-a6bd5a94b3a6',data=newdata})
```

#### Delete Data From Bucket From Query

```py
query= {
       'name':'Teddy Oweh',
       'Random Data':'Golf'
}
 

users.delete(query=query})
 
```
#### Delete Data From Bucket From ID

```py

users.deletebyId(id="ae0ca44e-5301-11ed-8d24-a6bd5a94b3a6")


### Test Code
```py
beardb_ = Beardb('projects')
beardb_.load_database('computers')
computers=Bucket(beardb_,'computers')
computers.insert({'model':'lenovo','ram':'8gb','hdd':'1tb','processor':'i5'})


```
## Working with BeardbAPI

In Order to communicate with the microservice [beardbAPI](https://github.com/teddyoweh/beardb-api) deploys when launched. This client Library consumes APIs effienctly and returns the data and status code.

## Outline
- [Import Library](#importing-library)
- [Initialize Client Object](#initialize-client-object)
- [Get User Data](#get-user-data)
- [Create New Project](#create-new-project)
- [Create New Database](#create-new-database)
- [Create New Bucket](#create-new-bucket)
- [Insert Data](#insert-data)
- [Fetch Data by Query](#fetch-data-by-query)
- [Fetch Data by ID](#fetch-data-by-id)
- [Update Data by Query](#update-data-by-query)
- [Update Data by ID](#update-data-by-id)
- [Delete Data by Query](#delete-data-by-query)
- [Delete Data by ID](#delete-data-by-id)
- [Get Buckets](#get-buckets)
- [Get Databases](#get-databases)
- [Get Projects](#get-projects)


### Importing Library
```py
from beardb.beardb import Client
```

### Initialize Client Object
Whenever a new user is created, is always returns the secret to be able to access the data.

```py
host='127.0.0.1'
port=5555
email='teddyoweh@gmail.com'
secret='3687065edf2fdc64bbeb8cdac409ac352fdb65f01423159842d19283309cb70c'
client = Client(
                host=host,
                port=port,
                email=email,
                secret=secret
              )           
```

### Get User Data
```py
cient.mydata()
```

### Create New User
```py
email='teddyoweh@gmail.com'
password='myrealpassword'
fullname='Teddy Oweh'

client.createnewuser(
                     fullname=fullname
                     email=email
                     password=password
)
```

### Create New Project
```py
project='TestProject'
client.createnewproject(
                       project=project
)
```
### Create New Database
```py
project='TestProject'
database='TestDatabase'
client.createnewdatabase(
                         project=project,
                         database=database
)   
```

### Create New Bucket
```py
project='TestProject'
database='TestDatabase'
bucket='TestBucket'
client.createnewbucket(
                         project=project,
                         database=database,
                         bucket=bucket
)   
```
### Insert Data
```py
project='TestProject'
database='TestDatabase'
bucket='TestBucket'
data={'name':'teddy',age:1}
client.insertdata(
                         project=project,
                         database=database,
                         bucket=bucket
)   
```

### Fetch Data by Query
```py
project='TestProject'
database='TestDatabase'
bucket='TestBucket'
query={'name':'teddy',age:1}
client.fetchdata(
                         project=project,
                         database=database,
                         bucket=bucket,
                         query=query
)   
```

### Fetch Data by ID
```py
project='TestProject'
database='TestDatabase'
bucket='TestBucket'
id='b419840a-7e04-11ed-84f8-324d38bf6d75'
client.fetchBYID(
                         project=project,
                         database=database,
                         bucket=bucket,
                         id=id
)   
```


### Update Data by Query
```py
project='TestProject'
database='TestDatabase'
bucket='TestBucket'
data={'name':'teddy',age:1}
query='{name':'teddy'}
client.updatedata(
                         project=project,
                         database=database,
                         bucket=bucket,
                         data=data,
                         query=query
)   
```


### Update Data by ID
```py
project='TestProject'
database='TestDatabase'
bucket='TestBucket'
data={'name':'teddy',age:1}
id='b419840a-7e04-11ed-84f8-324d38bf6d75'
client.updatebyid(
                         project=project,
                         database=database,
                         bucket=bucket,
                         data=data,
                         id=id
)   
```

### Delete Data by Query
```py
project='TestProject'
database='TestDatabase'
bucket='TestBucket'
query={'name':'teddy',age:1}
client.deletedata(
                         project=project,
                         database=database,
                         bucket=bucket,
                         query=query
)   
```

### Delete Data by ID
```py
project='TestProject'
database='TestDatabase'
bucket='TestBucket'
id='b419840a-7e04-11ed-84f8-324d38bf6d75'
client.deletebyid(
                         project=project,
                         database=database,
                         bucket=bucket,
                         id=id
)   
```

### Get Buckets
```py
client.getbuckets()
```

### Get Databases
```py
client.getdatabases()
```

### Get Projects
```py
cient.getprojects()
```
License
----

MIT License

Copyright (c) 2022 Teddy Oweh

`teddyoweh built it`
di

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/teddyoweh/Beardb",
    "name": "bearDB",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Teddy Oweh",
    "author_email": "Teddy Oweh <teddy@teddyoweh.net>",
    "download_url": "https://files.pythonhosted.org/packages/02/75/ad9eb26c736920b11e363681ac73abc4b988ada3abe6c357b850ebc0c674/bearDB-1.1.2.tar.gz",
    "platform": null,
    "description": "![logo](https://www.beardb.net/assets/logo.d0f8a85f.png)\n# bearDB\nDatabase system implementing AES encrypted versions JSON of data. Easy to access, manage and deploy remotely\n\n[Web Documentation](https://beardb.net)\n\n ## Database Architecture\n \n ```\nProject\n  -Database\n    -Bucket\n       -Data\n ```\n## Outline\n- [Install Libraries](#install-libraries)\n- [Import Libraries](#import-libraries)\n- [Initialize Project](#initialize-project)\n- [Insert Data into Bucket](#insert-data-into-bucket)\n- [Fetch Data From ID](#fetch-data-from-id)\n- [Fetch Data From Query](#fetch-data-from-query)\n- [Updata Data in Bucket From Query](#updata-data-in-bucket-from-query)\n- [Update Data From Bucket From ID](#update-data-from-bucket-from-id)\n- [Delete Data From Bucket From Query](#delete-data-from-bucket-from-query)\n- [Working With BeardbAPI](#working-with-beardbapi)\n\n### Install Libraries\n```sh\n$ python3 -m pip install bearDB\n```\n\n#### Import Libraries\n```py\nfrom beardb.beardb import Beardb\nfrom beardb.beardb import Bucket\n```\n#### Initialize Project\n```py\n\nproject = Beardb('projectname')\nproject.load_database('class') \n```\n#### Initialize Bucket(DataBase File)\n\n```py\nusers = Bucket(project=project, bucket_name='users') # Project variable defined in the initialization \n```\n\n#### Insert Data into Bucket\n```py\ndata = {\n       'name':'Teddy Oweh',\n       'Random Data':'Golf'\n}\nusers.insert(data=data)\n \n```\n \n \n\n#### Fetch Data From ID\n```py\n\nuserinfo = users.fetchbyID(id=\"ae0ca44e-5301-11ed-8d24-a6bd5a94b3a6\")\n\n```\n\n\n#### Fetch Data From Query\n```py\nquery= {\n       'name':'Teddy Oweh',\n       'Random Data':'Golf'\n}\nuserinfo = users.fetchData(query=query)\n\n```\n\n#### Updata Data in Bucket From Query\n```py\nquery= {\n       'name':'Teddy Oweh',\n       'Random Data':'Golf'\n}\nnewdata = {\n       'name':'Teddy Oweh',\n       'Random Data':'Ping Pong',\n       'Added Data':'College'\n       \n}\n\nusers.update(query=query,data=newdata)\n\n```\n\n#### Update Data From Bucket From ID\n```py\n  \nnewdata = {\n       'name':'Teddy Oweh',\n       'Random Data':'Ping Pong',\n       'Added Data':'College'\n       \n}\n\nusers.updatebyId(id='ae0ca44e-5301-11ed-8d24-a6bd5a94b3a6',data=newdata})\n```\n\n#### Delete Data From Bucket From Query\n\n```py\nquery= {\n       'name':'Teddy Oweh',\n       'Random Data':'Golf'\n}\n \n\nusers.delete(query=query})\n \n```\n#### Delete Data From Bucket From ID\n\n```py\n\nusers.deletebyId(id=\"ae0ca44e-5301-11ed-8d24-a6bd5a94b3a6\")\n\n\n### Test Code\n```py\nbeardb_ = Beardb('projects')\nbeardb_.load_database('computers')\ncomputers=Bucket(beardb_,'computers')\ncomputers.insert({'model':'lenovo','ram':'8gb','hdd':'1tb','processor':'i5'})\n\n\n```\n## Working with BeardbAPI\n\nIn Order to communicate with the microservice [beardbAPI](https://github.com/teddyoweh/beardb-api) deploys when launched. This client Library consumes APIs effienctly and returns the data and status code.\n\n## Outline\n- [Import Library](#importing-library)\n- [Initialize Client Object](#initialize-client-object)\n- [Get User Data](#get-user-data)\n- [Create New Project](#create-new-project)\n- [Create New Database](#create-new-database)\n- [Create New Bucket](#create-new-bucket)\n- [Insert Data](#insert-data)\n- [Fetch Data by Query](#fetch-data-by-query)\n- [Fetch Data by ID](#fetch-data-by-id)\n- [Update Data by Query](#update-data-by-query)\n- [Update Data by ID](#update-data-by-id)\n- [Delete Data by Query](#delete-data-by-query)\n- [Delete Data by ID](#delete-data-by-id)\n- [Get Buckets](#get-buckets)\n- [Get Databases](#get-databases)\n- [Get Projects](#get-projects)\n\n\n### Importing Library\n```py\nfrom beardb.beardb import Client\n```\n\n### Initialize Client Object\nWhenever a new user is created, is always returns the secret to be able to access the data.\n\n```py\nhost='127.0.0.1'\nport=5555\nemail='teddyoweh@gmail.com'\nsecret='3687065edf2fdc64bbeb8cdac409ac352fdb65f01423159842d19283309cb70c'\nclient = Client(\n                host=host,\n                port=port,\n                email=email,\n                secret=secret\n              )           \n```\n\n### Get User Data\n```py\ncient.mydata()\n```\n\n### Create New User\n```py\nemail='teddyoweh@gmail.com'\npassword='myrealpassword'\nfullname='Teddy Oweh'\n\nclient.createnewuser(\n                     fullname=fullname\n                     email=email\n                     password=password\n)\n```\n\n### Create New Project\n```py\nproject='TestProject'\nclient.createnewproject(\n                       project=project\n)\n```\n### Create New Database\n```py\nproject='TestProject'\ndatabase='TestDatabase'\nclient.createnewdatabase(\n                         project=project,\n                         database=database\n)   \n```\n\n### Create New Bucket\n```py\nproject='TestProject'\ndatabase='TestDatabase'\nbucket='TestBucket'\nclient.createnewbucket(\n                         project=project,\n                         database=database,\n                         bucket=bucket\n)   \n```\n### Insert Data\n```py\nproject='TestProject'\ndatabase='TestDatabase'\nbucket='TestBucket'\ndata={'name':'teddy',age:1}\nclient.insertdata(\n                         project=project,\n                         database=database,\n                         bucket=bucket\n)   \n```\n\n### Fetch Data by Query\n```py\nproject='TestProject'\ndatabase='TestDatabase'\nbucket='TestBucket'\nquery={'name':'teddy',age:1}\nclient.fetchdata(\n                         project=project,\n                         database=database,\n                         bucket=bucket,\n                         query=query\n)   \n```\n\n### Fetch Data by ID\n```py\nproject='TestProject'\ndatabase='TestDatabase'\nbucket='TestBucket'\nid='b419840a-7e04-11ed-84f8-324d38bf6d75'\nclient.fetchBYID(\n                         project=project,\n                         database=database,\n                         bucket=bucket,\n                         id=id\n)   \n```\n\n\n### Update Data by Query\n```py\nproject='TestProject'\ndatabase='TestDatabase'\nbucket='TestBucket'\ndata={'name':'teddy',age:1}\nquery='{name':'teddy'}\nclient.updatedata(\n                         project=project,\n                         database=database,\n                         bucket=bucket,\n                         data=data,\n                         query=query\n)   \n```\n\n\n### Update Data by ID\n```py\nproject='TestProject'\ndatabase='TestDatabase'\nbucket='TestBucket'\ndata={'name':'teddy',age:1}\nid='b419840a-7e04-11ed-84f8-324d38bf6d75'\nclient.updatebyid(\n                         project=project,\n                         database=database,\n                         bucket=bucket,\n                         data=data,\n                         id=id\n)   \n```\n\n### Delete Data by Query\n```py\nproject='TestProject'\ndatabase='TestDatabase'\nbucket='TestBucket'\nquery={'name':'teddy',age:1}\nclient.deletedata(\n                         project=project,\n                         database=database,\n                         bucket=bucket,\n                         query=query\n)   \n```\n\n### Delete Data by ID\n```py\nproject='TestProject'\ndatabase='TestDatabase'\nbucket='TestBucket'\nid='b419840a-7e04-11ed-84f8-324d38bf6d75'\nclient.deletebyid(\n                         project=project,\n                         database=database,\n                         bucket=bucket,\n                         id=id\n)   \n```\n\n### Get Buckets\n```py\nclient.getbuckets()\n```\n\n### Get Databases\n```py\nclient.getdatabases()\n```\n\n### Get Projects\n```py\ncient.getprojects()\n```\nLicense\n----\n\nMIT License\n\nCopyright (c) 2022 Teddy Oweh\n\n`teddyoweh built it`\ndi\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Database system implementing encrypted versions JSON of data. Easy to access, manage and deploy remotely",
    "version": "1.1.2",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "9d52a8c68fb150cbee191134dc3b82a9",
                "sha256": "4a6a12400d766c96163905cac55c5d1a6add243ccefeadd5f483a6a171e63696"
            },
            "downloads": -1,
            "filename": "bearDB-1.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "9d52a8c68fb150cbee191134dc3b82a9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 3617,
            "upload_time": "2022-12-23T01:13:54",
            "upload_time_iso_8601": "2022-12-23T01:13:54.674230Z",
            "url": "https://files.pythonhosted.org/packages/02/75/ad9eb26c736920b11e363681ac73abc4b988ada3abe6c357b850ebc0c674/bearDB-1.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-23 01:13:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "teddyoweh",
    "github_project": "Beardb",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "cryptography",
            "specs": []
        },
        {
            "name": "dotenv",
            "specs": []
        }
    ],
    "lcname": "beardb"
}
        
Elapsed time: 0.05273s