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.
Installation
pip install travelpurpose
Quick Start
from travelpurpose import TravelPurpose
tp = TravelPurpose()
# Classify a single city
result = tp.classify("Istanbul")
print(result.primary_tag) # MEDICAL
print(result.tags) # ['MEDICAL', 'BUSINESS', 'LEISURE']
print(result.country) # Turkey
print(result.region) # Europe
# Boolean helpers
print(result.is_business()) # True
print(result.is_leisure()) # True
print(result.is_medical()) # True
# Search by tag
leisure_cities = tp.search("LEISURE")
print(len(leisure_cities)) # 123+
# Search by region
europe = tp.search_by_region("Europe")
print(len(europe)) # 163+
# Dataset statistics
stats = tp.stats()
# {'total_cities': 417, 'tags': {'BUSINESS': 249, 'LEISURE': 123, ...}, ...}
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 |
Cities can have multiple tags (e.g. Istanbul = MEDICAL + BUSINESS + LEISURE).
Regional Coverage
- Europe: 163 cities
- Asia: 92 cities
- Americas: 65 cities
- Africa: 61 cities
- Middle East: 36 cities
Use Cases
- Travel apps — filter destinations by trip purpose
- Insurance — categorize policies by destination type
- Analytics — segment booking data by city purpose
- 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]
result.primary_tag # str (most specific tag)
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 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| travelpurpose-1.0.0.tar.gz | 12.1 kB | Without provenance | Details for travelpurpose-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| travelpurpose-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for travelpurpose-1.0.0-py3-none-any.whl |
Total release size: 22.5 kB
Release files / travelpurpose-1.0.0.tar.gz
| Download URL | travelpurpose-1.0.0.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2001fdd32ae0ca342c4747dcd56e771dda077e907d9d38fe2ad8522cc9961616
|
|
BLAKE2b-256 checksum How to use checksums |
c80e9681ba9314b16de5faa7813dffa0194b5ae75e4b7eb7da4256262ca06933
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / travelpurpose-1.0.0-py3-none-any.whl
| Download URL | travelpurpose-1.0.0-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3a1067112e9db4a7aba6b94c14de3abff59019169abe89870c35187b16f3163f
|
|
BLAKE2b-256 checksum How to use checksums |
d4b1a25771b6fa8f170fc99a4892e9fe34d049525f21c0a4eada0ca645191e9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Security for travelpurpose 1.0.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.