Advanced Firebase
Advanced Firebase ia a library that adds more functional to standart firebase sdk.
Installation
Use the package manager pip to install Advanced Firebase.
pip install advancedfirebase
MODULES
DB
This module is only for use with Realtime Database.
All functions:
- Get
- Getkey
- Update
- Set
- Parse
Example database*
{
'fruits:{
⠀
⠀⠀⠀'apple':{
⠀⠀⠀⠀⠀⠀'color': 'red'
⠀⠀⠀⠀⠀⠀}
⠀
⠀⠀⠀'banana':{
⠀⠀⠀⠀⠀⠀'color': 'yellow'
⠀⠀⠀⠀⠀⠀}
⠀
⠀⠀⠀'kiwi':{
⠀⠀⠀⠀⠀⠀'color': 'green'
⠀⠀⠀⠀⠀⠀}
⠀
⠀⠀⠀}
}
*This is database that used in examples
Project initialize
from advancedfirebase import db
db.init('url', 'credentials.json')
Get
Args: path
out = db.get('/fruits/apple')
print(out)
OUTPUT:
{'color': 'red'}
Getkey
Args: path, key
out = db.getkey('/fruits/apple','color')
print(out)
OUTPUT:
red
Update
Args: path, obj
object = {
'apple':{
'color':'green',
'size':'large'
}
}
db.update('/fruits/', object)
Result:
{
'fruits:{
⠀
⠀⠀⠀'apple':{
⠀⠀⠀⠀⠀⠀'color': 'green',
⠀⠀⠀⠀⠀⠀'size': 'large'
⠀⠀⠀⠀⠀⠀}
⠀
⠀⠀⠀'banana':{
⠀⠀⠀⠀⠀⠀'color': 'yellow'
⠀⠀⠀⠀⠀⠀}
⠀
⠀⠀⠀'kiwi':{
⠀⠀⠀⠀⠀⠀'color': 'green'
⠀⠀⠀⠀⠀⠀}
⠀
⠀⠀⠀}
}
Set
object = {
'apple':{
'color':'green',
'size':'large'
}
}
db.set('/fruits/', object)
Result:
{
'fruits:{
⠀
⠀⠀⠀'apple':{
⠀⠀⠀⠀⠀⠀'color': 'green',
⠀⠀⠀⠀⠀⠀'size': 'large'
⠀⠀⠀⠀⠀⠀}
⠀⠀⠀}
}
Parse
req = db.get('/fruits/apple')
print(req)
print(db.parse(req, 'color'))
OUTPUT:
{'color':'red'}
red
Made by Artem Lukashenko
v1.1.4
Metadata
Release files for advancedfirebase 1.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| advancedfirebase-1.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Release files / advancedfirebase-1.1.4-py3-none-any.whl
| Download URL | advancedfirebase-1.1.4-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1aefb204ded2cb6f6000e808699fdb31394faf58464deb4ecab9f3d2a72b01ad
|
|
BLAKE2b-256 checksum How to use checksums |
90520ecfe7633db7362c7c597695b80c6c09c70d505e2797eb5880f5cd7e6e29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.1
|