s3cmd icon indicating copy to clipboard operation
s3cmd copied to clipboard

s3cmd cannot be called as a python module

Open ssbarnea opened this issue 7 years ago • 3 comments

Most python packages that so install scripts can also be called as python modules. This is an important feature because it avoids the need to assure that the script is in PATH for using it.

Example tox, 'pip', 'flake8, which can be all be called using python -m module_name.

This is very easy to implement by only adding the main.py inside the module as entry point.

See https://github.com/tox-dev/tox/blob/master/tox/main.py as an example.

ssbarnea avatar Jun 04 '18 16:06 ssbarnea

It's indeed an issue. Today it is a little bit more complicated than that because the "main" code is in the s3cmd file that is not in the module itself, and when installed go to /usr/bin/

fviard avatar Jun 05 '18 22:06 fviard

@fviard is this still the case? i'd love to be able to use s3cmd as module in my python program instead of having to re-implement the methods in my code.

ltagliamonte avatar Jan 22 '22 23:01 ltagliamonte

@ltagliamonte this did not change for the moment. But, to be noted, most of the useful functions are located in the S3 folder in python modules, so you can use everything that is in S3/S3.py normally, like the s3cmd file does. ex: from S3 import S3 ; ...

fviard avatar Jan 22 '22 23:01 fviard