Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#125 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
223
Forks
30
Merge medio
1 h 4 min
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de petercorke/machinevision-toolbox-python

Todos los issues de petercorke/machinevision-toolbox-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.