Skip to main content

Geographic + Socioeconomic + Climate intelligence library for city data analysis with pandas integration

Project description

GeoDataSim

The Ultimate Geographic + Socioeconomic + Climate Intelligence Library

Create intelligent city profiles with a single line of code. No API keys needed for most features, completely free and open-source.

Features

  • 🌍 Geographic Intelligence - Population, coordinates, timezones, regions
  • 💰 Economic Data - GDP per capita, HDI, development indicators
  • ✈️ Travel Intelligence - Nearby airports, distances, routes
  • 🌤️ Climate Data - Weather patterns, climate zones, temperature ranges
  • 🏙️ City Similarity - Find similar cities based on multiple dimensions
  • 📊 Rich Indicators - 50+ socioeconomic indicators from World Bank
  • 🔄 Smart Caching - Fast responses with intelligent data caching
  • 🆓 Mostly Free - Uses public domain data sources (World Bank, OurAirports, UN)

Quick Start

from geodatasim import City

# Create a city profile
istanbul = City("Istanbul")

# Basic info
print(istanbul.population)          # 15,462,452
print(istanbul.country)             # Turkey
print(istanbul.coordinates)         # (41.0082, 28.9784)

# Economic indicators
print(istanbul.gdp_per_capita)      # From World Bank
print(istanbul.hdi)                 # Human Development Index

# Climate
print(istanbul.climate_zone)        # Mediterranean
print(istanbul.avg_temperature)     # 14.6°C

# Travel
print(istanbul.nearby_airports)     # [IST, SAW, ...]
print(istanbul.timezone)            # Europe/Istanbul

# Find similar cities
similar = istanbul.find_similar(n=5)
print(similar)  # [Athens, Barcelona, Rome, ...]

Installation

# Basic installation (no API keys needed)
pip install geodatasim

# With real-time weather (requires free OpenWeather API key)
pip install geodatasim[weather]

# Full installation
pip install geodatasim[full]

Data Sources

All data from legal, public domain sources:

  • World Bank Open Data - Economic indicators (Public Domain)
  • OurAirports - Airport data (Public Domain, MIT License)
  • Open-Meteo - Climate data (Open Source, Free)
  • UN Data - Country statistics (Open License)
  • Natural Earth - Geographic boundaries (Public Domain)

Features (v0.1.0)

Core Features

  • ✅ City class with 50+ attributes
  • ✅ World Bank API integration (GDP, HDI, indicators)
  • ✅ OurAirports integration (nearby airports)
  • ✅ Climate zone classification
  • ✅ City similarity algorithm
  • ✅ Smart caching system (90-day cache)
  • ✅ Built-in dataset for 500+ major cities

Upcoming (v0.2.0+)

  • 🔄 Real-time weather integration
  • 🔄 UN Data indicators
  • 🔄 Cost of living estimates
  • 🔄 Safety indices
  • 🔄 Cultural dimensions
  • 🔄 Travel purpose integration (from travelpurpose library)
  • 🔄 Ethnic diversity data (from ethnidata library)

Use Cases

  • 📊 Data Science - City embeddings for ML models
  • 🗺️ Urban Planning - Compare cities, analyze development
  • ✈️ Travel Tech - Destination recommendations, similarity search
  • 💼 Business Intelligence - Market analysis, expansion planning
  • 🎓 Research - Academic studies, geographic analysis
  • 📱 App Development - Location-based features, personalization

Architecture

GeoDataSim
├── Static Dataset (500+ cities, instant response)
├── Cached API Data (World Bank, 90-day refresh)
└── Real-time APIs (Optional, user's API key)

Smart 3-Layer Strategy:

  1. Built-in data - Instant, no API calls
  2. Cached data - Fast, updated quarterly
  3. Real-time data - Optional, for fresh data

Example: City Comparison

from geodatasim import City

cities = [City(name) for name in ["Istanbul", "Barcelona", "Athens"]]

for city in cities:
    print(f"{city.name}:")
    print(f"  Population: {city.population:,}")
    print(f"  GDP/capita: ${city.gdp_per_capita:,.0f}")
    print(f"  Climate: {city.climate_zone}")
    print(f"  Airports: {len(city.nearby_airports)}")
    print()

Example: Find Similar Cities

from geodatasim import City

paris = City("Paris")

# Find similar cities based on:
# - Population size
# - Economic development
# - Climate zone
# - Geographic region
similar = paris.find_similar(n=10)

for i, city in enumerate(similar, 1):
    print(f"{i}. {city.name} (similarity: {city.similarity_score:.2%})")

API Keys (Optional)

Most features work without any API keys. For real-time weather data:

from geodatasim import Config

# Optional: Set API keys for enhanced features
Config.set_api_key("openweather", "your_free_api_key")

Get free API keys:

Performance

  • Built-in data: < 1ms response time
  • Cached API data: < 10ms response time
  • Real-time API: < 500ms response time
  • City similarity: < 100ms for 1000 cities

Requirements

  • Python >= 3.10
  • requests >= 2.31.0
  • pandas >= 2.0.0
  • numpy >= 1.24.0

License

MIT License - Free for commercial use

Contributing

Contributions welcome! This library fills a real gap in the Python ecosystem.

Links


GeoDataSim v0.1.0: City Intelligence, Simplified.

Sources:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geodatasim-0.2.0.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geodatasim-0.2.0-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file geodatasim-0.2.0.tar.gz.

File metadata

  • Download URL: geodatasim-0.2.0.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for geodatasim-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c550910a3b840ca9a26cf34a86f1cf9c1342d8843ceee11c72954aacace7c58f
MD5 18cb59a2af09d6071e3f4bc0a31d8a16
BLAKE2b-256 5c025f92d1bbd190774e069680925540d90038439d4d809b642f1bbb3938d17f

See more details on using hashes here.

File details

Details for the file geodatasim-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: geodatasim-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 33.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for geodatasim-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba2753fb4d32247ea5e0d8cefe74fb30160f3813c9e14731d5b13347f1e6ae2b
MD5 26aa4991ab85fa7a8fe35f4d23015a34
BLAKE2b-256 2e674b3a5418a32145e1a1914ed1ebdcf67db99ac49205b1c9c6187787f8af14

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page