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

Advice on how to run Scrapy template without using __main__.py #264

Open
honzajavorek opened this issue Jan 16, 2024 · 2 comments
Open

Advice on how to run Scrapy template without using __main__.py #264

honzajavorek opened this issue Jan 16, 2024 · 2 comments
Labels
enhancement New feature or request. t-tooling Issues with this label are in the ownership of the tooling team.

Comments

@honzajavorek
Copy link

honzajavorek commented Jan 16, 2024

I'd like my project to have several CLI commands, e.g. using click. It's not entirely clear to me how to properly move the __main__.py logic somewhere else, so that I can wrap running the actor/spider into one command and have other commands doing other stuff.

Vaguely related to apify/apify-sdk-python#176

@honzajavorek
Copy link
Author

I did some changes in my implementation so that it's possible:

Feel free to grab inspiration from what I did, or even chunks of code (MIT licensed, just mention my name). I guess I've solved this for myself now. If there are updates to the Scrapy template, I hope I'll be able to somehow keep up with it and backport changes to my highly customized project.

@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. enhancement New feature or request. labels Jan 19, 2024
@vdusek
Copy link
Contributor

vdusek commented Jan 19, 2024

Hi Honza, thank you for opening this. Moving as much code as we can from the template to the SDK is definitely a good way to go. Unfortunately, adding new features to our Scrapy-Apify integration is not a priority for this quarter, so I cannot promise I'll have time to take a look at this in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request. t-tooling Issues with this label are in the ownership of the tooling team.
Projects
None yet
Development

No branches or pull requests

2 participants