Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli interface #31

Open
HannuEKN opened this issue Oct 5, 2024 · 0 comments
Open

cli interface #31

HannuEKN opened this issue Oct 5, 2024 · 0 comments

Comments

@HannuEKN
Copy link

HannuEKN commented Oct 5, 2024

  • gpx_converter version: $ gpx_converter -v => no output (installed 2024-10-05)
  • Python version: 3.12.3
  • Operating System: Ubuntu 24.04

Description

Convert a single point csv to gpx from cli.

What I Did

$ pip install --break-system-packages -U gpx-converter # as there is no python-gpx_converter apt package
$ gpx_converter --function "csv_to_gpx" -in g.csv --out_file g.gpx 
Traceback (most recent call last):
  File "/home/hannu/.local/bin/gpx_converter", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/hannu/.local/lib/python3.12/site-packages/gpx_converter/cli.py", line 44, in main
    args.func(args)
  File "/home/hannu/.local/lib/python3.12/site-packages/gpx_converter/cli.py", line 16, in run
    converter.csv_to_gpx(args.output_file)
  File "/home/hannu/.local/lib/python3.12/site-packages/gpx_converter/base.py", line 209, in csv_to_gpx
    raise Exception("you need to provide an output file!")
Exception: you need to provide an output file!

This happens regardless of -out or --out_file argument.

This in contrast to using it as in:

#!/bin/env python

from gpx_converter import Converter

Converter(input_file='g.csv').csv_to_gpx(lats_colname='lat',
                                                 longs_colname='long',
                                                 output_file='g.gpx')

... which does create g.gpx - with reasonable content;
but as the ARGUMENT is not received deeper down in code when launched from CLI, it isn't relevant here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant