PKUH3Goamdl/__init__.py#!/usr/bin/env python3 r''' Download all Ozy and Millie comics. Usage: oam-dl --create oam-dl --download ( | -r | -a) oam-dl -h | --help oam-dl --version Options: --create Creates the db of Ozy and Millie comics --download Download the comic... with this release number -r with release numbers from to -a in its entirety (may take a while) -h, --help Show help --version Show version ''' from docopt import docopt from os.path import expanduser from progress.bar import Bar import json import os import re import requests __version__ = '0.2.0' __author__ = "Mike Overby" arguments = docopt(__doc__, version=__version__) HOME = expanduser("~") BASE_URL = 'http://ozyandmillie.org/comics/' OAM_DICT_FILENAME = os.path.join(HOME, 'oam_dict.json') ROOT_DIR = os.path.join(HOME, 'OAM') #Create the json object representing the comic's archive def create(): archive = requests.get(BASE_URL) if archive.status_code == 200: archive_html = archive.text links = re.findall(r'"]) except ValueError: int_value_error_msg() return if OAM_DICT and is_valid_release_num(OAM_DICT, num): download_one(OAM_DICT, num) print("Downloaded", num) # Command for downloading a range of comics by release number def download_release_num_range(): OAM_DICT = read_in_OAM_DICT() if OAM_DICT is None: return try: start = int(arguments[""]) end = int(arguments[""]) except ValueError: int_value_error_msg() return if start > end: print("Start must be lower than N") return if is_valid_release_num(OAM_DICT, start) and is_valid_release_num(OAM_DICT, end): try: download_range(OAM_DICT, start, end) print("Downloaded from", start, "to", end) except ConnectionError: pass def find_date(date_str): pass '''dateregex = re.compile(r"(\d{4})-(\d{2})-(\d{2})") if not dateregex.match(date_str) print("That date did not match yyyy-mm-dd") return matches = re.find("")''' def main(): if arguments["--create"]: create() elif arguments["--download"]: if arguments[""]: download_release_num() elif arguments[""] or arguments[""]: download_release_num_range() elif arguments["-a"]: download_all() elif arguments["-h"] or arguments["--help"]: print(__doc__) else: print("oam-dl: invalid option") print("Try 'oam-dl --help' for more information") if __name__ == '__main__': main() PKUHh&oam_dl-0.2.0.dist-info/DESCRIPTION.rst# Ozy and Millie Archive CLI oam-dl is inspired by and based on xkcd-dl by Tasdik Rahman, which was inspired by youtube-dl by Daniel Bolton. It archives the less memetic yet superior (:P) *Ozy and Millie* by Dana Simpson, which ran from 1998 to 2008. # Features * Download all *Ozy and Millie* comics. * Download individual *Ozy and Millie* comics by release number. * Download ranges of *Ozy and Millie* comics by release number. # Usage After installing, run `oam-dl --create`. This creates a json file in your home directory that stores information on each of the comics. ##`--download` Downloading a comic will create a directory structure in your home directory under OAM to automatically organize your comics by year and month. ### `` `oam-dl --download ` retrieves the `Ozy and Millie` comic with release number . ###`-a` `oam-dl --download -a` retrieves every *Ozy and Millie* comic. There are >2000 of them, so the download may take a while. ###`-r` `oam-dl --download -r ` retieves the range of comics between release numbers and . # TODO * Download via release date (maybe) # License MIT License (see LICENCE.txt) PKUHT00'oam_dl-0.2.0.dist-info/entry_points.txt[console_scripts] oam-dl = oamdl.__init__:main PKUHѰe00$oam_dl-0.2.0.dist-info/metadata.json{"classifiers": ["Intended Audience :: Developers", "Topic :: Software Development :: Build Tools", "License :: OSI Approved :: MIT License", "Environment :: Console", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4"], "extensions": {"python.commands": {"wrap_console": {"oam-dl": "oamdl.__init__:main"}}, "python.details": {"contacts": [{"email": "mikeoverby@outlook.com", "name": "Mike Overby", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/lethargilistic/oam-dl"}}, "python.exports": {"console_scripts": {"oam-dl": "oamdl.__init__:main"}}}, "extras": [], "generator": "bdist_wheel (0.26.0)", "keywords": ["cli", "commandline", "download", "api"], "license": "MIT", "metadata_version": "2.0", "name": "oam-dl", "run_requires": [{"requires": ["docopt (==0.6.2)", "progress (==1.2)", "requests (==2.8.1)", "wheel (==0.26.0)"]}], "summary": "Download any or all Ozy and Millie comics", "version": "0.2.0"}PKUHF=C$oam_dl-0.2.0.dist-info/top_level.txtoamdl PKUH}\\oam_dl-0.2.0.dist-info/WHEELWheel-Version: 1.0 Generator: bdist_wheel (0.26.0) Root-Is-Purelib: true Tag: py3-none-any PKUH8oam_dl-0.2.0.dist-info/METADATAMetadata-Version: 2.0 Name: oam-dl Version: 0.2.0 Summary: Download any or all Ozy and Millie comics Home-page: https://github.com/lethargilistic/oam-dl Author: Mike Overby Author-email: mikeoverby@outlook.com License: MIT Keywords: cli,commandline,download,api Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: Topic :: Software Development :: Build Tools Classifier: License :: OSI Approved :: MIT License Classifier: Environment :: Console Classifier: Natural Language :: English Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 Requires-Dist: docopt (==0.6.2) Requires-Dist: progress (==1.2) Requires-Dist: requests (==2.8.1) Requires-Dist: wheel (==0.26.0) # Ozy and Millie Archive CLI oam-dl is inspired by and based on xkcd-dl by Tasdik Rahman, which was inspired by youtube-dl by Daniel Bolton. It archives the less memetic yet superior (:P) *Ozy and Millie* by Dana Simpson, which ran from 1998 to 2008. # Features * Download all *Ozy and Millie* comics. * Download individual *Ozy and Millie* comics by release number. * Download ranges of *Ozy and Millie* comics by release number. # Usage After installing, run `oam-dl --create`. This creates a json file in your home directory that stores information on each of the comics. ##`--download` Downloading a comic will create a directory structure in your home directory under OAM to automatically organize your comics by year and month. ### `` `oam-dl --download ` retrieves the `Ozy and Millie` comic with release number . ###`-a` `oam-dl --download -a` retrieves every *Ozy and Millie* comic. There are >2000 of them, so the download may take a while. ###`-r` `oam-dl --download -r ` retieves the range of comics between release numbers and . # TODO * Download via release date (maybe) # License MIT License (see LICENCE.txt) PKUHToam_dl-0.2.0.dist-info/RECORDoam_dl-0.2.0.dist-info/DESCRIPTION.rst,sha256=w4_VaWRTHLUSB43DefcxZkMOxbOtQjWNT2145Z8tbHk,1178 oam_dl-0.2.0.dist-info/METADATA,sha256=M0WSq7wZM8eyDf1VoKPuor88n_tqwvvNbht2YJChqd4,1957 oam_dl-0.2.0.dist-info/RECORD,, oam_dl-0.2.0.dist-info/WHEEL,sha256=zX7PHtH_7K-lEzyK75et0UBa3Bj8egCBMXe1M4gc6SU,92 oam_dl-0.2.0.dist-info/entry_points.txt,sha256=mDbzuaK48ozwu6_OCqFNx7wcDd4y-qunOePh5tGBVMw,48 oam_dl-0.2.0.dist-info/metadata.json,sha256=34_M7GGpBSOjkHCx8x6p5_21aaMoLnQ2lbiR_TeQT-M,1072 oam_dl-0.2.0.dist-info/top_level.txt,sha256=txRJb-uYlJ9DbMYIpRUeZWDBlNt-sc7RA9Nc9kQaaw4,6 oamdl/__init__.py,sha256=NwoZVCMTSTMyNvMxGwOCGkCP_19uKZUKiceki0OZfts,5774 PKUH3Goamdl/__init__.pyPKUHh&oam_dl-0.2.0.dist-info/DESCRIPTION.rstPKUHT00'oam_dl-0.2.0.dist-info/entry_points.txtPKUHѰe00$oam_dl-0.2.0.dist-info/metadata.jsonPKUHF=C$ oam_dl-0.2.0.dist-info/top_level.txtPKUH}\\ oam_dl-0.2.0.dist-info/WHEELPKUH8`!oam_dl-0.2.0.dist-info/METADATAPKUHTB)oam_dl-0.2.0.dist-info/RECORDPKn,