Skip to main content

A simple CLI tool to fetch random quotes from ZenQuotes API

Project description

CLI Random Quote Retriever

By mhasanali2010

What it does?

  • Uses zenquotes.io/api to retrieve a random quote. Can optionally save the quote in ./quotes.json if you like it
  • API handling using requests and argument parsing using argparse

Setting up

  • Clone the repository:
    git clone https://github.com/mhasanali2010/random-quote-retriever
    
  • Optional: Set up virtual environment:
    python3 -m venv venv
    # for macOS/Linux
    source venv/bin/activate
    # for windows (cmd)
    venv\Scripts\activate.bat
    
  • Install requests:
    python3 -m pip install -r requirements.txt
    
  • Navigate to the repository:
    cd random-quote-retriever
    

Retrieving Quotes

Run the script using:

python3 main.py

Saving Quotes

Run the script with --save:

python3 main.py --save

The last quote that was retrieved will be saved in ./quotes.json

Viewing Saved Quotes

Run the script with --view-saved:

python3 main.py --view-saved

All of the quotes that have been saved in ./quotes.json will be displayed.

Notes

  • Tested only using Python 3.13
  • Requirements are written in ./requirements.txt

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

random_quote_retriever-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

random_quote_retriever-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file random_quote_retriever-0.1.0.tar.gz.

File metadata

  • Download URL: random_quote_retriever-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for random_quote_retriever-0.1.0.tar.gz
Algorithm Hash digest
SHA256 88b142d8100a9bff5b19dfdc63c26a8d492efb05acde6187ee3bbccabae91e43
MD5 bd254f20268b522fb593e2d9a2cf7fe1
BLAKE2b-256 1bd9120636867d3000edfe88159b4aaa742af6aa23cb156d92ac63fe9dc7a2f6

See more details on using hashes here.

File details

Details for the file random_quote_retriever-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for random_quote_retriever-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d11e0cdedc9321931f95b9387c00ea8db913fec59c69cfb50cbea937b899e55b
MD5 16e57c9ac5c4abb5a7ad4fd222eee38d
BLAKE2b-256 70ff31d1e5f6616362ccaa05f3d48f449ef43e17b00e9b7bb420e9d0703ed32f

See more details on using hashes here.

Supported by

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