Skip to main content

Search by keywords and download cartoons from The New Yorker magazine cartoon gallery

Project description

Project Description

Search for and download cartoons from The New Yorker magazine cartoon gallery.

Install

    python -m pip install --upgrade newyorker

Running as Script

    Usage: 
        newyorker search-keyword-list [options]

    Options:
        --outdir, -o    Set the output directory for cartoons.
        --verbose, -v   Show progress trace.
        --headers       Set the HTTP headers for the requests.
        --help, -h      Print help. 
        --version       Print the script version.

    Examples:
        newyorker email --verbose
        newyorker design desk -v -o ~/example/cartoons
        newyorker santa -v --headers \
            '{"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36"}'

Using API

    from newyorker.cartoons import NYCartoonRetriever

    #  Windows-style output folder
    retriever = NYCartoonRetriever(outdir = r"c:\python\example", verbose = True, \
        headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36"})
    image_count = retriever.retrieve(["email"])

Testing

    python -m unittest tests.test_basic

Disclaimer

This project is not associated with The New Yorker magazine.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newyorker-1.1.0.tar.gz (60.7 kB view hashes)

Uploaded Source

Built Distribution

newyorker-1.1.0-py3-none-any.whl (66.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page