{ "info": { "author": "\u0141ukasz Uszko", "author_email": "lukasz.uszko@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "[![Version](https://img.shields.io/pypi/v/packt.svg)](https://pypi.org/project/packt/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/packt.svg)](https://pypi.org/project/packt/)\n[![Build Status](https://travis-ci.org/luk6xff/Packt-Publishing-Free-Learning.svg?branch=master)](https://travis-ci.org/igbt6/Packt-Publishing-Free-Learning)\n\n## Free Learning Packt Publishing script\n\n`packt-cli` is a Python script that allows to automatically grab and download a daily Free\nLearning Packt ebook from https://www.packtpub.com/packt/offers/free-learning.\nYou can also use it to download already claimed ebooks from your Packt\naccount.\n\nThe script uses [anti-captcha.com](https://anti-captcha.com/) service to bypass\nthe Recaptcha captcha to function fully automatically. Anti Captcha employs\npeople to solve captcha tests. The service costs about $2 per thousand captcha\ntest, allowing you to operate for a few dollars over the years.\n\n### Installation\n\nTo install current version of script simply run\n```\npip3 install packt --upgrade\n```\n\nYou may want to install it inside new [virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/).\n\n### Usage\n\nThe `packt-cli` script might be executed with several optional arguments.\n\n- Option *-g* [--grab] - claims (grabs) a daily eBook into your account\n```\npackt-cli -g\n```\n\n- Option *-gd* [--grabd] - claims (grabs) a daily ebook and downloads the title afterwards to the location specified under *[download_folder_path]* field (configFile.cfg file)\n```\npackt-cli -gd\n```\n\n- Option *-da* [--dall] - downloads all ebooks from your account\n```\npackt-cli -da\n```\n\n- Option *-sgd* [--sgd] - claims and uploads a book to *[gdFolderName]* folder onto Google Drive (more about that in Google Drive API Setup section)\n```\npackt-cli -sgd\n```\n\n- Option *-m* [--mail] - claims and sends an email with the newest book in PDF format (and MOBI if is also downloaded; see mail options confguration under [MAIL] path in *configFile.cfg*)\n```\npackt-cli -m\n```\n\n- SubOption *-sm* [--status_mail] - sends fail report email whether script execution was successful\n```\npackt-cli -gd -sm\n```\n\n- SubOption *-f* [--folder] - downloads an ebook into a created folder, named as ebook's title\n```\npackt-cli -gd -f\n```\n\n- SubOption *-c* [--cfgpath] - selects folder where config file can be found (default: cwd)\n```\npackt-cli -gd -c /home/usr/\n```\n\n#### Example\n\nDownload all ebooks in all available formats (pdf, epub, mobi) with zipped source code file from your Packt account.\n\nTo download all ebooks in all available formats from your Packt account, you have to prepare your config file as shown below:\n\n```\n[LOGIN_DATA]\nemail: youremail@youremail.com\npassword: yourpassword\n\n[DOWNLOAD_DATA]\ndownload_folder_path: C:\\Users\\me\\Desktop\\myEbooksFromPackt\ndownload_formats: pdf, epub, mobi, code\n\n[GOOGLE_DRIVE_DATA]\ngd_app_name: GoogleDriveManager\ngd_folder_name: PACKT_EBOOKS\n```\nrun:\n```\n packt-cli -da\n```\n\n### Scheduled script execution setup\n\n#### Debian\n\nOn Debian (and any Debian-based Linux distribution) you may use [cron](https://help.ubuntu.com/community/CronHowto) job to schedule script execution. To do this run `crontab -e` and add the following line to crontab file.\n\n```\n0 12 * * * path/to/virtualenv/bin/packt-cli -gd > path/to/log/file 2>&1\n```\n\nAdjust execution time and paths according to your setup. To verify if cron executes the script as expected, run\n```\n$ sudo grep CRON /var/log/syslog\n```\n\n#### Windows\n\n**schtasks.exe** setup (more info: https://technet.microsoft.com/en-us/library/cc725744.aspx) :\n\nTo create the task that will be called at 12:00 everyday, run the following command in **cmd** (modify all paths according to your setup):\n\n```\nschtasks /create /sc DAILY /tn \"grabEbookFromPacktTask\" /tr \"C:\\Users\\me\\Desktop\\GrabPacktFreeBook\\grabEbookFromPacktTask.bat\" /st 12:00\n```\n\nTo check if the \"grabEbookFromPacktTask\" has been added to all scheduled tasks on your computer:\n\n```\nschtasks /query\n```\n\nTo run the task manually:\n\n```\nschtasks /run /tn \"grabEbookFromPacktTask\"\n```\n\nTo delete the task:\n\n```\nschtasks /delete /tn \"grabEbookFromPacktTask\"\n```\n\nIf you want to log all downloads add -l switch to grabEbookFromPacktTask i.e.\n```\nschtasks /create /sc DAILY /tn \"grabEbookFromPacktTask\" /tr \"C:\\Users\\me\\Desktop\\GrabPacktFreeBook\\grabEbookFromPacktTask.bat -l\" /st 12:00\n```\n\nIf you want to additionaly make command line windows stay open after download add -p switch i.e.\n```\nschtasks /create /sc DAILY /tn \"grabEbookFromPacktTask\" /tr \"C:\\Users\\me\\Desktop\\GrabPacktFreeBook\\grabEbookFromPacktTask.bat -l -p\" /st 12:00\n```\n\n### Google Drive API Setup\n\nFull info about the Google Drive Python API can be found [here](https://developers.google.com/drive/v3/web/quickstart/python).\n\n1. Turn on the Google Drive API\n - Use [this wizard](https://console.developers.google.com/flows/enableapi?apiid=drive) to create or select a project in the Google Developers Console and automatically turn on the API. Click `Continue`, then `Go to credentials`.\n - On the `Add credentials to your project page`, click the `Cancel` button.\n - At the top of the page, select the `OAuth consent screen` tab. Select an email address, enter a product name if not already set, and click the Save button.\n - Select the `Credentials` tab, click the `Create credentials` button and select `OAuth client ID`.\n - Select the application type `Other`, enter the name `GoogleDriveManager`, and click the `Create` button.\n - Click `OK` to dismiss the resulting dialog.\n - Click the file_download (`Download JSON`) button to the right of the client ID.\n - Move this file next to the config file and rename it to `client_secret.json`.\n\n2. Create credentials folder:\n - Simply, just fire up the script with `-sgd` argument; During first launch you will see a prompt in your browser asking for permissions, click then *allow*\n ```\n packt-cli -sgd\n ```\n - Or if you're unable to launch browser locally (e.g. you're connecting through SSH without X11 forwarding) use this command once, follow instructions and give permission and later you can use normal command (without `--noauth_local_webserver`).\n ```\n packt-cli -c /path/to/config/file.cfg -sgd --noauth_local_webserver\n ```\n The command parameters number and their order is important!\n\n3. Already done!\n - Run the same command as above to claim and upload the eBook to Google Drive.\n\n\nIn case of any questions feel free to ask, happy grabbing!", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/luk6xff/Packt-Publishing-Free-Learning/archive/v1.4.2.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/luk6xff/Packt-Publishing-Free-Learning", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "packt", "package_url": "https://pypi.org/project/packt/", "platform": "", "project_url": "https://pypi.org/project/packt/", "project_urls": { "Download": "https://github.com/luk6xff/Packt-Publishing-Free-Learning/archive/v1.4.2.tar.gz", "Homepage": "https://github.com/luk6xff/Packt-Publishing-Free-Learning" }, "release_url": "https://pypi.org/project/packt/1.4.2/", "requires_dist": null, "requires_python": "", "summary": "Script for grabbing daily Packt Free Learning ebooks", "version": "1.4.2" }, "last_serial": 5797265, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "044c9af61a7af1b24bacf3e984a6a0bb", "sha256": "a93c5b6b5651afc25c0f097e5a93762ee14b3c6dcfc8469fe35459f9a0eeaec8" }, "downloads": -1, "filename": "packt-1.0.3.tar.gz", "has_sig": false, "md5_digest": "044c9af61a7af1b24bacf3e984a6a0bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13658, "upload_time": "2019-03-06T14:52:25", "url": "https://files.pythonhosted.org/packages/bb/ff/bbce08b9976c22ee4562c4f231da390801224f3afe8b4ebfbdff1c539338/packt-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "3d0296d77c9b4e8344435aaaba5d37e1", "sha256": "1b55bfa90998ba135e20a01069c1e5fa060e64ae16a3e07126baf3316693e904" }, "downloads": -1, "filename": "packt-1.0.4.tar.gz", "has_sig": false, "md5_digest": "3d0296d77c9b4e8344435aaaba5d37e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16984, "upload_time": "2019-03-06T15:30:18", "url": "https://files.pythonhosted.org/packages/59/18/14c0a92f6683eb02a2ba858997287ddbb9bd1cd9b1fa74e81f9e6c6fa76f/packt-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "9986c09195f9a32606ba003c84be842e", "sha256": "02bfa5cc3790fb20883cf2464fa06d03157a350fa7d33854cee9f420aebe4c4c" }, "downloads": -1, "filename": "packt-1.0.5.tar.gz", "has_sig": false, "md5_digest": "9986c09195f9a32606ba003c84be842e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17215, "upload_time": "2019-03-06T15:52:11", "url": "https://files.pythonhosted.org/packages/52/b7/d58d7948c3a8f19b425d844a311eb2da368d3d151c24354e82f0ffa79bbf/packt-1.0.5.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "efac5a1cee65df4e0e4201d8785e1bcb", "sha256": "cad306ef998cc7643aa89f666a41fa40468fb94588a888d62c49a8285397ab24" }, "downloads": -1, "filename": "packt-1.1.0.tar.gz", "has_sig": false, "md5_digest": "efac5a1cee65df4e0e4201d8785e1bcb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17104, "upload_time": "2019-03-17T07:16:19", "url": "https://files.pythonhosted.org/packages/dd/b0/a3c362603684c4492a1aee53fffad71f0302bd07be87271773b5a0142ef7/packt-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "e399b60065bb5136b7504178308168cd", "sha256": "5092e5e5c2cd50db399f29e44f9b00b44c28f632ebc6bc2a5a0c853fba5d2ab7" }, "downloads": -1, "filename": "packt-1.2.0.tar.gz", "has_sig": false, "md5_digest": "e399b60065bb5136b7504178308168cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16833, "upload_time": "2019-03-18T07:50:31", "url": "https://files.pythonhosted.org/packages/1b/38/1cf56fa1a2af3c05234783ee7e43063d88f0937b6c3a5355338c22de8554/packt-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "0d9479e62f3da0ce8d09ba379e8c61a6", "sha256": "9c8a912a9affb4670b13aceb6f9594b74c50ce0727be712e2405751023cde1af" }, "downloads": -1, "filename": "packt-1.2.1.tar.gz", "has_sig": false, "md5_digest": "0d9479e62f3da0ce8d09ba379e8c61a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16861, "upload_time": "2019-03-24T17:26:00", "url": "https://files.pythonhosted.org/packages/25/c9/134d9b123de10115f04248e54eeff2da3d8cd469b1da9c6dd423800ccf66/packt-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "9ce81998219f014f1c2087fa296f2b9d", "sha256": "3b5b61937971495c95613af3d4d855c2271a87d829fa7cad3c6de70143b19686" }, "downloads": -1, "filename": "packt-1.2.2.tar.gz", "has_sig": false, "md5_digest": "9ce81998219f014f1c2087fa296f2b9d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16864, "upload_time": "2019-03-24T19:19:49", "url": "https://files.pythonhosted.org/packages/a5/64/aff2ae9c4fd4747bde2a6fef0c63d84156f6c13c724216a25d4a00371dc9/packt-1.2.2.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "e55b6b69fa4f3aa2834751b8a335e291", "sha256": "5f38d1804db9420b62a09ea5c7f34fa6c2f177a6142c35fba3b481e6483f9267" }, "downloads": -1, "filename": "packt-1.3.0.tar.gz", "has_sig": false, "md5_digest": "e55b6b69fa4f3aa2834751b8a335e291", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16945, "upload_time": "2019-04-30T21:27:38", "url": "https://files.pythonhosted.org/packages/44/1b/1703ae7f15c3f040a2d77635a309ee970714eab20e28263ddc1e68f724d8/packt-1.3.0.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "3b797bf0a5fcf04be56597ab075f6e87", "sha256": "83cdbe3e12eab59fd185fc85cd03a7cef67f29f8f80992c62d62e041e0e7223d" }, "downloads": -1, "filename": "packt-1.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3b797bf0a5fcf04be56597ab075f6e87", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 17977, "upload_time": "2019-07-05T14:35:31", "url": "https://files.pythonhosted.org/packages/27/0b/d6e11616d99e881943662d6ca04c4762e40af44acf41d6b7810f094594aa/packt-1.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "15c56bec0efac8d7bc028c68709455e0", "sha256": "d947db279ac38113b89e4512f492300748be81dd73ee7bcd0362ff6b52fada85" }, "downloads": -1, "filename": "packt-1.4.0.tar.gz", "has_sig": false, "md5_digest": "15c56bec0efac8d7bc028c68709455e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17042, "upload_time": "2019-07-05T14:35:39", "url": "https://files.pythonhosted.org/packages/3e/18/b93d9550b453811fbfd86902eca70d6d35b75bb621ab3c61e246a2ad77ce/packt-1.4.0.tar.gz" } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "35ea6e6e3982b3393184711b2bcf5f3a", "sha256": "6a22f6375ed3841f5f69690b9db95c5e2f2d111e1050027b9a164dd3a82b907f" }, "downloads": -1, "filename": "packt-1.4.1.tar.gz", "has_sig": false, "md5_digest": "35ea6e6e3982b3393184711b2bcf5f3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14935, "upload_time": "2019-08-28T16:15:59", "url": "https://files.pythonhosted.org/packages/0b/a1/02b48e3c4ba0c40772d1c11919b7b562ee6ffb76a7d30148ffc541ee62d0/packt-1.4.1.tar.gz" } ], "1.4.2": [ { "comment_text": "", "digests": { "md5": "d0891abb16a4bfb3a1f042f6f404e4c3", "sha256": "31c5df5dbd2b97d039c040df17c15b12202070b265e3e147f4aa944d0442d9fa" }, "downloads": -1, "filename": "packt-1.4.2.tar.gz", "has_sig": false, "md5_digest": "d0891abb16a4bfb3a1f042f6f404e4c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15208, "upload_time": "2019-09-07T20:08:04", "url": "https://files.pythonhosted.org/packages/9f/3e/8c0e68cbe3f03558a557145edfbdac8cb254d43df71478e66585ec141f10/packt-1.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d0891abb16a4bfb3a1f042f6f404e4c3", "sha256": "31c5df5dbd2b97d039c040df17c15b12202070b265e3e147f4aa944d0442d9fa" }, "downloads": -1, "filename": "packt-1.4.2.tar.gz", "has_sig": false, "md5_digest": "d0891abb16a4bfb3a1f042f6f404e4c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15208, "upload_time": "2019-09-07T20:08:04", "url": "https://files.pythonhosted.org/packages/9f/3e/8c0e68cbe3f03558a557145edfbdac8cb254d43df71478e66585ec141f10/packt-1.4.2.tar.gz" } ] }