gpx-converter


Namegpx-converter JSON
Version 2.1.0 PyPI version JSON
download
home_pagehttps://github.com/nidhaloff/gpx_converter
SummaryPython package for manipulating gpx files and easily convert gpx to other different formats.
upload_time2023-02-07 21:00:04
maintainer
docs_urlNone
authorNidhal Baccouri
requires_python>=3.5
licenseMIT license
keywords gpx_converter gpx gps gsi global positioning system positioning system position gps conversion gpx conversion convert gpx to csv convert csv to gpx convert gpx to json convert gpx to array convert json to gpx
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =============
gpx-converter
=============

.. image:: https://github.com/nidhaloff/gpx-converter/blob/master/assets/icon.png
    :width: 100
    :align: center
    :alt: gpx-converter-icon

|



.. image:: https://img.shields.io/pypi/v/gpx-converter.svg
        :target: https://pypi.python.org/pypi/gpx-converter

.. image:: https://img.shields.io/travis/nidhaloff/gpx-converter.svg
        :target: https://travis-ci.com/nidhaloff/gpx-converter

.. image:: https://readthedocs.org/projects/gpx-converter/badge/?version=latest
        :target: https://gpx-converter.readthedocs.io/en/latest/?badge=latest
        :alt: Documentation Status
.. image:: https://img.shields.io/pypi/wheel/gpx-converter
        :alt: PyPI - Wheel
        :target: https://pypi.python.org/pypi/gpx-converter

.. image:: https://pepy.tech/badge/gpx-converter
        :target: https://pepy.tech/project/gpx-converter


.. image:: https://img.shields.io/pypi/l/gpx-converter
        :alt: PyPI - License
        :target: https://pypi.python.org/pypi/gpx-converter


.. image:: https://img.shields.io/twitter/url?url=https%3A%2F%2Ftwitter.com%2FNidhalBaccouri
        :alt: Twitter URL
        :target: https://twitter.com/NidhalBaccouri



GPX manipulation for humans
----------------------------

Python package for manipulating gpx files and easily convert gpx to other different formats.

* Free software: MIT license
* Documentation: https://gpx-converter.readthedocs.io.

When & Why
----------
- You need to convert GPX to other formats
- You need to convert other formats like csv to GPX
- You want to interpolate the GPX coordinates
- High level of abstraction
- Stable API
- easy to use and to extend

Motivation
----------

I decided to create this project because I had gpx data that I needed to manipulate. I searched for a python
package for this but I did not find what I was looking for, therefore I created the gpx-converter package
to make gpx files manipulation very easy. Furthermore, the package contains methods for applying interpolation
on the gpx data. This feature was very helpful for me since I also needed to interpolate the gpx data and
convert it to csv.
Feel free to contribute or to give me feedback anytime :)

Features
--------

- Convert gpx files to other formats such as csv, numpy arrays, dataframes, excel and json
- Convert csv files to gpx
- Apply interpolation on the gpx data

Installation
------------

.. code-block:: console

    $ pip install -U gpx-converter


Quick Usage
-----------

.. code-block:: python

    from gpx_converter import Converter

**Just read the gpx to dictionary**

.. code-block:: python

    dic = Converter(input_file='your_input.gpx').gpx_to_dictionary(latitude_key='latitude', longitude_key='longitude')
    # now you have a dictionary and can access the longitudes and latitudes values from the keys
    latitudes = dic['latitude']
    longitudes = dic['longitude']

**Convert GPX to other formats**

- Convert from gpx to csv:

.. code-block:: python

    Converter(input_file='your_input.gpx').gpx_to_csv(output_file='your_output.csv')

- Convert from gpx to excel sheets:

.. code-block:: python

    Converter(input_file='your_input.gpx').gpx_to_excel(output_file='your_output.xlsx')

- Convert from gpx to json:

