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

Allow twarc to run as module #455

Merged
merged 1 commit into from
May 11, 2021
Merged

Allow twarc to run as module #455

merged 1 commit into from
May 11, 2021

Conversation

igorbrigadir
Copy link
Contributor

following on from #441 (comment)

It's possible to make it so that these commands are equivalent:

twarc2 version
python -m twarc2 version
twarc2.exe version
twarc version
python -m twarc version
twarc.exe version

I'm not sure how generally useful this is but i found it helped because i could run a profiler (slightly) easier, for example:

python -m cProfile -s cumulative -m twarc2 csv big_test.jsonl big_test.csv

It's not a terribly critical improvement either way, but it was a very small change with some boilerplate files.

@edsu
Copy link
Member

edsu commented May 11, 2021

That is super elegant @igorbrigadir!

@edsu edsu merged commit a83e59b into main May 11, 2021
@igorbrigadir igorbrigadir deleted the run-as-module branch May 11, 2021 01:45
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

Successfully merging this pull request may close these issues.

2 participants