Command line tool to query the Oxford Dictionaries API.

Related tags

Command-line oxd
Overview

oxd

Oxd is a client library for the Oxford Dictionary API. It provides a series of structs modeling entries returned from the API, a function [get_entry] to get entries from the API, a Display trait to display entries, and a Pronounce trait to play pronunciation files.

Usage

First you need to go to the Oxford Dictionary API website to get an application id and a key.

Use as a command line utility

Currently the most convenient way to install oxd is via cargo:

cargo install oxd

After installation, set environment variables OD_API_APP_ID and OD_API_APP_KEY to their corresponding values obtained from the Oxford Dictionary API website. Then just type oxd rust to look up the word "rust".

Screenshot

Use as a library

use oxd::{build_client, get_entry};

let app_id = "your_app_id".to_owned();
let app_key = "your_app_key".to_owned();

let client = build_client(app_id, app_key);
if let Some(retrieve_entry) = get_entry(&client, "rust") {
    println!("{:#?}", retrieve_entry);
}

License: MIT

You might also like...
verilot (verifiable lottery) is a command line tool for running and verifying one-time lotteries.

verilot verilot (verifiable lottery) is a command line tool for running and verifying one-time lotteries. Install Install Rust and Cargo with Rustup.

A tool crate to quickly build rust command line application.

Falsework A tool crate to quickly build rust command line application.

Standard Graphics is a command-line tool for printing 2D graphics from any language to any screen.
Standard Graphics is a command-line tool for printing 2D graphics from any language to any screen.

2D graphics in any programming language with just print statements!

🌤️ Command line weather tool.
🌤️ Command line weather tool.

🌤️ Command line weather tool.

A dead simple functional testing tool for command line applications

Pharaoh : build that test pyramid! What it is Pharaoh is a dead simple, no permission needed, functional test runner for command line applications, wr

ruborute is an interactive command-line tool to get [email protected] gaming data.

ruborute Are you 暴龍天 ?. The ruborute is an interactive command-line tool to get [email protected] gaming data. asphyxia-core/plugins: https://github.com/a

Command line tool to extract various data from Blender .blend files

blendtool Command line tool to extract various data from Blender .blend files. Currently supports dumping Eevee irradiance volumes to .dds, new featur

A tool to use the webeep platform of the Politecnico di Milano directly from the command line.

webeep-cli A tool to use the WeBeep platform of the Politecnico di Milano directly from the command line. Features Browse the course folders as if the

Command line tool for computing gigantic correlation matrices

turbocor This is little program designed to compute (sparse) Pearson correlation matrices as efficiently as possible. The main ideas are thus: Pairwis

Comments
  • /entries/en-us/content vs /words/en-us?q=content

    /entries/en-us/content vs /words/en-us?q=content

    Endpoint /words:

    Use this endpoint to retrieve definitions, examples and other information for a given dictionary word or an inflection (e.g., running > run). The response contains information about the lemmas to which the given word/inflected form is linked.

    Sometimes it generate entries with only "homographNumber" and "inflections"; such entries are a sole lexical category if displayed.

    Should I revert to /entries endpoint? If so, I need to query /lemmas first to get the headword, and then use /entries.

    opened by chunjiw 2
  • Document certain assumptions and report when assumptions violated

    Document certain assumptions and report when assumptions violated

    1. One RetrieveEntry has at least one HeadwordEntry
    2. One HeadwordEntry has at least one LexicalEntry
    3. Each LexicalEntry has one and only one
      1. LexicalCategory (single object)
      2. Entry (array of length 1)
    4. Each Entry
    5. Each Sense if has definitions then only one (array of length 1)
    opened by chunjiw 2
  • Env var hint

    Env var hint

    Before

    Even oxd --help will fail if the environmental variables are missing. Moreover, the error message doesn't tell what is missing or how to fix that.

    $ oxd --help
    Problem reading Oxford Dictionary API App KEY: environment variable not found
    

    After

    • oxd --help works all the time.
    • $ oxd rust  # without env variables
      Problem reading Oxford Dictionary API App KEY: environment variable not found
      Get one at https://developer.oxforddictionaries.com/ and set OD_API_APP_KEY.
      
    opened by YDX-2147483647 1
  • Planned features

    Planned features

    • [x] #5
    • [x] #7
    • [x] Play audio (only once for the same pronunciation) when using terminal
    • [x] #2
    • [x] Error handling
      • [x] API call return error code
      • [x] Not very clear how to sanitize user input
    • [x] Use words endpoint instead ~Convert lemma to headword~
    • [x] Replace and remove API id and key
    • [x] Add variantForms (such as those in word fetid: British foetid)
    opened by chunjiw 1
Owner
Chunji Wang
Chunji Wang
🦞 Rust library of natural language dictionaries using character-wise double-array tries.

?? Crawdad: ChaRActer-Wise Double-Array Dictionary Overview Crawdad is a library of natural language dictionaries using character-wise double-array tr

null 17 Aug 30, 2022
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
A small CLI tool to query ArcGIS REST API services, implemented in Rust. The server response is returned as pretty JSON.

A small CLI tool to query ArcGIS REST API services, implemented in Rust. The server response is returned as pretty JSON.

Andrew Vitale 2 Apr 25, 2022
qsv - Performant CLI tool to query CSVs through SQL

qsv Performant CLI tool to query CSVs through SQL Installation After cloning the repository, you can install a binary locally using cargo install --pa

Dermot Haughey 3 Oct 28, 2021
Command-line HTTP client for sending a POST request to specified URI on each stdin line.

line2httppost Simple tool to read lines from stdin and post each line as separate POST request to a specified URL (TCP connection is reused though). G

Vitaly Shukela 2 Oct 25, 2022
Command line wrapper of the DeepL API

deeprs - A command line wrapper of DeepL API About deeprs is a command line wrapper of the DeepL translator API. To use it you need a API key which yo

Konstantin Bücheler 1 Oct 28, 2021
rip is a command-line deletion tool focused on safety, ergonomics, and performance

rip (Rm ImProved) rip is a command-line deletion tool focused on safety, ergonomics, and performance. It favors a simple interface, and does not imple

Kevin Liu 751 Nov 29, 2022
A command-line benchmarking tool

hyperfine 中文 A command-line benchmarking tool. Demo: Benchmarking fd and find: Features Statistical analysis across multiple runs. Support for arbitra

David Peter 13.7k Nov 30, 2022
An interactive cheatsheet tool for the command-line

navi An interactive cheatsheet tool for the command-line. navi allows you to browse through cheatsheets (that you may write yourself or download from

Denis Isidoro 12.1k Nov 29, 2022
Coinlive is an interactive command line tool that displays live cryptocurrency prices.

Coinlive is an interactive command line tool that displays live cryptocurrency prices. It can also display simple historical price charts.

Mayer Analytics 8 Dec 4, 2022