Skip to main content

Advanced Firebase

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

advancedfirebase-1.1.4-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file advancedfirebase-1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for advancedfirebase-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1aefb204ded2cb6f6000e808699fdb31394faf58464deb4ecab9f3d2a72b01ad
MD5 8145c48ede2a5fb96088cadf680f8f55
BLAKE2b-256 90520ecfe7633db7362c7c597695b80c6c09c70d505e2797eb5880f5cd7e6e29

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page