You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
背景 Google APIの利用について、GoogleのユーザーIDとパスワードでのアクセスが2015年5月に禁止された。現在はOAuth2.0を利用してアクセスしなければならない。PythonからOAuth2.0での認証に関して、意外と情報が少なく手間取ったのでやり方を残しておく。 本記事はスプレッドシートに関してのものだが、gdataライブラリを利用する他のAPIにも同じように認証が可能なのではないかと思う(未確認)。 環境 python 2.7.5 MacOS X 10.9.5 OAuth2.0での認証方法 OAuth2.0での認証のためには、いくつか準備しなければいけないことがある。 順番に手順を残しておく。 1. Drive APIの有効化 スプレッドシートは、Google Apps APIのDrive APIを利用して操作することになるので、以下の操作で必要なAPIを有効にする
仕事効率化やサンプル、自分のメモ書き用など ちょっとした Web アプリケーションを作る際、サーバーを立てたり設定をしたりするのがめんどくさいですよね。 そういう場合僕は google app engine などを使ってサクサクっと作ってしまうことが多いです。 以前から簡単な Web アプリを作る際、DB 代わりとして google スプレッドシートを利用しているという話をちょぼちょぼ色々な所で小耳にはさんでいたわけですが、つい最近仕事上ちょっと必要だったこともあり、 その副産物としてスプレッドシートを DB 代わりにして google app engine 上で稼働するサンプルをちょろちょろっと作ってみました。 下準備 では本題に。 まずはデータを入れ込むためのスプレッドシートを用意します。 API を叩いて作ることもできるのですがその辺については今回割愛します。 気になる
Googleのオープンソースプロジェクトは16日、Python用テストフレームワーク「MOX」を公開した。Google Code内のMOXプロジェクトのページよりダウンロードできる。 MOXはPython向けのMockオブジェクトフレームワークで、JavaのライブラリであるEasyMockを基に作られた。データベースやファイルシステム、Pythonのクラスやモジュールといった、テストの際に依存関係があるパーツのMockオブジェクト(ダミー)を作成できる。 Mockオブジェクトとは、実際の処理を行わずに定数値だけを返すオブジェクト。テスト対象モジュールがダミーオブジェクトとして呼び出し、使用する。 例えば入力メソッドの動きをテストする際は、データベースのローカルコピーを作成するかわりにMOXを使うことで、データベースに対する呼び出しや反応をシミュレーションできる。 インストールする場
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く