FirebaseDB-dict 0.5.0
Live interaction to a Firebase Realtime Database.
License: MIT

# FirebaseDB 0.5
Create a simple CRUD operations helper for Google Firebase Realtime Databases. \
Currently incompatible with Cloud Firestore. 

## Install using Pip:
```
pip install FirebaseDB_dict
```
## Initiate
```
import FirebaseDB

database = FirebaseDB(databaseURL, fp_accountkey_json)
# See below for additional arguments and what they are for.
# `database` is now a dictionary that will interact with the Realtime Database LIVE.
```

**Initiate with these arguments:** \
ー `databaseURL` - Works with Realtime Databases. Open it and copy its link. \
ーー REQUIRED. \
ー `fp_accountkey_json` - Accepts a `*.json` path or dictionary. Fetch this file from the Project settings: \
ーー Service Accounts > Firebase Admin SDK > Python > Generate new private key. \
ーー REQUIRED. \
ー `app_name` - Initialize the app with this name. *Note that no two instances of this class can have the same name.* \
ーー Defaults to `"[DEFAULT]"` \
ー `dbroot_path` - Choose the path of the database dict to start from. This is the destination key whose value will be overwritten. \
ーー Defaults to `"/"`. \
ー `default_data` - A 3-element tuple of the default key and value for empty dictionaries and default element for empty lists. \
ーーThese elements will not be returned in any form in your code UNLESS you pass `allow_default_values` as True. \
ーー Defaults to `("DEFAULT_KEY", "DEFAULT_VALUE", "DEFAULT_ELEMENT")`] \
ー `allow_defualt_values` - Whether or not default values should appear in any part of your code (i.e. only appears in the Firebase Realtime Database) \
ーー Defaults to `False`. \
    
**Returns:** \
ー Attr:`FirebaseDB.project_id` - The project ID that this class is operating on. Useful to check if 2 instances are running on the same project. \
ー Attr: `FirebaseDB.instance_name` - Returns `app_name` from `__init__` for later use. Again, no two instances with the same name can co-exist. \
ー Attr: `FirebaseDB.refer` - The Reference object that this class operates on. You can perform manual operations with it if you know how to use the SDK. \
ー Attr: `FirebaseDB._dbroot_path` - Returns `dbroot_path` from `__init__` for later use. Used to stay persistant with the root key. 

**Reading (HTTP GET):** \
ー Func: `FirebaseDB.get(key, default=None)` - Equal to dict().get(); Returns the requested value. If `value` is not found, returns `default`. \
ー Func: `FirebaseDB.keys()` - Equal to dict().keys(); Returns list of keys at the root. \
ー Func: `FirebaseDB.values()` - Equal to dict().values(); Returns list of values at the root. \
ー Func: `FirebaseDB.items()` - Equal to dict().items(); Returns list of keys at the root. \
ー Func: `FirebaseDB.copy()` - Equal to dict().copy(); Returns an exact copy of the database. 

**Writing (HTTP GET>WRITE>POST):** \
ー Func: `FirebaseDB.update(json)` - Equal to dict().update(); Returns the class instance. \
ー Func: `FirebaseDB.clear()` - Equal to dict().clear(); Returns the class instance. \
ー Func: `FirebaseDB.pop(key)` - Equal to dict().pop(); Returns the deleted key's value. \
ー Func: `FirebaseDB.popitem()` - Equal to dict().popitem(); Returns the last (key, value) added. \
ー Func: `FirebaseDB.overwrite(json)` - Additional method to completely overwrite the database with `json`. 
ーー If `json` is omitted, alias for `FirebaseDB.clear()`.
ーー Functionally identical to `FirebaseDB.clear().update(json)`. 

**Note**: \
While a dictionary can have nested values, editing values in nested levels will **NOT** 
send updates to the database and you may lose your data. To counter this, `.copy()` the database and 
make any pythonic change to the returned dictionary. Then, call `.overwrite(json)`, where `json` is your
updated dictionary.