Skip to main content

A command-line dictionary app using WordNet and OpenAI

Project description

Telesm

An offline-first dictionary using WordNet -or- OpenAI

Why Offline?

I'm sick of online dictionaries. Most of them display lots of ads which is distracting, and almost none of them let you save the words to review them in the future and memorzie them, unless, well, you pay for a premium package.

Introducing Telesm

So, here's an offline dictionary that uses WordNet to display the definition and the examples of a word. It saves your searched words in a list so you can check them later in your spare time.

Now Telesm also supports calling OpenAI api to get the definition and examples of the word. See Usage for more details.

Terminology

Telesm is the Persian word for Talisman.

Installation

Using pip:

pip install telesm

Or if you want to have it globally:

pipx install telesm

Usage

Definition of a word

telesm <word>

# Example output:
talisman:
         a trinket or piece of jewelry usually hung about the neck and thought to be a magical protection against evil or disease

This will save the word to the database by default, if you don't want to save the word pass --no-save argument.

telesm <word> --no-save

List all words

telesm --list

If you want to navigate over the words one by one, pass --navigate argument:

telesm --list --navigate

Random word

telesm --random

# Example output:
accruing:
         grow by addition
Examples:
         The interest accrues

Search in saved words

telesm --search tal

# Example output:
talisman:
         a trinket or piece of jewelry usually hung about the neck and thought to be a magical protection against evil or disease

Deleting a word

telesm --delete <word>

Using AI

To use AI feature you need to specify your OpenAI api key in ~/.telesm.conf file.

  1. Create ~/.telesm.conf file, if you haven't already.

  2. Acquire your api key from OpenAi Dashboard.

  3. Put your api key in the config file:

     OPENAPI_API_KEY="<your-api-key>"
    

Now you can use the AI feature:

telesm --ai <word>

This will also save the word in the database so you'd have it offline for future uses. Pass --no-save if you don't want to save it.

If you already searched for a word without using AI and saved the word in the database, passing --ai would not have any effects. Try deleting the word by running telesm --delete <word> and try again.

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

telesm-0.2.3.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

telesm-0.2.3-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file telesm-0.2.3.tar.gz.

File metadata

  • Download URL: telesm-0.2.3.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for telesm-0.2.3.tar.gz
Algorithm Hash digest
SHA256 3be3b4ff3c3e9a91ca4f07b87c9ed22a9bde45bbf6dc7d94b5af04578d2a2787
MD5 238926b994c13acc86744707b2132564
BLAKE2b-256 246ba908d22b4a1f18d87681e4976e3aae82fbb3e69338d6539950efdc0d6304

See more details on using hashes here.

File details

Details for the file telesm-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: telesm-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for telesm-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9e9586963831460eb49ae95583079868c8430b5fd77276b8962445d016a29e3b
MD5 141c6f41f1ce15ec1bce2036d9bae678
BLAKE2b-256 d444095d5d77e227c6441362af4abb3673c7af0a02db68cc01249f466f7582aa

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