Skip to content

Instantly share code, notes, and snippets.

@Namyalg
Created June 17, 2021 18:15
Show Gist options
  • Save Namyalg/aca7e5cba6b5d6c859553a626c37ed3c to your computer and use it in GitHub Desktop.
Save Namyalg/aca7e5cba6b5d6c859553a626c37ed3c to your computer and use it in GitHub Desktop.
import firebase_admin
from firebase_admin import credentials
from firebase_admin import db
# Fetch the service account key JSON file contents
cred = credentials.Certificate('secret key.json')
# Initialize the app with a service account, granting admin privileges
firebase_admin.initialize_app(cred, {
'databaseURL': "URL to database"
})
ref = db.reference('Database reference')
print(ref.get())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment