2023 年 6 月に、Python 版 Google Ads API クライアント ライブラリの Python 3.7 サポートが非推奨となりました。2024 年第 1 四半期にリリースされるライブラリのメジャー バージョンでは、Python 3.7 との互換性がなくなります。Python 3.7 互換ライブラリの変更は、重要なセキュリティまたは安定性に関するパッチのみとなります。
Python 3.7 を利用している Google Ads API ユーザーは、v15 が 2024 年 9 月に提供終了となるまで、API v15 がサポートされるライブラリの 22.1.0 バージョンを引き続き使用できます。すべての Python ユーザーは、できるだけ早く Python 3.8 以降にアップグレードする必要があります。
Python ユーザーは、Python のバージョンのサポートが終了し次第、今後のライブラリでそのバージョンとの互換性がなくなることを予期しておく必要があります。2024 年 10 月に Python 3.8 のサポートが終了すると、Python 3.8 と互換性のないライブラリのメジャー バージョンがリリースされることになります。Python バージョンのサポートが終了する少なくとも 2 か月前には、ブログ投稿で変更をお知らせします。
以下に、今後の言語サポートの削除に向けて事前に計画を立てる際に役立つリソースを紹介します。
import firebase_admin from firebase_admin import credentials cred = credentials.Cert('path/to/serviceKey.json') firebase_admin.initialize_app(cred, { 'databaseURL' : 'https://my-db.firebaseio.com' })
db
get(), set(), push(), update(),
delete()
from firebase_admin import db root = db.reference() # Add a new user under /users. new_user = root.child('users').push({ 'name' : 'Mary Anning', 'since' : 1700 }) # Update a child attribute of the new user. new_user.update({'since' : 1799}) # Obtain a new reference to the user, and retrieve child data. # Result will be made available as a Python dict. mary = db.reference('users/{0}'.format(new_user.key)).get() print 'Name:', mary['name'] print 'Since:', mary['since']
order_by_*
from firebase_admin import db dinos = db.reference('dinosaurs') # Retrieve the five tallest dinosaurs in the database sorted by height. # 'result' will be a sorted data structure (list or OrderedDict). result = dinos.order_by_child('height').limit_to_last(5).get() # Retrieve the 5 shortest dinosaurs that are taller than 2m. result = dinos.order_by_child('height').start_at(2).limit_to_first(5).get() # Retrieve the score entries whose values are between 50 and 60. result = db.reference('scores').order_by_value() \ .start_at(50).end_at(60).get()
import firebase_admin from firebase_admin import credentials cred = credentials.Certificate("path/to/service.json") firebase_admin.initialize_app(cred)
firebase_admin.initialize_app()
uid = "some-uid" additional_claims = { "premiumAccount": True } custom_token = auth.create_custom_token(uid, additional_claims)
decoded_token = auth.verify_id_token(id_token) uid = decoded_token["uid"]