Skip to main content

A command line tool for quick concept lookups

Project description

LiteLookup 🔎

code coverage badge

LiteLookup is a command-line tool developed in Python that fetches beginner-level information about any concept directly from the command line. This tool is designed for users who want quick, concise, and accessible explanations without leaving their terminal.

Features

  • Command-Line Interface (CLI): Uses argparse to handle user inputs.
  • Error Handling: Validates user input to ensure meaningful queries. Catches special characters and raises appropriate errors.
  • API Integration: Utilizes the Groq LLM API to generate concise explanations of the concepts provided.
  • Caching: Implements Redis for persistent caching of API responses, reducing unnecessary API calls and improving response times.
  • Interactive Shell Session: Launches an intractive shell for faster, continuous lookups after the initial connection establishment. This mode is ideal for making multiple queries in a single session without the overhead of reconnecting for each request.
  • Verbose Mode: Use the -v flag for more detailed explanations, including examples or code snippets when applicable.
  • HTTP/2 Support: Uses httpx with connection pooling and HTTP/2 for efficient API communication.
  • Expandable: Designed to be easily extended with new features and enhancements.

Installation

Prerequisites

  • Python 3.10 or higher
  • Redis server installed and running
  • Groq LLM API access — You will need to store a valid Groq API Key as a secret. You can generate one for free here.

Setup

  1. Install LiteLookup via pip:

    pip install litelookup

  2. Configure the environment variables:

    Export the API Key from Groq like so: export GROQ_API_KEY=your_api_key_here

  3. Ensure Redis is running:

    redis-cli ping

    You should get PONG which indicates redis is up and running.

Usage

Basic Usage

To fetch information about a concept, use the following command:

lookup "concept"

For example, lookup "git rebase"

Verbose Mode

For a more detailed response, including examples or code snippets:

`lookup "git rebase" -v'

Interactive Shell Mode

Enter the interactive mode for continuous lookups without reconnecting:

  • lookup -i

If you wish to generate verbose responses while in the interactive mode, use

  • lookup -i -v or lookup -iv The responses you get with this will be slightly detailed without overwhelming you.

To exit the interactive mode, type:

  • quit or q

Contributing

If you'd like to contribute to LiteLookup, please fork the repository and submit a pull request. For any issues or suggestions, feel free to open an issue on the GitHub repository.

Contact

For any questions or support, please contact Abdulmumin at [lanreywaju97@gmail.com]

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

litelookup-0.1.7.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

litelookup-0.1.7-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file litelookup-0.1.7.tar.gz.

File metadata

  • Download URL: litelookup-0.1.7.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for litelookup-0.1.7.tar.gz
Algorithm Hash digest
SHA256 dd3edfeb741a082a79b7b94682eda594776cd193f33d14464e4ad24d278e4b57
MD5 8d1e30453582bc57e9aa65be43c44542
BLAKE2b-256 e8cf74e90f371057c6ebbb668eab12c3c215e38b220168951356c906a7009baa

See more details on using hashes here.

File details

Details for the file litelookup-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: litelookup-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for litelookup-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5c3ba8bd1fc6fc14eb3d58392f29fa0b0140ad0a9f92cf552aecf48bc12ea241
MD5 98603e110b53ce023fc0aed551e3e657
BLAKE2b-256 27b6e21243d0dac11606281e371d33ff6b97bc3b8a45fc609eae84d85ef94f9c

See more details on using hashes here.

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