-
Notifications
You must be signed in to change notification settings - Fork 29
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
download and load a complete stackexchange project #9
download and load a complete stackexchange project #9
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
This is a rather big change; so I'll have to run it to verify that it works. However, I don't quite see why we have to make upgrade to Python 3 necessary, esp. because you already are using libarchive
instead of internal lzma
and urllib
is available via six.moves
, which offers the same interface as urllib
from Python 3.
I can make these minor changes myself when I do the merging.
Thanks again!
Great! I did not know about the possibility to use six for that. |
sorry, I was lazy and did not create a distinct PR for this feature. |
using the '-s' switch, download the compressed file from _https://ia800107.us.archive.org/27/items/stackexchange/_, then, uncompress it and load all the files in the database. Add a '-n' switch to move the tables to a given schema WARNING: since using the urllib.request module, set the script to use python3
619cadd
to
fc4dc26
Compare
Hello @musically-ut, The "load complete project" MR is ready. I added a few options:
I tested several cases and found no problem:
Tell me what you think of it |
Thank you for submitting this! The code looks good and I don't see any immediate problems with it, but still have to just sit down and test all the options once (essentially the commands you gave in your last comment, thanks for that!) I'll merge it soon. |
@musically-ut here is a commit using tempfile library. I just get the temporary directory and store the file in it. Does it suites you? |
|
||
# load a project | ||
elif args.so_project: | ||
import libarchive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you verify that you are using libarchive-c
library instead of libarchive
?
I will add this to the README.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am indeed using libarchive-c (in version 2.8).
Thanks for all the hard work! Merged! \o/ |
It was really nice to work on this project. |
This commit give the possibility, using the
-s
switch, to download the compressed file from archive.org, then, uncompress it and load all the files in the database.Add a '-n' switch to move the tables to a given schema
WARNING: since using the urllib.request module, set the script to use python3!