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 hashes)

Uploaded Python 3

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