-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* example有償版対応 * 無駄な空行を削除
- Loading branch information
Showing
5 changed files
with
180 additions
and
9,009 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"cells":[{"cell_type":"markdown","metadata":{"id":"8gKDRhrY0mrO"},"source":["# リフレッシュトークンの書き込み\n","\n","[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/J-Quants/jquants-api-client-python/blob/master/examples/20220825-000-write-refresh_token.ipynb)\n","\n","J-Quants API のリフレッシュトークンを Google Drive の MyDrive/drive_ws/secret/jquantsapi-key.txt に書き込みます。\n","\n","リフレッシュトークンは取得方法は以下のリンク先をご参照ください。\n","\n","https://jpx.gitbook.io/j-quants-api/api-reference#idtkunno\n","\n","\n","----\n","\n","**このノートブックはGoogle Driveを使用します。**\n","\n","- Google Drive の以下のファイルにリフレッシュトークンを書き込みます。\n"," - `MyDrive/drive_ws/secret/jquantsapi-key.txt`\n"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"pQVIcLjryiMq"},"outputs":[],"source":["# Google drive をマウントします\n","from google.colab import drive\n","drive.mount('/content/drive')\n","\n","# 必要なモジュールを読み込みます\n","import os\n","from getpass import getpass\n","\n","\n","# refresh_token を入力します\n","refresh_token = getpass(\"Please input refresh token\")\n","\n","# refresh_token の書き込み先を指定します\n","OUTPUT_DIR = \"/content/drive/MyDrive/drive_ws/secret\"\n","OUTPUT_PATH = f\"{OUTPUT_DIR}/jquantsapi-key.txt\"\n","\n","# refresh_token を書き込みます\n","os.makedirs(OUTPUT_DIR, exist_ok=True)\n","with open(OUTPUT_PATH, mode=\"w\") as f:\n"," f.write(refresh_token)\n","\n","# 完了文字列を表示します\n","print(\"Done\")"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"S3wxpLKm0fGN"},"outputs":[],"source":[]}],"metadata":{"colab":{"authorship_tag":"ABX9TyMvkFqt1b8LuOi5OXQ4CqdB","collapsed_sections":[],"name":"20220825-000-write-refresh_token.ipynb","provenance":[]},"kernelspec":{"display_name":"Python 3","name":"python3"},"language_info":{"name":"python"}},"nbformat":4,"nbformat_minor":0} | ||
{"cells":[{"attachments":{},"cell_type":"markdown","metadata":{"id":"8gKDRhrY0mrO"},"source":["# リフレッシュトークンの書き込み\n","\n","[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/J-Quants/jquants-api-client-python/blob/master/examples/20220825-000-write-refresh_token.ipynb)\n","\n","J-Quants API のリフレッシュトークンを Google Drive の MyDrive/drive_ws/secret/jquantsapi-key.txt に書き込みます。\n","\n","リフレッシュトークンは取得方法は以下のリンク先をご参照ください。\n","\n","https://jpx.gitbook.io/j-quants-ja/outline/getstarted#step2rifuresshutkunnoreapino\n","\n","\n","----\n","\n","**このノートブックはGoogle Driveを使用します。**\n","\n","- Google Drive の以下のファイルにリフレッシュトークンを書き込みます。\n"," - `MyDrive/drive_ws/secret/jquantsapi-key.txt`\n"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"pQVIcLjryiMq"},"outputs":[],"source":["# Google drive をマウントします\n","from google.colab import drive\n","drive.mount('/content/drive')\n","\n","# 必要なモジュールを読み込みます\n","import os\n","from getpass import getpass\n","\n","\n","# refresh_token を入力します\n","refresh_token = getpass(\"Please input refresh token\")\n","\n","# refresh_token の書き込み先を指定します\n","OUTPUT_DIR = \"/content/drive/MyDrive/drive_ws/secret\"\n","OUTPUT_PATH = f\"{OUTPUT_DIR}/jquantsapi-key.txt\"\n","\n","# refresh_token を書き込みます\n","os.makedirs(OUTPUT_DIR, exist_ok=True)\n","with open(OUTPUT_PATH, mode=\"w\") as f:\n"," f.write(refresh_token)\n","\n","# 完了文字列を表示します\n","print(\"Done\")"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"S3wxpLKm0fGN"},"outputs":[],"source":[]}],"metadata":{"colab":{"authorship_tag":"ABX9TyMvkFqt1b8LuOi5OXQ4CqdB","collapsed_sections":[],"name":"20220825-000-write-refresh_token.ipynb","provenance":[]},"kernelspec":{"display_name":"Python 3","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.11.1"}},"nbformat":4,"nbformat_minor":0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.