firebasil.rtdb module
- class firebasil.rtdb.EventType(value)
An enumeration.
- class firebasil.rtdb.OnEvent(*args, **kwds)
- class firebasil.rtdb.Rtdb(database_url: str, id_token: Optional[str] = None, access_token: Optional[str] = None)
A connection to a realtime database. Should be used as an async context manager, which yields the root
RtdbNodeof the database.- access_token: Optional[str] = None
Access token, for example for service accounts (optional)
- database_url: str
URL of the realtime database, including schema
- id_token: Optional[str] = None
User ID token (optional)
- class firebasil.rtdb.RtdbEvent(event: EventType, path: Optional[str] = None, data: Union[None, str, int, float, bool, List[JSON], Mapping[str, JSON]] = None)
An event from the realtime database
- data: Union[None, str, int, float, bool, List[JSON], Mapping[str, JSON]] = None
Body of the event, either the new or updated values
- path: Optional[str] = None
Path of the event, relative to the listener
- class firebasil.rtdb.RtdbNode(_rtdb: Rtdb, path: str = '', query_params: Optional[Dict[str, Any]] = None)
A node within the realtime database
- async delete() None
Remove the value of a node, and all sub-nodes
- end_at(value: Any) RtdbNode
Return values ending at
valueunder some ordering.See https://firebase.google.com/docs/database/rest/retrieve-data#section-rest-filtering
- equal_to(value: Any) RtdbNode
Return values with value equal to
valueunder some ordering.See https://firebase.google.com/docs/database/rest/retrieve-data#section-rest-filtering
- events() AsyncGenerator[asyncio.Queue[RtdbEvent], None]
Async context manager that listens to the event stream of this node and adds events to the async queue that it yields.
- export_format() RtdbNode
Include priority data in responses
See https://firebase.google.com/docs/reference/rest/database#section-param-format
- async get() Union[None, str, int, float, bool, List[JSON], Mapping[str, JSON]]
Get the value of a node
- limit_to_first(limit: int) RtdbNode
Only return the first
limitresults after some ordering and filtering is applied.See https://firebase.google.com/docs/database/rest/retrieve-data#section-rest-filtering
- limit_to_last(limit: int) RtdbNode
Only return the last
limitresults after some ordering and filtering is applied.
- order_by(child_location: str) RtdbNode
Order filtering operations by the value of a specified (possibly nested) child node.
Note, this does not order results, as they are returned as unordered JSON.
See https://firebase.google.com/docs/database/rest/retrieve-data#section-rest-ordered-data
- order_by_key() RtdbNode
Order filtering operations by key.
Note, this does not order results, as they are returned as unordered JSON.
See https://firebase.google.com/docs/database/rest/retrieve-data#section-rest-ordered-data
- order_by_priority() RtdbNode
Order filtering operations by priority.
Note, this does not order results, as they are returned as unordered JSON.
See https://firebase.google.com/docs/database/rest/retrieve-data#section-rest-ordered-data
- order_by_value() RtdbNode
Order filtering operations by node value.
Note, this does not order results, as they are returned as unordered JSON.
See https://firebase.google.com/docs/database/rest/retrieve-data#section-rest-ordered-data
- path: str = ''
Location of this node in the database
- async push(data: Union[None, str, int, float, bool, List[JSON], Mapping[str, JSON]]) str
Push data into a list, returning the ID of the new node.
See https://firebase.google.com/docs/database/web/lists-of-data
- async set(data: Union[None, str, int, float, bool, List[JSON], Mapping[str, JSON]]) Union[None, str, int, float, bool, List[JSON], Mapping[str, JSON]]
Set the value of a node
- shallow() RtdbNode
Create a node that only gets shallow data
See https://firebase.google.com/docs/reference/rest/database#section-param-shallow
- start_at(value: Any) RtdbNode
Return values starting at
valueunder some ordering.See https://firebase.google.com/docs/database/rest/retrieve-data#section-rest-filtering
- timeout(timeout: timedelta) RtdbNode
Set a request timeout.
See https://firebase.google.com/docs/reference/rest/database#section-param-timeout
- async update(data: Union[None, str, int, float, bool, List[JSON], Mapping[str, JSON]]) Union[None, str, int, float, bool, List[JSON], Mapping[str, JSON]]
Update data at a given location with new JSON.
See https://firebase.google.com/docs/database/web/read-and-write#updating_or_deleting_data
- write_size_limit(limit: SizeLimit) RtdbNode
Limit write sizes.
See https://firebase.google.com/docs/reference/rest/database#section-param-writesizelimit
- class firebasil.rtdb.SizeLimit(value)
An enumeration.