Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

EarthView: read key from GOOGLE_MAPS_API_KEY to avoid clash with Gemini's GOOGLE_API_KEY

オープン
#125 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python

調査の方向性

Review Sources.py and EarthView.__init__, then run the TestEarthViewKey tests in tests/test_image_sources.py. The issue says the change is already implemented on fix/earthview-maps-key-env; rebase on main if needed, open a PR, and check the RVC3 text and notebooks for instructions that still recommend GOOGLE_API_KEY. Done means the PR is opened and those instructions are updated where necessary.

索引モデルが issue の本文から書いたものです。

説明

enhancement

EarthView reads its Google Maps key only from the GOOGLE_API_KEY environment variable (Sources.py, EarthView.__init__). That is also the first name Google's Gemini libraries (google-genai) check, so anyone with both a Maps key and a Gemini key can only satisfy one of them: whichever key is in GOOGLE_API_KEY, the other tool gets the wrong one.

Proposed fix

Read GOOGLE_MAPS_API_KEY first, falling back to GOOGLE_API_KEY so existing setups keep working:

self.key = os.getenv("GOOGLE_MAPS_API_KEY") or os.getenv("GOOGLE_API_KEY")

and update the docstring to explain the lookup order, recommend GOOGLE_MAPS_API_KEY, and advise restricting the key to the Maps Static API with a daily quota (an unrestricted Maps key that leaks can run up charges).

Status

Implemented and tested on branch fix/earthview-maps-key-env (commit 4e12d1b), not yet opened as a PR:

  • EarthView.__init__ lookup changed as above, docstring updated
  • 4 new tests in tests/test_image_sources.py (TestEarthViewKey): Maps key preferred, GOOGLE_API_KEY fallback, explicit key= wins, no key gives None; no network access needed
  • tests/test_image_sources.py passes (13 passed, 20 skipped for optional extras) in a clean venv
Possible follow-up

With no key at all, self.key is None and the failure only shows up later as an HTTP error from Google. A clear error at construction time (or on first grab) naming both environment variables would be friendlier.

To finish

Open a PR from the branch (rebase on main first if it has moved), and update the RVC3 text/notebooks if they tell readers to set GOOGLE_API_KEY.

主要言語
Python
スター
223
フォーク
30
平均マージ
1時間 4分
マージ済み PR(30日)
9

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

petercorke/machinevision-toolbox-python のほかの issue

petercorke/machinevision-toolbox-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。