Datacamp is one of the many sites where you can sign up to learning various types of coding. This one mostly targeted at data analysts, scientists and engineers, teaching you R, Python, SQL and some statistics amongst other other stuff.
It is a mix of videos, slides and interactive exercises. You are easily able to download the slides as PDFs using the on-site feature, which is nice (at least as long as you’re paying for a subscription). But you can only do this 1 chapter at a time which is cumbersome when you’ve done more than a handful of courses.
Of course some clever folk have found a way to automate this. Many attempts seem to have originated from this code from TRoboto called “datacamp-downloader” which is supposed to let you download everything you could imagine related to the Datacamp courses you’ve completed - slides, videos, completed exercises and so on. For some reason, I personally couldn’t get this to work on many of my completed courses though.
But there are many forks of this base code! I’ve been using this one from vicky-dx which, at least for me, works a lot more reliably.
Assuming you have already got Python and git installed - install them first if not! - it’s just as simple as the onsite instructions indicate - even on a Windows machine!
Note that you may also need to install the Google Chrome web browser I think if, like me, you didn’t already have it installed on your computer. I’m not certain about that, but it appeared to help with my early efforts to get this working.
Anyway, once that’s all done, get yourself a command prompt in the folder above the one in which you’d like to install this software and:
git clone https://github.com/vicky-dx/datacamp-downloader.git
cd datacamp-downloader
pip install -e .
Then the best way (in my experience) to log on is as detailed on the site under option 1:
datacamp set-token [TOKEN]
where [TOKEN] is the value of the _dct cooking that datacamp provides you when you log in in a standard browser.
How to get that? It’s a bit of a faff, but not hard if you can follow instructions!
Per the project’s docs:
Firefox
Visit datacamp.com and log in. Open the Developer Tools (press Cmd + Opt + J on MacOS or F12 on Windows). Go to Storage tab, then Cookies > https://www.datacamp.com Find _dct key, its Value is the Datacamp authentication token.Chrome
Visit datacamp.com and log in. Open the Developer Tools (press Cmd + Opt + J on MacOS or F12 on Windows). Go to Application tab, then Storage > Cookies > https://www.datacamp.com Find _dct key, its Value is the Datacamp authentication token.
The token will be a very long string of random looking characters, so you’re best to paste it onto the end of the above command.
Then you have access to commands like:
datacamp courses
and
datacamp tracks
which let you list your completed courses and tracks respectively. Once you have run those you can then
datacamp download
either one, several or all of the tracks/courses by their ID number that the first 2 commands give you. There are many options for what exactly to download per course. Personally I was not interested in saving copies of the videos so I ran
datacamp download --no-videos --subtitles none 1
to download the first course. This gave me the exercise questions, solutions, video scripts, datasets and so on, but not the videos or the subtitles.
Chrome opens and logs in, the command prompt keeps you updated with what’s going on, and you can just sit back and wait for the relevant files to be downloaded to your computer for future storage and use. It’s a great time saver.
That’s also, specific to this fork, the opportunity to download “in progress” courses which might be handy if you want to use the files as reference material. For that, you can use:
datacamp ongoing
once you’re logged in.