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.

Installation

Wordlookup is available on PyPI and can be installed in multiple ways:

# using uv
uv tool install wordlookup

# using pipx
pipx install wordlookup

# using pip
pip install wordlookup

Building from Source

Prerequisites

  • Python 3.13
  • uv package manager

Installation from source

  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

Note: These next steps are not necessary if you simply want to install and use this package from PyPI as described in the Installation section.

  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.2.tar.gz (8.4 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.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wordlookup-0.1.2.tar.gz
  • Upload date:
  • Size: 8.4 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.2.tar.gz
Algorithm Hash digest
SHA256 6bf743127c9ea1e553b40b1b4a4c0e5793f3084fa2f4095b04b495c191733c04
MD5 a8e79528158e0d9c050d7135bdb04913
BLAKE2b-256 5da5fdfda72bae344c55f6976420614c02498f50273efc859c5fd7e1afafa425

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wordlookup-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4f530e980e72db95c0466356c5235f758ab722fa05e8779d70703fe605e3910c
MD5 14f21067be1181e295a54168ff38e23b
BLAKE2b-256 f8b8dbb46846bbc5191c99934c96da4b91ee80d336e84bc3e2557f040a9fc36c

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