coordextract
coordextract is a Python library and CLI tool for converting data from GPX files into pydantic models for further processesing. It was designed to be used as a FastAPI service.
While building the pydantic model it verifies that the points are legitimate and does MGRS conversion which is added to the model as a new field.
The CLI tool will output the model as a JSON string or file.
Features
- Batch process GPX files asynchronously with asyncio.
- Use CPU concurrency if datasets are large.
- Command-line interface (CLI).
Installation
poetry add coordextract
or
pip install coordextract
coordextract uses Poetry for dependency management. Poetry website
To install the development version of coordextract, clone the repository and install the dependencies with Poetry.
git clone https://github.com/SMcLeaish/coordextract/
cd coordextract
poetry install
As a library
The main entry point for the library is the CoordExtract.process_coords()
from coordextract import process_coords
"""
process_coords() takes five arguments:
- input_file(s): Path - The path to the input GPX file(s).
- output_file: Optional(Path) - The path to the output file.
- indent: Optional(int) - The number of spaces to indent JSON output.
Default 2.
- concurrency: Optional(bool) - Will attempt to spawn multiple processes
for batch requests. Default False.
- context: Optional(str) - If None a the PointModel will be returned.
If set to cli, output will be JSON to stdout if no output file is
specified. Default None.
"""
process_coords('path/to/file.gpx', 'path/to/output.csv', 2, True, 'cli')
As a CLI tool
coordextract on the command line takes gpx file(s) as its first input and supports the following options:
--output-file - The path to the output file.
--indent - The number of spaces to indent JSON output. Default 2.
--concurrency - Will attempt to spawn multiple processes for batch requests.
--help - Display the help message.
License
This project is licensed under the MIT License - see the LICENSE file for details.
This repository is mirrored at https://github.com/SMcLeaish/coordextract/ from https://gitlab.com/smcleaish/coordextract and uses gitlab CI
Metadata
Release files for coordextract 0.1.3
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 |
|---|---|---|---|---|
| coordextract-0.1.3.tar.gz | 11.5 kB | Without provenance | Details for coordextract-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| coordextract-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for coordextract-0.1.3-py3-none-any.whl |
Total release size: 24.8 kB
Release files / coordextract-0.1.3.tar.gz
| Download URL | coordextract-0.1.3.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff0eedfb2538cc5e20aa3c6a97f114b7c100aa350330c80a9e676b9f26593753
|
|
BLAKE2b-256 checksum How to use checksums |
676f5c3f9966e423bf0a1b91b9e3fd396b3fe5acb79f684ce989b3e9fff6e37e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.10.13 Darwin/23.1.0
|
Release files / coordextract-0.1.3-py3-none-any.whl
| Download URL | coordextract-0.1.3-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
302ececdb7aa1975654572c560d6f258e605fa92f086e535f4c7d5d8d712fde9
|
|
BLAKE2b-256 checksum How to use checksums |
3570e31308313c8c8827fe11d877df2d1c329f1e587125ffbea460d7012e666b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.10.13 Darwin/23.1.0
|
Security for coordextract 0.1.3
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.