This repository contains a PyQt6 application that allows users to:
- Search for a city via Google Places Text Search.
- Fetch places around that city (attractions, hotels, restaurants) using Google Places Nearby Search.
- Select & Download location information as CSV files, including the option to download all results or just selected ones.
- Python 3.9+
- PyQt6 (for the GUI)
- Requests (for HTTP requests to Google APIs)
- pandas (for creating CSV files)
You will also need a Google API Key with Google Places API enabled.
Install the following libraries:
pip install PyQt6 requests pandas- Clone or download this repo:
git clone https://github.com/YOUR-USERNAME/places-to-csv.git cd places-to-csv - Install dependencies if not already installed:
pip install PyQt6 requests pandas
- Run the script from terminal:
python places.py
- On startup, the application prompts for your Google API key. Enter a valid key or exit.
- Type a city name in the "Enter a City" field and click "Search City".
- Select one of the returned city options. This sets the lat/lng for subsequent searches.
- Choose a distance and unit (km or mi), then check at least one category (Attractions, Hotels, Restaurants).
- Click "Search Places" to fetch places near the selected city.
- Results appear in a list. You can:
- Check specific rows and click "Download Selected CSV"
- or click "Download ALL CSV" to export everything.
- Make sure Places API (and billing) is enabled on your Google Cloud project.
- The API key must be active and unrestricted or restricted to the relevant services.
python places.py
# Enter API key when prompted
# Enter City: Dubai
# Click "Search City", select the city.
# Set Distance: 5 km
# Check "Hotels"
# Click "Search Places"
# Select some or all results, then download as CSV.MIT License. Feel free to fork and modify.