Comments (13)
@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.
This was released today https://firebase.google.com/support/release-notes/admin/python#2.1.0
from firebase-admin-python.
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.
from firebase-admin-python.
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.
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.
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.
from firebase-admin-python.
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.
@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.
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.
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.
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.
Thanks @fugu2 :)
from firebase-admin-python.
Related Issues (20)
- Transaction contextmanager does not set transaction to in_progress HOT 2
- python-jwt is deprecated HOT 2
- firebase_admin installed and got PyJWKClient issue HOT 2
- [FR] Download url like with node js client HOT 1
- Github Desktop Pull/Push Issue HOT 2
- [FR] Adding global var HOT 1
- Option to pass values to the transaction function callback HOT 1
- auth.verify_id_token throwing ValueError HOT 1
- [FR] Add Support for Pyodide by providing a wheel with binaries built for Emscripten. HOT 2
- [FR] Add WebApps support to project_management HOT 1
- Couldn't import app_check HOT 1
- Firebase functions container silently freezes on making a get request to Firestore if multiple requests were created before container starts HOT 3
- Call to Firestore getting timed out from the docker container. HOT 1
- Querying Firestore documents by nested key-value in an array field using Python HOT 1
- firestore times out when using default DNS resolver HOT 1
- [FR] Async `messaging` requests HOT 1
- import firebase admin HOT 3
- Using cloud run from gcp console to firebase HOT 1
- Cloud run from gcp console HOT 2
- [FR][FCM] HTTP2 support for sendEach HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-admin-python.