csv2db icon indicating copy to clipboard operation
csv2db copied to clipboard

Convert into a Python package

Open multimeric opened this issue 4 years ago • 2 comments
trafficstars

Hi, just thinking that there would be a number of advantages to converting this to a Python package:

  • You get automatic executable installation. ie the user can pip install csv2db and then execute csv2db load in any directory without needing to know where the executable is (./csv2db)
  • You get a Python API. This allows people to run this more smoothly from Python without needing to use subprocess etc

multimeric avatar Jul 21 '21 05:07 multimeric

Hi @multimeric,

Thanks a lot for your ideas!

If I understand correctly, you would like for csv2db to also ship as a package on PyPI and hence then be invokable via python -m csv2db ...?

gvenzl avatar Jul 23 '21 05:07 gvenzl

It's one better. pip can install executables directly into the $PATH so that you could run it as csv2db without python -m.

If you package this using setuptools (the old fashioned way), the documentation is here: https://setuptools.readthedocs.io/en/latest/userguide/entry_point.html. If you use poetry (my preference) the documentation is here: https://python-poetry.org/docs/pyproject/#scripts.

multimeric avatar Jul 23 '21 05:07 multimeric

Hey @multimeric, thanks a lot for the suggestion. This is now implemented and will be released with the next version.

gvenzl avatar Oct 29 '23 19:10 gvenzl