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

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

Open
ignkarman opened this issue Aug 29, 2023 · 0 comments
Assignees

Comments

@ignkarman
Copy link

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("[email protected]: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 ✨

@iamleot iamleot self-assigned this Aug 29, 2023
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

2 participants