Skip to content

Documentation Enhancement: How to use from Python Script (Example Provided)Β #66

@ignkarman

Description

@ignkarman

Hi there!

I spent a bit of time figuring out how to best use this tool from a python package I am developing.

in order to use transferwee from a python package, the script needs to be cloned and executed programmatically.

transferwee_path = os.path.join(__working_path__, 'transferwee/transferwee.py')
if not os.path.isfile(transferwee_path):
    Repo.clone_from("git@github.com:iamleot/transferwee.git", os.path.join(__working_path__, 'transferwee/'))
    subprocess.call([sys.executable, transferwee_path, "download", "-o", zip_name, "url", source_url])

If the most recent version of this script is uploaded to PyPi #31, the module could be imported rather than cloned to the file system.

from transferwee import transferwee

transferwee_path = transferwee.__file__

subprocess.call([sys.executable, transferwee_path, "download", "-o", zip_name, "url", source_url])

If this isn't helpful, feel free to close. I just thought this may save someone some time down the road πŸ’–

-- ✨ Noelle ✨

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions