A package to perform crud operations with firebase.
Project description
firebase-crud
Best Python package to perform CRUD operations with firebase out there.
With firebase-crud, you can used to perform all kind of CRUD operations against firebase node with simple key value based (or) NoSQL based structure for the realtime usage.
Installation
pip install firebase-crud
Usage
firebase crud was programmed in ease-of-use in mind. It can simply import using below
from firebase_crud import Collection
Prequisites
- Create and configure firebase console application.
- Generate API/SDK Key on Settings > Service Accounts > Python
- Configure realtime database path.
Once you have done with this configuration, you can easily initiate firebase using this package. But you have to prepare some things for the initialization.
- API Key - Path for the generated JSON file from firebase.
- Firebase URL - This url can be found in realtime database page on your firebase console.
- Collection Name - Usually single firebase project can have multiple collection/nodes. so you have to specify name for each collection.
- Unique Id - Firebase will generate some random unique key and which we cannot use to perform CRUD operations. So we need to init with some key as unique.
Initialization
sample_collection = Collection(api_key, path, 'ToDo', 'id')
Methods
Here you can find the list of methods available in this package.
Name | Description | Input | Output |
---|---|---|---|
insert(value) |
To add/insert new items into collection | dict: {'id':1, 'task':'Task'} |
Boolean |
getAllValues() |
To get all the items as list | None | list |
GetValue() |
To get the item by unique value | id: 1 | dict or None |
deleteAll() |
To delete all the items in the collection | None | Boolean |
update(self, unique_key, value) |
To update an item in the collection | unique_key: 1, dict: {'id':1, 'task':'Task'} |
Boolean |
delete(unique_key) |
To delete an item from the collection | unique_key: 1 | Boolean |
Development
Want to contribute? Great!
Create pull request from the github repository and assign it to me.
License
MIT License
Copyright (c) 2022 Jeganath PV
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Free Software, Hell Yeah!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file firebase-crud-1.0.0.tar.gz
.
File metadata
- Download URL: firebase-crud-1.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b33b09faef66b9b6e5dbfbb0714549a55714cd018ad100925877f850273dedee |
|
MD5 | 18e459fdb2bdf3fca04f9dfc5cc85a65 |
|
BLAKE2b-256 | a261996a60903921e1a197d9bf92b830de6f4fffd731ecc7bcfddcc7a8b4685a |
File details
Details for the file firebase_crud-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: firebase_crud-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1548606fcf1d8a0860d863b965c0585a1e032603690fe9f10cceeadaac70efe |
|
MD5 | 9466fdbee6914fdc47968ccd79c83221 |
|
BLAKE2b-256 | 3a80f6c091492ea639a9f78086fd37356d20a6639f06feb26b51480191177c94 |