-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Nice code, would make a good API #55
Comments
@eamonnkenny thanks for your feedback :-) This script, as you know would run from Command Line Interface. With that, could you tell me how do you propose it to be used from within other python files? Like even if the methods were put in classes, how would it still be like an API? For now, the best way to call this from within another python file would be and have all the arguments in the config (JSON) file. And since it is JSON format, it could also be automated as required. Thnx |
The issue is that with an API the individual using it does not want to have all the configuration in one script. I for instance would like to use it as an API with some default behaviour, downloading 10 labeled for reuse images given some input search string that changes each time. I've attached a calling function that includes a class. Basically its probably better if you use a class instead of a function call and this gives people the ability to manipulate some of the variables. I have to say you have done a great job on this as it stands. I really like the results that the functions use and you have so much added functionality and configurability. Its great. I've attached a workaround for what I am trying to do. I basically wrapped your code up in a class. |
@eamonnkenny thanks for the suggestion. The new version of this lib allows you to call it from another python file. An example is provided in the docs. You can now create an object and pass on the parameters inside it. Had to make a lot of changes in the code for good to implement this... :D . Few minor changes around the edges will be done in coming days...but for now this works fine. Do let me know if this is more usable now. |
Closing this issue. Seems to be stable on all major OSs. |
Great work. Really like what you have done with this. |
If you were to change google_images_download.py to be a class rather than a set of functions and main caller, you could then allow it to be used as an API from other python scripts. That way it becomes a very powerful tool.
This is more of a feature request, not a bug.
The text was updated successfully, but these errors were encountered: