Skip to main content

Fetches and prints definitions for a given word

Project description

WordLookup

This repo serves as a companion resource for the Packaging Python Command-Line Apps the Modern Way with uv tutorial found on thisdavej.com.

Intro

WordLookup is a command-line tool to fetch and display definitions for a given word using the Dictionary API.

Usage

Run the CLI tool with the word you want to look up as an argument:

wordlookup <word>

Example

To look up the word "sojourn":

wordlookup sojourn

Output:

Definitions for 'sojourn':

noun:
- A short stay somewhere.
- A temporary residence.

verb:
- To reside somewhere temporarily, especially as a guest or lodger.

Notes

  • The tool attempts to format the output to fit your terminal width.
  • If the terminal width cannot be determined, it defaults to 80 characters.
  • Ensure you have an active internet connection as the tool fetches data from an external API.

Building from Source

Prerequisites

  • Python 3.13
  • uv package manager

Installation

  1. Clone the repository:
git clone https://github.com/thisdavej/wordlookup-tutorial.git
cd wordlookup-tutorial
  1. Build using uv:
uv build
  1. Test the Python wheel created during the build step:
uv tool run wordlookup

# You can also use `uvx` which is an alias for `uv tool run`
uvx wordlookup
  1. Install the Python wheel persistently:
uv tool install wordlookup

Distributing the Python wheel (.whl) file to others to install

  1. Run/test the command provided in the wheel without explicitly installing into a persistent environment or adding it to our system's PATH.
uv tool run wordlookup-0.1.0-py3-none-any.whl

# You can also use `uvx` which is an alias for `uv tool run`
uvx wordlookup-0.1.0-py3-none-any.whl
``

1. Install the Python wheel

```sh
uv tool install wordlookup-0.1.0-py3-none-any.whl

Development

To see your development changes in action instantly, use uv run:

uv run wordlookup <word>

This command will execute the tool with your most recent code modifications.

License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.

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

wordlookup-0.1.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

wordlookup-0.1.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file wordlookup-0.1.1.tar.gz.

File metadata

  • Download URL: wordlookup-0.1.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for wordlookup-0.1.1.tar.gz
Algorithm Hash digest
SHA256 625ae8227762e79f2f222355b2ba0c4672c69e57c3bb617f370db1070e31df2e
MD5 46679f913b7e4c12704dc4bddbe41b24
BLAKE2b-256 02e5f345637d0685f6db8fcac718682f7b95b9187d47cc0f8340356efdc2a201

See more details on using hashes here.

File details

Details for the file wordlookup-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: wordlookup-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for wordlookup-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc8e74f5e42471bb35255104fa1f111def2a8053905e5f20b1e669a2ce647e13
MD5 19ca93308aa94f6a4b59a01ba9865ad2
BLAKE2b-256 e37730a64b40372f0ed882eebaacbca4d362e26d829d102722c5481b3b765dae

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