Skip to main content

TravelPurpose

City travel purpose classification — instantly know whether a destination is primarily a BUSINESS, LEISURE, MEDICAL, RELIGIOUS, CRUISE or SECONDHOME city. Covers 417 destinations across Europe, Asia, Americas, Africa and the Middle East. Zero dependencies.

PyPI version Python 3.9+ License: MIT GitHub Sponsors

Installation

pip install travelpurpose

Quick Start

from travelpurpose import TravelPurpose

tp = TravelPurpose()

# Classify a single city
result = tp.classify("Antalya")
print(result.primary_tag)   # LEISURE
print(result.tags)          # ['LEISURE']
print(result.country)       # Turkey
print(result.region)        # Europe
print(result.is_leisure())  # True

# A business-dominant city
biz = tp.classify("Frankfurt")
print(biz.primary_tag)      # BUSINESS
print(biz.is_business())    # True

# A religious destination
mecca = tp.classify("Medina")
print(mecca.primary_tag)    # RELIGIOUS
print(mecca.is_religious()) # True

# Search by tag
leisure_cities = tp.search("LEISURE")
print(len(leisure_cities))  # 123

# Search by region
africa = tp.search_by_region("Africa")
print(len(africa))          # 61

# Dataset statistics
stats = tp.stats()
# {'total_cities': 417, 'tags': {'BUSINESS': 249, 'LEISURE': 123, ...}, ...}
print(len(tp))              # 417

Travel Purpose Tags

Tag Description Count
BUSINESS Commercial hub, corporate travel 249
LEISURE Tourism, vacation, recreation 123
SECONDHOME Expat communities, retirement, long stays 31
RELIGIOUS Pilgrim destinations, holy sites 7
MEDICAL Medical tourism, healthcare travel 3
CRUISE Cruise port destinations 2
SEAMAN Maritime crew destinations 2

Each city carries exactly one primary tag reflecting its dominant travel purpose in the dataset.

Regional Coverage

  • Europe: 163 cities
  • Asia: 92 cities
  • Americas: 65 cities
  • Africa: 61 cities
  • Middle East: 36 cities

Data Source

The classification reflects airline-industry destination taxonomy — how the aviation sector categorizes cities by the dominant reason passengers fly there. This means some classifications differ from general tourist expectations:

  • A city tagged MEDICAL has significant medical-tourism traffic in airline data (e.g. Istanbul, Ankara)
  • A city tagged SECONDHOME has high long-stay/expat passenger volume (e.g. Paris, Frankfurt, Hamburg)
  • BUSINESS covers commercial hubs where corporate travel dominates

This makes the dataset well-suited for travel tech, booking analytics, and insurance segmentation where the aviation-industry perspective is relevant.

Use Cases

  • Travel apps — filter destinations by trip purpose
  • Insurance — categorize policies by destination type
  • Booking analytics — segment data by city purpose in airline/OTA context
  • Marketing — target campaigns by travel motivation
  • GIS tools — enrich geospatial datasets with travel context

API Reference

TravelPurpose()

tp = TravelPurpose()

tp.classify(city: str) → CityResult
tp.search(tag: str) → List[CityResult]
tp.search_by_region(region: str) → List[CityResult]
tp.stats() → dict
tp.all_tags() → List[str]
len(tp)  # number of cities in dataset

CityResult

result.city          # str
result.country       # str
result.region        # str
result.tags          # List[str]  — one tag per city
result.primary_tag   # str (dominant purpose)
result.is_known      # bool (False for unrecognized cities)
result.is_business() → bool
result.is_leisure()  → bool
result.is_medical()  → bool
result.is_religious()→ bool
result.to_dict()     → dict

Support the Project

If TravelPurpose powers your app, consider sponsoring on GitHub.

License

MIT

Metadata

Release files for travelpurpose 2.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for travelpurpose 2.5.0
File Size Uploaded Provenance Actions
travelpurpose-2.5.0.tar.gz 76.4 kB Without provenance Details for travelpurpose-2.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for travelpurpose 2.5.0
File Interpreter ABI Platform Actions
travelpurpose-2.5.0-py3-none-any.whl Python 3 none any Details for travelpurpose-2.5.0-py3-none-any.whl

Total release size: 163.2 kB

Release files / travelpurpose-2.5.0.tar.gz

Download URL travelpurpose-2.5.0.tar.gz
Size 76.4 kB
Tags Source
SHA-256 checksum
How to use checksums
23bbbc1211f9da1bdda0f5ac0fdf99696f7a6177cebdf56d6346c3b91dde2f41
BLAKE2b-256 checksum
How to use checksums
13343afac86c5a8ebe14c20fc8805de88daaabb174091ac4bd6a844df6d76dfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / travelpurpose-2.5.0-py3-none-any.whl

Download URL travelpurpose-2.5.0-py3-none-any.whl
Size 86.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2411707d94613eddd75385b6fe38208b05132a99f0e969da1c2f1929c1621d0
BLAKE2b-256 checksum
How to use checksums
d2de84462dd82315b76a5f63bde2ce41654e280ff71a8faf2be3cce54084b993
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Security for travelpurpose 2.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page