Skip to main content

worddfn, lookup word meaning and forms via the wordnik api

Project description

Search for definition with example, verbs, synonyms and antonyms of a given word.

PyPI - License PyPI PyPI - Python Version PyPI - Wheel GitHub repo size



About wordDFN

worddfn is a wordnik API CLI client that uses the wordnik API to retrieve data about a single word and parse it into the cli (terminal) for the user.


Requirements


Note

worddfn has not been tested on Mac and Windows at the moment, but should be able to function properly.
On Mac, need to assure that the pbcopy and pbpaste commands are present.
On Windows, no additional modules are needed.

  1. System
    • Linux:
      • worddfn uses xclip, command line interface to X selections (clipboard). Make sure to have xclip install on your system.
        • Install: sudo apt install xclip link
      • alternative worddfn can use xsel to help handle the clipboard.
        • Install: sudo apt install xsel
  2. Wordnik API key:

CAUTION!

While this module (client) is release under the MIT License (see license) the API is not, wordnik have it's own TOS, i hereby acknowledge those TOS and ask of anyone who come to use this client to do the same. In the source code of this module there are a function that is use to cache data solely for the Purpose of readability (to beter manage the parsing of the data) and nothing else.
For more information on the wordnik API TOS see Wordnik API Terms of Service Agreement.


How to use


INSTALATION

before installing this module make sure you have your API key.

To Install run:

pip3 install worddfn  

or  

python3 -m pip install worddfn  

USAGE

When first launch you will be prompted with the setting file where you'll need to enter your API key and save your setting.

Copy a text (this need to be a word) into the clipboard, if the clipboard have multiple text worddfn will only use the first text (make sure you copy a single word you would like to learn about).

Using the Clipboard:

If a word is in the clipboard all you need to run from cli is:
$ word
or
$ python3 -m worddfn

Without make use of the Clipboard:

When the clipboard contains no data you can run:
$ word -h or $ python3 -m worddfn -h to obtain help.
example:

$ word -h  

usage: __main__.py [-h] [-f [VERB]] [-s [SYN]] [-o [ANT]] [word]  

positional arguments:  
  word  

options:  
  -h, --help            show this help message and exit  
  -f [VERB], --verb [VERB]  
  -s [SYN], --syn [SYN]  
  -o [ANT], --ant [ANT]  

To search for a word run $ word aword or $ python3 -m worddfn aword this will return a number of definition (4 results by default) of the word obtain via the wordnik API, if the word looking for was found.
example:

$ word source  

.....  
word:source  
.....  
Attribution:from The American Heritage® Dictionary of the English Language, 5th Edition. (ahd-5)
Definition:A person or thing from which something comes into being or is derived or obtained.
Example:alternative sources of energy; the source of funding for the project.  

Attribution:from The American Heritage® Dictionary of the English Language, 5th Edition. (ahd-5)
Definition:The point of origin of a stream or river.
Example:A reporter is only as reliable as his or her sources.  

To search for verbs of the word use:

$ word -f source  

.....  
verb:source  
.....  
Verb:  
sourced  
sources  
sourcing  

remember to check the -h or --help option for more details on using worddfn.

General Usage

if the word you wishes to get information on is source the basic way
of achiving this can be one of the following.

To search for definitions use:
$ word source
To search for verb form of a word use:
$ word -f source
To search for the synonym of a word use:
$ word -s source
To search for the antonym of a word use:
$ word -o source

INSTALL FROM SOURCE

This is not the recommended way to go about installing this module especially for inexperience python users who is only looking to use the module as a cli utility, while the steeps are generally easy to follow you may encounter with unexpected errors. The recommended ways are to install from PyPI see installation section or download the latest build package from the repo.

System requirement see.
To Build this module first clone or download the repo.

Make sure you have the latest version of PyPA’s build installed, run:

python3 -m pip install --upgrade build`

Change to wordDFN directory:

cd /path/to/wordDFN

Now run the following command from the same directory where pyproject.toml is located:

python3 -m build

After the build is completed, it should generate two files in the dist directory, change to the dist directory and install the package, for that run:

cd /path/to/wordDFN/dist
pip3 install worddfn-x.x.x-py3-none-any.whl

Credits


This project uses:
wordnik API.
pyperclip to help manage the clipboard see pyperclip repo.
xclip as system dependency use by pyperclip.


License


This project is licensed under the terms of the MIT license.

WORDNIK API

This project also respects and acknowledge the TOS of wordnik API.

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

worddfn-0.1.9.tar.gz (396.3 kB view details)

Uploaded Source

Built Distribution

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

worddfn-0.1.9-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file worddfn-0.1.9.tar.gz.

File metadata

  • Download URL: worddfn-0.1.9.tar.gz
  • Upload date:
  • Size: 396.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for worddfn-0.1.9.tar.gz
Algorithm Hash digest
SHA256 136bf2ef215038b0a7efbed61a80350dfac0e6e92adead5578475c37c7c10345
MD5 95a2523b08d81fb052577c3ac0dbe11d
BLAKE2b-256 afc0acd6c2120dcdfea4cdb2fd3ce5c3e9d51b2a6edd9cabcd2782115f9fc53c

See more details on using hashes here.

File details

Details for the file worddfn-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: worddfn-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for worddfn-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 4b521b00c9091c4d9bbbafebbb8a60954b68fd1e798425fdf1f9c53fdde248c6
MD5 6a784c1ae1d70694c37ae873689e15da
BLAKE2b-256 03f18f2bf63ec5fb3545f98c3ea5aed33464710be3efc2ce9509a28c58da3831

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