Skip to main content
# Haversine [![Build Status](https://travis-ci.org/mapado/haversine.svg?branch=master)](https://travis-ci.org/mapado/haversine)
Calculate the distance (in km or in miles) between two points on Earth,
located by their latitude and longitude.


## Example: distance between Lyon and Paris
```python
from haversine import haversine

lyon = (45.7597, 4.8422) # (lat, lon)
paris = (48.8567, 2.3508)

haversine(lyon, paris)
# 392.21671780659625 # in kilometers

haversine(lyon, paris, miles=True)
# 243.71209416020253 # in miles

haversine(lyon, paris, nautical_miles=True)
# 211.7801622966963 # in nautical miles
```

## Installation
```bash
$ pip install haversine
```
## Contributing

Clone the project

Install [pipenv](https://github.com/pypa/pipenv).

Run `pipenv install`

Launch test with `pipenv run pytest`

Metadata

Release files for haversine 1.0.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 haversine 1.0.0
File Size Uploaded Provenance Actions
haversine-1.0.0.tar.gz 2.1 kB Without provenance Details for haversine-1.0.0.tar.gz

Release files / haversine-1.0.0.tar.gz

Download URL haversine-1.0.0.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5af366bea6755ad42ba9495be58f24f55f32fa4ba6f2d0a2642211958e829603
BLAKE2b-256 checksum
How to use checksums
5edbf550b7c4f7683e7c5687b459b2db8c589a4b96f7e8d360f197d381b84727
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Security for haversine 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.

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