A command line tool for quick concept lookups
Project description
LiteLookup 🔎
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.8 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
-
Install LiteLookup via pip:
pip install litelookup
-
Configure the environment variables:
Export the API Key from Groq like so:
export GROQ_API_KEY=your_api_key_here
-
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:
litelookup -i
While in the interactive mode, you can toggle verbosity:
litelookup -i -v
To exit the interactive mode, type:
quit
orq
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file litelookup-0.1.5.tar.gz
.
File metadata
- Download URL: litelookup-0.1.5.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac5a116a32c8e424354a0a752d11c803479ffc86a81787a5c01bce627c565511 |
|
MD5 | bb16354451f6ed694a012f0db7b39ad6 |
|
BLAKE2b-256 | 043eebbd2da80aabf1d2fa1bc067e21e5fe4863e828bcd5356ef374284ca1f3e |
File details
Details for the file litelookup-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: litelookup-0.1.5-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecaf8113e0db6e94d132cb510eca5694f1fce70d5afada2f1a2a2a4536116ada |
|
MD5 | 7a503a3a5d34e82049cead8cc9d349e3 |
|
BLAKE2b-256 | 9382cf178c9bbce8832d70a4279c8513a5691093438673dfbfa54f2614b350b0 |