coordconvertergc
A Python package for converting geographic coordinates between degrees, minutes, seconds and decimal degrees.
Created by Gracious Chinguwo
Installation
Install the package from PyPi using: pip install coordconvertergc
Usage
- Convert DMS to decimal degrees Use to_decimal() to convert latitude and longitude from DMS to decimal degrees. Southern and western coordinates are returned as negative values.
from coordconvertergc import to_decimal latitude = (15, 47, 0, "S") longitude = (35, 0, 0, "E")
result = to_decimal(latitude, longitude) print(result)
Output: (-15.783333333333333, 35.0)
- Convert decimal degrees to DMS Use to_degree() to convert decimal-degree latitude and longitude to DMS coordinates.
from coordconvertergc import to_degree latitude = -15.783333333333333 longitude = 35.0
result = to_degree(latitude, longitude) print(result)
output: ((15, 47, 0.0, 'S'), (35, 0, 0.0, 'E'))
Input Validation
The functions validate coordinate ranges, DMS values, and compass directions. Invalid inputs raise a ValueError with an explanatory message.
Example 1: Invalid latitude
to_degree(95, 35)
This raises a ValueError because latitude must be between -90 and 90 degrees.
Example 2: Invalid longitude
to_degree(15, 200)
This raises a ValueError because longitude must be between -180 and 180 degrees.
These checks help ensure that only geographically valid coordinates are converted.
Contributing
Contributions are welcome. Please read the contributing guidelines and code of conduct before contributing.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project links
-
GitHub repository: https://github.com/Chinguwo8/coordconvertergc
-
PyPI package: https://pypi.org/project/coordconvertergc/
Credits
This package was created using Cookiecutter and the py-pkgs-cookiecutter template
Metadata
Release files for coordconvertergc 0.1.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 | |
|---|---|---|---|---|
| coordconvertergc-0.1.0.tar.gz | 3.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coordconvertergc-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / coordconvertergc-0.1.0.tar.gz
| Download URL | coordconvertergc-0.1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
445d60de74ef98a36c7ee0ce8b34bf1fa6790a292112c0203b4eede4b51e7d70
|
|
BLAKE2b-256 checksum How to use checksums |
a9114323a01cce2d0dc1a0ab3c7cd0eff32cec26f74eb3692bf305c50b2e08db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / coordconvertergc-0.1.0-py3-none-any.whl
| Download URL | coordconvertergc-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
911ce101b889b767ba9104abacc657a9b33acfee091588ba91be96a520e1eabe
|
|
BLAKE2b-256 checksum How to use checksums |
d9586a64f4d35b1c2bbc4701fa82e874f3bae9be8727025fc2da8da3eb0c218b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Security for coordconvertergc 0.1.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.