{"id":22385069,"url":"https://github.com/273do/openai-api-with-google-docs","last_synced_at":"2026-05-03T19:33:23.978Z","repository":{"id":264989553,"uuid":"894802326","full_name":"273Do/OpenAI-API-with-Google-Docs","owner":"273Do","description":"Google Docsでプロンプトを管理し，PythonでOpenAI APIを使用するためのテンプレートです．","archived":false,"fork":false,"pushed_at":"2024-11-27T07:07:00.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-06T12:32:04.673Z","etag":null,"topics":["docker","google-docs","openai-api","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/273Do.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-27T02:42:54.000Z","updated_at":"2024-11-27T15:39:16.000Z","dependencies_parsed_at":"2024-11-27T14:16:04.646Z","dependency_job_id":null,"html_url":"https://github.com/273Do/OpenAI-API-with-Google-Docs","commit_stats":null,"previous_names":["273do/openai-api-with-google-docs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/273Do/OpenAI-API-with-Google-Docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/273Do%2FOpenAI-API-with-Google-Docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/273Do%2FOpenAI-API-with-Google-Docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/273Do%2FOpenAI-API-with-Google-Docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/273Do%2FOpenAI-API-with-Google-Docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/273Do","download_url":"https://codeload.github.com/273Do/OpenAI-API-with-Google-Docs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/273Do%2FOpenAI-API-with-Google-Docs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32582732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","google-docs","openai-api","python"],"created_at":"2024-12-05T01:20:56.003Z","updated_at":"2026-05-03T19:33:23.961Z","avatar_url":"https://github.com/273Do.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAI API with Google Docs\n\n本リポジトリは，Google Docs でプロンプトを管理する方法し，Python で OpenAI API を使用するためのテンプレートです．\n\n## 🤖 開発環境・使用技術・ツール\n\n\u003ch3\u003e環境，コード管理\n\u003cdiv\u003e\n \u003cimg alt=\"Docker\" src=\"https://img.shields.io/badge/-Docker-000?style=flat\u0026logo=Docker\u0026logoColor=46a2f1\" /\u003e\n \u003cimg alt=\"Python\" src=\"https://img.shields.io/badge/-Python-000?style=flat\u0026logo=Python\u0026logoColor=3776AB\" /\u003e\n \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/badge/-GitHub-000?style=flat\u0026logo=GitHub\u0026logoColor=FFFFFF\" /\u003e\n\u003cimg alt=\"Git\" src=\"https://img.shields.io/badge/-Git-000?style=flat\u0026logo=Git\u0026logoColor=F05032\" /\u003e\n\u003c/div\u003e\n\n\u003ch3\u003e外部サービス\n\u003cdiv\u003e\n \u003cimg alt=\"Google Docs\" src=\"https://img.shields.io/badge/-Google Docs-000?style=flat\u0026logo=googledocs\u0026logoColor=4285F4\" /\u003e\n \u003cimg alt=\"OpenAI API\" src=\"https://img.shields.io/badge/-OpenAI API-000?style=flat\u0026logo=openai\u0026logoColor=ffffff\" /\u003e\n\u003c/div\u003e\n\n## 🤖 環境構築・起動\n\n\u003e 環境構築について記載しています．\n\n\u003cdetails\u003e\n\u003csummary\u003e環境構築\u003c/summary\u003e\n\n1. `Git` と `Docker Desktop` をインストールしてください．\n2. 任意のディレクトリで`git clone https://github.com/273Do/OpenAI-API-with-Google-Docs`を実行してください．\n3. `Dockerfile`があるディレクトリ(ルート)に移動します．\n4. 移動したディレクトリに`.env`ファイルと`service_account`ディレクトリを作成します．\n\n5. `.env`ファイルに以下を記載してください．\n\n   \u003e OPENAI_API_KEY=\n   \u003e\n   \u003e DOCUMENT_ID=\n\n6. [こちらの記事](https://mashimashi.net/skill/821)を参考に，Google Cloud Platform にアクセスして，**Google Drive API** と **Google Docs API** を有効化し，認証情報(json ファイル)をダウンロードしてください．\n7. ダウンロードした認証情報を`credential.json`とファイル名を変更して，`service_account`ディレクトリに移動させます．\n8. Google Drive に 専用テンプレートをコピーし，ドキュメントの URL を取得してください．(テンプレートについては開発者にお問い合わせください．)\n9. 取得した URL`https://docs.google.com/document/d/\u003cDOCUMENT_ID\u003e`の`\u003cDOCUMENT_ID\u003e`の部分を控えてください．\n10. `.env`ファイルに OpenAI API の API キーと控えた DOCUMENT_ID を記載してください．\n11. ファイル構成を確認してください．\n\n```\n 📁openai-api-with-google-docs\n └── 📁service_account\n     └── credential.json\n └── .env\n └── .gitignore\n └── app.py\n └── docker-compose.yml\n └── Dockerfile\n └── README.md\n └── requirements.txt\n```\n\n12. `Docker Desktop`を起動して，`Dockerfile`があるディレクトリ(ルート)に移動します．\n13. `docker compose build`を実行してコンテナイメージを作成します．\n\n\u003c/details\u003e\n\n\u003e [!CAUTION]\n\u003e .env ファイルと認証情報は絶対に公開しないでください．\n\u003e\n\u003e \u003cbr\u003e\n\n\u003e 起動方法と終了方法について記載しています．\n\n\u003cdetails\u003e\n\n\u003csummary\u003e起動方法と終了方法\u003c/summary\u003e\n\n### 起動方法\n\n1. `Docker Desktop`を起動します．\n2. `docker-compose.yml`があるディレクトリ(ルート)に移動します．\n3. `docker compose up -d`を実行してコンテナを起動します．(もしくは`Docker Desktop`のコンテナ起動ボタンを押します．)\n4. `docker compose exec openai-api-with-google-docs bash`でコンテナの中に入ります．\n5. `python3 app.py`でコードが実行できます．\n\n### 終了方法\n\n1. コンテナに入っている場合は`exit`で抜けられます．\n2. `docker compose down`を実行してコンテナを終了します．(もしくは`Docker Desktop`のコンテナ終了ボタンを押します．)\n\n\u003c/details\u003e\n\n\u003e [!TIP]\n\u003e コンテナイメージを作成したら，以降は以下の手順でコンテナを起動するだけで OK です.\n\u003e 新たにライブラリや依存関係をインストールする場合は，`requirements.txt`にライブラリを記載して`docker compose build`を実行します．\n\n## 🤖 クレジット・免責事項\n\n- 開発：[273\\*](https://www.273doworks.com/)\n- この作成物および同梱物を使用したことによって生じたすべての障害・損害・不具合等に関しては，私と私の関係者および私の所属するいかなる団体・組織とも，一切の責任を負いません．各自の責任においてご使用ください．\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F273do%2Fopenai-api-with-google-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F273do%2Fopenai-api-with-google-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F273do%2Fopenai-api-with-google-docs/lists"}