.. code-block:: python

    Converter(input_file='your_input.gpx').gpx_to_json(output_file='your_output.json)

- Convert gpx file to dataframe:

.. code-block:: python

    df = Converter(input_file='your_input.gpx').gpx_to_dataframe()

- Convert gpx file to numpy array:

.. code-block:: python

    np_array = Converter(input_file='your_input.gpx').gpx_to_numpy_array()


**Now convert other formats to GPX**

- csv to gpx

.. code-block:: python

    Converter(input_file='your_input.csv').csv_to_gpx(lats_colname='column_name_of_latitudes',
                                                     longs_colname='column_name_of_longitudes',
                                                     output_file='your_output.gpx')

- excel to gpx

.. code-block:: python

    Converter(input_file='your_input.xlsx').excel_to_gpx(lats_colname='column_name_of_latitudes',
                                                     longs_colname='column_name_of_longitudes',
                                                     output_file='your_output.gpx')

- dataframe to gpx (notice that the method is static)

.. code-block:: python

    Converter.dataframe_to_gpx(input_df=your_df,
                               lats_colname='column_name_of_latitudes',
                               longs_colname='column_name_of_longitudes',
                               output_file='your_output.gpx')

- json to gpx

.. code-block:: python

    Converter(input_file='your_input.json').json_to_gpx(input_df=your_df,
                                                       lats_colname='column_name_of_latitudes',
                                                       longs_colname='column_name_of_longitudes',
                                                       output_file='your_output.gpx')


- Automate the conversion of multiple csv file to gpx:

.. code-block:: python

    Converter.convert_multi_csv_to_gpx(dirpath='your_directory/')

- Apply spline interpolation on gpx file (you need to install scipy for this to work):

.. code-block:: python

    interpolated_coordinates = Converter.spline_interpolation(cv=your_array_of_control_vertices)

Usage from terminal
--------------------

Alternatively you can use the gpx_converter directly from terminal.
You just need to pass the function, input file and output file as arguments.

- function: the conversion method you want to use. For example "gpx_to_csv"
- input file: path to your input file
- output file: path to your output file

.. code-block:: console

    $ gpx_converter --function "gpx_to_csv" --input_file "home/your_input.gpx" --output_file "home/your_output.csv"

or maybe you prefer the short version

.. code-block:: console

    $ gpx_converter -func "gpx_to_csv" -in "home/your_input.gpx" -out "home/your_output.csv"

Links
-----
Check this article to know more about gpx files and how to use the gpx-converter package.
https://medium.com/p/57da00bd36fc/edit

Contributions
--------------
Contributions are always welcome. Make sure you check the guidlines first https://gpx-converter.readthedocs.io/en/latest/contributing.html




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nidhaloff/gpx_converter",
    "name": "gpx-converter",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "gpx_converter,GPX,GPS,GSI,Global Positioning System,Positioning System,Position,GPS conversion,GPX conversion,convert gpx to csv,convert csv to gpx,convert gpx to json,convert gpx to array,convert json to gpx",
    "author": "Nidhal Baccouri",
    "author_email": "nidhalbacc@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/aa/0a/8a919957b0359738a9b40b335deaf84340764f01d1973174d6ab66f97fe1/gpx_converter-2.1.0.tar.gz",
    "platform": null,
    "description": "=============\ngpx-converter\n=============\n\n.. image:: https://github.com/nidhaloff/gpx-converter/blob/master/assets/icon.png\n    :width: 100\n    :align: center\n    :alt: gpx-converter-icon\n\n|\n\n\n\n.. image:: https://img.shields.io/pypi/v/gpx-converter.svg\n        :target: https://pypi.python.org/pypi/gpx-converter\n\n.. image:: https://img.shields.io/travis/nidhaloff/gpx-converter.svg\n        :target: https://travis-ci.com/nidhaloff/gpx-converter\n\n.. image:: https://readthedocs.org/projects/gpx-converter/badge/?version=latest\n        :target: https://gpx-converter.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n.. image:: https://img.shields.io/pypi/wheel/gpx-converter\n        :alt: PyPI - Wheel\n        :target: https://pypi.python.org/pypi/gpx-converter\n\n.. image:: https://pepy.tech/badge/gpx-converter\n        :target: https://pepy.tech/project/gpx-converter\n\n\n.. image:: https://img.shields.io/pypi/l/gpx-converter\n        :alt: PyPI - License\n        :target: https://pypi.python.org/pypi/gpx-converter\n\n\n.. image:: https://img.shields.io/twitter/url?url=https%3A%2F%2Ftwitter.com%2FNidhalBaccouri\n        :alt: Twitter URL\n        :target: https://twitter.com/NidhalBaccouri\n\n\n\nGPX manipulation for humans\n----------------------------\n\nPython package for manipulating gpx files and easily convert gpx to other different formats.\n\n* Free software: MIT license\n* Documentation: https://gpx-converter.readthedocs.io.\n\nWhen & Why\n----------\n- You need to convert GPX to other formats\n- You need to convert other formats like csv to GPX\n- You want to interpolate the GPX coordinates\n- High level of abstraction\n- Stable API\n- easy to use and to extend\n\nMotivation\n----------\n\nI decided to create this project because I had gpx data that I needed to manipulate. I searched for a python\npackage for this but I did not find what I was looking for, therefore I created the gpx-converter package\nto make gpx files manipulation very easy. Furthermore, the package contains methods for applying interpolation\non the gpx data. This feature was very helpful for me since I also needed to interpolate the gpx data and\nconvert it to csv.\nFeel free to contribute or to give me feedback anytime :)\n\nFeatures\n--------\n\n- Convert gpx files to other formats such as csv, numpy arrays, dataframes, excel and json\n- Convert csv files to gpx\n- Apply interpolation on the gpx data\n\nInstallation\n------------\n\n.. code-block:: console\n\n    $ pip install -U gpx-converter\n\n\nQuick Usage\n-----------\n\n.. code-block:: python\n\n    from gpx_converter import Converter\n\n**Just read the gpx to dictionary**\n\n.. code-block:: python\n\n    dic = Converter(input_file='your_input.gpx').gpx_to_dictionary(latitude_key='latitude', longitude_key='longitude')\n    # now you have a dictionary and can access the longitudes and latitudes values from the keys\n    latitudes = dic['latitude']\n    longitudes = dic['longitude']\n\n**Convert GPX to other formats**\n\n- Convert from gpx to csv:\n\n.. code-block:: python\n\n    Converter(input_file='your_input.gpx').gpx_to_csv(output_file='your_output.csv')\n\n- Convert from gpx to excel sheets:\n\n.. code-block:: python\n\n    Converter(input_file='your_input.gpx').gpx_to_excel(output_file='your_output.xlsx')\n\n- Convert from gpx to json:\n\n.. code-block:: python\n\n    Converter(input_file='your_input.gpx').gpx_to_json(output_file='your_output.json)\n\n- Convert gpx file to dataframe:\n\n.. code-block:: python\n\n    df = Converter(input_file='your_input.gpx').gpx_to_dataframe()\n\n- Convert gpx file to numpy array:\n\n.. code-block:: python\n\n    np_array = Converter(input_file='your_input.gpx').gpx_to_numpy_array()\n\n\n**Now convert other formats to GPX**\n\n- csv to gpx\n\n.. code-block:: python\n\n    Converter(input_file='your_input.csv').csv_to_gpx(lats_colname='column_name_of_latitudes',\n                                                     longs_colname='column_name_of_longitudes',\n                                                     output_file='your_output.gpx')\n\n- excel to gpx\n\n.. code-block:: python\n\n    Converter(input_file='your_input.xlsx').excel_to_gpx(lats_colname='column_name_of_latitudes',\n                                                     longs_colname='column_name_of_longitudes',\n                                                     output_file='your_output.gpx')\n\n- dataframe to gpx (notice that the method is static)\n\n.. code-block:: python\n\n    Converter.dataframe_to_gpx(input_df=your_df,\n                               lats_colname='column_name_of_latitudes',\n                               longs_colname='column_name_of_longitudes',\n                               output_file='your_output.gpx')\n\n- json to gpx\n\n.. code-block:: python\n\n    Converter(input_file='your_input.json').json_to_gpx(input_df=your_df,\n                                                       lats_colname='column_name_of_latitudes',\n                                                       longs_colname='column_name_of_longitudes',\n                                                       output_file='your_output.gpx')\n\n\n- Automate the conversion of multiple csv file to gpx:\n\n.. code-block:: python\n\n    Converter.convert_multi_csv_to_gpx(dirpath='your_directory/')\n\n- Apply spline interpolation on gpx file (you need to install scipy for this to work):\n\n.. code-block:: python\n\n    interpolated_coordinates = Converter.spline_interpolation(cv=your_array_of_control_vertices)\n\nUsage from terminal\n--------------------\n\nAlternatively you can use the gpx_converter directly from terminal.\nYou just need to pass the function, input file and output file as arguments.\n\n- function: the conversion method you want to use. For example \"gpx_to_csv\"\n- input file: path to your input file\n- output file: path to your output file\n\n.. code-block:: console\n\n    $ gpx_converter --function \"gpx_to_csv\" --input_file \"home/your_input.gpx\" --output_file \"home/your_output.csv\"\n\nor maybe you prefer the short version\n\n.. code-block:: console\n\n    $ gpx_converter -func \"gpx_to_csv\" -in \"home/your_input.gpx\" -out \"home/your_output.csv\"\n\nLinks\n-----\nCheck this article to know more about gpx files and how to use the gpx-converter package.\nhttps://medium.com/p/57da00bd36fc/edit\n\nContributions\n--------------\nContributions are always welcome. Make sure you check the guidlines first https://gpx-converter.readthedocs.io/en/latest/contributing.html\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Python package for manipulating gpx files and easily convert gpx to other different formats.",
    "version": "2.1.0",
    "split_keywords": [
        "gpx_converter",
        "gpx",
        "gps",
        "gsi",
        "global positioning system",
        "positioning system",
        "position",
        "gps conversion",
        "gpx conversion",
        "convert gpx to csv",
        "convert csv to gpx",
        "convert gpx to json",
        "convert gpx to array",
        "convert json to gpx"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8036b2f1a65998738a962f38e2bc2f6f5e8875310b62910108cadc11836f06d",
                "md5": "8a967045cd9f1e1a3f9d0ea854ef85fc",
                "sha256": "347097cc1e99afc2b42b9fa721d4f4904fb84cfe90a1790ad3be09d75ef8491f"
            },
            "downloads": -1,
            "filename": "gpx_converter-2.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8a967045cd9f1e1a3f9d0ea854ef85fc",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.5",
            "size": 8146,
            "upload_time": "2023-02-07T21:00:02",
            "upload_time_iso_8601": "2023-02-07T21:00:02.752600Z",
            "url": "https://files.pythonhosted.org/packages/e8/03/6b2f1a65998738a962f38e2bc2f6f5e8875310b62910108cadc11836f06d/gpx_converter-2.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aa0a8a919957b0359738a9b40b335deaf84340764f01d1973174d6ab66f97fe1",
                "md5": "d3f5a9546da5162918eb2b0cb03eab31",
                "sha256": "77d32230c04d4871ffdf91bf9135ef62caf4f04903f3e479c5313c9b47531fbe"
            },
            "downloads": -1,
            "filename": "gpx_converter-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d3f5a9546da5162918eb2b0cb03eab31",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 18512,
            "upload_time": "2023-02-07T21:00:04",
            "upload_time_iso_8601": "2023-02-07T21:00:04.313848Z",
            "url": "https://files.pythonhosted.org/packages/aa/0a/8a919957b0359738a9b40b335deaf84340764f01d1973174d6ab66f97fe1/gpx_converter-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-07 21:00:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "nidhaloff",
    "github_project": "gpx_converter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "gpx-converter"
}
        
Elapsed time: 0.05604s