![image.png](https://images.ecency.com/DQmW2S5cesyReVjdD7NeYFt5Z8iex4wgVPQ4ozEi4pGBcAk/image.png) [source](https://firebase.google.com/docs/database/rest/start) I guess I should have used python-firebase... but I didn't pick python-firebase because there are two of them and I didn't know which one to choose 😂 But anyway, I started playing with Firebase the other day, and this python wrapper seemed pretty easy for firebase api. What you have to do is pretty simple. * Create a project on Firebase * Add Firebase to your app * Install pyrebase And... start coing! 1. Go to [Firbase console](https://console.firebase.google.com/) Log in with your google account and create your project. ![1.png](https://images.ecency.com/DQmTaV69vgbeV69TKW3wABnXk6sCP5tNW267MrjRL3oCQ1m/1.png) [source](https://console.firebase.google.com/) Like this 👇 ![image.png](https://images.ecency.com/DQmYWL772nKJkfvMvbbmYTrrN25tQRZfzfF6VRuzaD28ZGs/image.png) Just "**Continue**" ![image.png](https://images.ecency.com/DQmVPZWviqfn6viQxVv6HWLoPrM3T64zW3hGMM9wv7cMo3Q/image.png) And "**Create project**" ![image.png](https://images.ecency.com/DQmZZMshpw5QP3sm4j7e1YFiG6TWZcfFC4ARt25Z7iPYGU5/image.png) Once project is created, add firebase to your app like this 👇 I will pick web but you can add iOS or Android too. ![image.png](https://images.ecency.com/DQmb33QTx9KfmDRCy82ESK3HnjZnsGS1wJqU8UPrKewjEXf/image.png) Name your app and "**Register app**" ![image.png](https://images.ecency.com/DQmVDk2xAFzyi3L5pNv8YySv8GZx6oaw57r57Z1TufmDGzs/image.png) You will get a config data like this ![image.png](https://images.ecency.com/DQmZibDANTHv53AG2auHQ6FQHoHv8yVQUnmghGai6ZZm5Gv/image.png) (this is not my config actually) [source](https://www.youtube.com/watch?v=VnUXbo8JvvA&t=441s) Project and app are all setup. You only need this config part for python so copy and paste and make it like a real dictionary. ``` # Your web app's Firebase configuration firebase_config = { "apiKey": "fireBaeIzaSyDJIQ7LiBG7QK7dUBPW3M1cGBFPTw1BE", "authDomain": "fireBae-9df46.firebaseapp.com", "databaseURL": "https://fireBae-9df46.firebaseio.com", "storageBucket": "fireBae-9df46.appspot.com", } ``` Before you use Firebase in your python project, you need to install pyrebase library. I have a better library so DO NOT actually install this library but this is how you install. ```pip install pyrebase``` Now the python part. It is pretty simple. ``` import pyrebase firebase_config = { "apiKey": "fireBaeIzaSyDJIQ7LiBG7QK7dUBPW3M1cGBFPTw1BE", "authDomain": "fireBae-9df46.firebaseapp.com", "databaseURL": "https://fireBae-9df46.firebaseio.com", "storageBucket": "fireBae-9df46.appspot.com", } firebase = pyrebase.initialize_app(firebase_config ) db = firebase.database() ``` This is pretty much it. You can just save data into firebase or retreive data from firebase. **Save Data** ``` data = { "username": "tomoyan" } results = db.child("users").push(data) ``` **Retrieve Data** ``` users = db.child("users").get() for user in users .each(): print(user.key()) print(user.val()) ``` using pyrebase is pretty simple, but a lot of stuff aren't working like this documentation. https://github.com/thisbejim/Pyrebase So that is why I hate pyrebase. I use **pyrebase4** instead. So install this library ```pip install pyrebase4``` And the same code will work especially like these things ![image.png](https://images.ecency.com/DQmWG4GdDtAc89KCQ13c9qV2YM3dC3Dd2U9WMSrijYtsdGj/image.png) [source](https://github.com/nhorvath/Pyrebase4) What am I using this for? ![image.png](https://images.ecency.com/DQmSv5YBW2z3eYsfRndUVXu11MnVDY2TD74HNDg8LbqaqFr/image.png) ## 😉 <center> [![image.png](https://images.blurt.buzz/DQmNow1i8RUp7WdTD1hgyXncPoKhJq5vziaGeoZc3gN9vuY/image.png)](https://blurtblock.herokuapp.com/tomoyan) ➡️ [Twitter ](https://twitter.com/tomoyanTweet) </center>
post_id | 88,586,437 |
---|---|
author | tomoyan |
permlink | why-i-hate-pyrebase |
category | python |
json_metadata | {"tags":["python","firebase","pyrebase","mini","blurt","upvote"],"image":["https:\/\/images.ecency.com\/DQmW2S5cesyReVjdD7NeYFt5Z8iex4wgVPQ4ozEi4pGBcAk\/image.png","https:\/\/images.ecency.com\/DQmTaV69vgbeV69TKW3wABnXk6sCP5tNW267MrjRL3oCQ1m\/1.png","https:\/\/images.ecency.com\/DQmYWL772nKJkfvMvbbmYTrrN25tQRZfzfF6VRuzaD28ZGs\/image.png","https:\/\/images.ecency.com\/DQmVPZWviqfn6viQxVv6HWLoPrM3T64zW3hGMM9wv7cMo3Q\/image.png","https:\/\/images.ecency.com\/DQmZZMshpw5QP3sm4j7e1YFiG6TWZcfFC4ARt25Z7iPYGU5\/image.png","https:\/\/images.ecency.com\/DQmb33QTx9KfmDRCy82ESK3HnjZnsGS1wJqU8UPrKewjEXf\/image.png","https:\/\/images.ecency.com\/DQmVDk2xAFzyi3L5pNv8YySv8GZx6oaw57r57Z1TufmDGzs\/image.png","https:\/\/images.ecency.com\/DQmZibDANTHv53AG2auHQ6FQHoHv8yVQUnmghGai6ZZm5Gv\/image.png","https:\/\/images.ecency.com\/DQmWG4GdDtAc89KCQ13c9qV2YM3dC3Dd2U9WMSrijYtsdGj\/image.png","https:\/\/images.ecency.com\/DQmSv5YBW2z3eYsfRndUVXu11MnVDY2TD74HNDg8LbqaqFr\/image.png","https:\/\/images.blurt.buzz\/DQmNow1i8RUp7WdTD1hgyXncPoKhJq5vziaGeoZc3gN9vuY\/image.png"],"links":["https:\/\/firebase.google.com\/docs\/database\/rest\/start","https:\/\/console.firebase.google.com\/","https:\/\/www.youtube.com\/watch?v=VnUXbo8JvvA&t=441s","https:\/\/github.com\/thisbejim\/Pyrebase","https:\/\/github.com\/nhorvath\/Pyrebase4","https:\/\/blurtblock.herokuapp.com\/tomoyan","https:\/\/twitter.com\/tomoyanTweet"],"app":"steemit\/0.2","format":"markdown"} |
created | 2020-11-28 17:16:09 |
last_update | 2020-11-28 17:16:09 |
depth | 0 |
children | 0 |
net_rshares | 33,723,371,489,127 |
last_payout | 2020-12-05 17:16:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 7.419 SBD |
curator_payout_value | 6.587 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 3,894 |
author_reputation | 870,963,589,956,079 |
root_title | "Why I Hate Pyrebase" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
team | 0 | 56,379,045,710 | 20% | ||
acidyo | 0 | 1,574,234,508,857 | 22% | ||
kevinwong | 0 | 1,694,244,963,598 | 22% | ||
gerber | 0 | 1,317,743,172 | 5.09% | ||
ezzy | 0 | 272,652,611,091 | 5.09% | ||
exyle | 0 | 334,177,939,965 | 5.09% | ||
cmp2020 | 0 | 2,444,596,045 | 1% | ||
hattaarshavin | 0 | 7,604,548,005 | 9% | ||
ew-and-patterns | 0 | 8,895,971,287 | 5.09% | ||
techken | 0 | 5,150,617,747 | 12.5% | ||
zacherybinx | 0 | 2,734,537,598 | 12.5% | ||
gunthertopp | 0 | 224,642,467,487 | 4.25% | ||
droida | 0 | 8,704,392,309 | 100% | ||
greatness96 | 0 | 255,470,358 | 0.44% | ||
dine77 | 0 | 23,337,882,111 | 0.93% | ||
yasu24 | 0 | 1,851,286,942,289 | 100% | ||
alfredogarc | 0 | 1,271,822,604 | 3.6% | ||
ernick | 0 | 2,093,198,834 | 10% | ||
karja | 0 | 68,692,906,717 | 3% | ||
crokkon | 0 | 4,953,724,663 | 22% | ||
accelerator | 0 | 33,995,874,939 | 5.09% | ||
mballesteros | 0 | 738,682,712 | 6% | ||
puncakbukit | 0 | 52,990,154,314 | 29% | ||
imamalkimas | 0 | 820,700,808 | 12% | ||
qurator | 0 | 73,370,750,363 | 8.62% | ||
khaleelkazi | 0 | 245,001,462 | 5.09% | ||
chekohler | 0 | 847,916,514 | 12.5% | ||
afril | 0 | 13,296,089,751 | 20% | ||
nealmcspadden | 0 | 3,131,333,486 | 5.09% | ||
curx | 0 | 71,648,252,554 | 22% | ||
kimjaguar | 0 | 1,314,110,265 | 12.5% | ||
yasu | 0 | 286,161,971,043 | 55% | ||
lorennys | 0 | 766,800,404 | 12% | ||
ulisesfl17 | 0 | 2,308,914,723 | 12% | ||
arac | 0 | 694,337,414 | 12% | ||
starlord28 | 0 | 720,772,007 | 6% | ||
betzaelcorvo | 0 | 209,156,285 | 6% | ||
peerzadazeeshan | 0 | 2,623,720,123 | 12.5% | ||
tiket | 0 | 1,219,897,213 | 12% | ||
flores39 | 0 | 926,825,842 | 12% | ||
sergino | 0 | 9,875,134,252 | 25% | ||
lopzdaniel | 0 | 905,992,758 | 6% | ||
diegopadilla | 0 | 799,400,530 | 12.5% | ||
torbrowser | 0 | 65,081,563 | 25% | ||
dlike | 0 | 68,445,845,644 | 6% | ||
memes777 | 0 | 5,180,942,478 | 12% | ||
fdar19 | 0 | 3,378,037,155 | 12% | ||
steemcryptosicko | 0 | 340,737,236,191 | 40% | ||
glastar | 0 | 43,123,012,833 | 100% | ||
cyberrn | 0 | 36,020,453,127 | 5% | ||
maskuncoro | 0 | 590,961,747 | 12.5% | ||
freebot | 0 | 0 | 100% | ||
cresus | 0 | 0 | 100% | ||
quicktrades | 0 | 7,702,405,014 | 100% | ||
swissbot | 0 | 0 | 100% | ||
tomoyan | 0 | 4,358,975,570 | 12% | ||
steem.leo | 0 | 6,037,894,004 | 5.09% | ||
leo.voter | 0 | 322,289,573 | 5.09% | ||
dcinside | 0 | 518,592,869 | 12.5% | ||
maxuvd | 0 | 5,663,631,393 | 11% | ||
maxuve | 0 | 15,332,156,988 | 4.88% | ||
monkeydex | 0 | 0 | 100% | ||
ackerman77 | 0 | 969,484,118 | 100% | ||
hatta.dlike | 0 | 90,911,648 | 9% | ||
hatta.jahm | 0 | 98,338,869 | 9% | ||
uthus2k | 0 | 5,508,562,798 | 100% | ||
block.token | 0 | 77,604,927 | 25% | ||
penny4thoughts | 0 | 447,537,120 | 1% | ||
aceh.point | 0 | 14,256,796,925 | 25% | ||
dev.supporters | 0 | 131,146,218,338 | 10% | ||
gotogether | 0 | 21,103,400,112,423 | 28.53% | ||
gopower | 0 | 50,618,378,955 | 28.53% | ||
steemingcurators | 0 | 143,784,661,640 | 12% | ||
curator-id | 0 | 4,986,403,714 | 25% | ||
bugabuga | 0 | 8,723,584,574 | 3.5% | ||
upvu | 0 | 4,993,006,011,810 | 1.7% | ||
mccoy02 | 0 | 1,243,777,910 | 12% | ||
denzelwash | 0 | 110,088,516 | 12.5% | ||
unyime | 0 | 355,026,358 | 2.2% | ||
appicx | 0 | 2,014,726,417 | 14.3% | ||
okoyejoshua | 0 | 162,008,671 | 5% | ||
fombae | 0 | 2,381,514,768 | 12.5% | ||
japansteemit | 0 | 525,634,713 | 100% | ||
deathtox | 0 | 389,023,237 | 25% | ||
msharif | 0 | 931,286,364 | 12% | ||
cleydimar | 0 | 1,693,989,070 | 12% | ||
sridhara | 0 | 166,189,050 | 12% | ||
alives | 0 | 2,968,089,766 | 22% | ||
labuj | 0 | 769,854,224 | 11% | ||
maliha24 | 0 | 2,264,662,143 | 22% | ||
auc | 0 | 1,165,154,381 | 11% | ||
izraelinspired | 0 | 73,055,360 | 12.5% | ||
talkie | 0 | 2,013,204,535 | 22% | ||
merlinz | 0 | 699,002,382 | 11% | ||
steemingtrail | 0 | 4,165,397,045 | 12% |