Giter Site home page Giter Site logo

Comments (13)

rgbsuede avatar rgbsuede commented on May 25, 2024 2

@hiranya911, I'm having trouble using your merged (#31) Database API, do you have any examples of using db.py? Here's what I'm trying to do with your work:

import firebase_admin
from firebase_admin import credentials
from firebase_admin import db

cred = credentials.Certificate('service-account-credentials.json')
app = firebase_admin.initialize_app(cred)
dbRef = db.Reference(path='/', app=app)

users = dbRef.child('users')
print(users)
print(users.get_value())

and I get

<firebase_admin.db.Reference object at 0x03BE3EB0>
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\firebase_admin\db.py", line 131, in get_value
    return self._client.request('get', self._add_suffix())
AttributeError: 'NoneType' object has no attribute 'request'

from firebase-admin-python.

hiranya911 avatar hiranya911 commented on May 25, 2024 1

This was released today https://firebase.google.com/support/release-notes/admin/python#2.1.0

from firebase-admin-python.

google-oss-bot avatar google-oss-bot commented on May 25, 2024

Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.

from firebase-admin-python.

hiranya911 avatar hiranya911 commented on May 25, 2024

You might be interested to know, that a database API around the existing REST support is currently bring developed at https://github.com/firebase/firebase-admin-python/tree/hkj-simple-db

from firebase-admin-python.

rgbsuede avatar rgbsuede commented on May 25, 2024

PS @galuszkak to access db.py you'll need to use pip install git+https://github.com/firebase/firebase-admin-python (and not just pip install firebase-admin) until the pip package is updated

from firebase-admin-python.

hiranya911 avatar hiranya911 commented on May 25, 2024

Try something like:

app = firebase_admin.initialize_app(cred, {'dbURL' : 'https://your-db-url.firebase.com'})
ref = db.get_reference()

However, note that we are still working on this and the API is subject to change.

from firebase-admin-python.

rgbsuede avatar rgbsuede commented on May 25, 2024

from firebase-admin-python.

rgbsuede avatar rgbsuede commented on May 25, 2024

Also, and sorry if I'm being a bother, but it doesn't appear that there is an implementation in this python SDK for subscribing to and handling events (like .on('child_added') in the node SDK, for example.) Could I be of any help in extending this for that?

from firebase-admin-python.

hiranya911 avatar hiranya911 commented on May 25, 2024

@joshbabb We are not going to implement realtime event handling capabilities in this iteration. We will consider it for a future release, if there's enough demand for it. But feel free to document your requirements/suggestions as issues in this repo. That will help us to prioritize the features.

We will also gladly accept any code contributions you can provide us. But if you're going to implement realtime support I'd recommend you to wait until we release what we have already implemented (should be any day now -- we are just finalizing the internal approval processes).

from firebase-admin-python.

hiranya911 avatar hiranya911 commented on May 25, 2024

Also please note that I've just merged #35 into master. You should update your test code as follows:

app = firebase_admin.initialize_app(cred, {'databaseURL' : 'https://your-db-url.firebase.com'})
ref = db.reference()

from firebase-admin-python.

rgbsuede avatar rgbsuede commented on May 25, 2024

Thanks for the note and all your responses, @hiranya911

I'll make an issue for the request at a later time. We're going to hack what we can together for the time being :)

from firebase-admin-python.

sachaschwab avatar sachaschwab commented on May 25, 2024

This is just to say that I much appreciate the great and easy to understand stuff you're doing. Keep on going!

from firebase-admin-python.

hiranya911 avatar hiranya911 commented on May 25, 2024

Thanks @fugu2 :)

from firebase-admin-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.