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...
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

A tool that allow you to run SQL-like query on local files instead of database files using the GitQL SDK.
A tool that allow you to run SQL-like query on local files instead of database files using the GitQL SDK.

FileQL - File Query Language FileQL is a tool that allow you to run SQL-like query on local files instead of database files using the GitQL SDK. Sampl

 ClangQL is a tool that allow you to run SQL-like query on C/C++ Code instead of database files using the GitQL SDK
ClangQL is a tool that allow you to run SQL-like query on C/C++ Code instead of database files using the GitQL SDK

ClangQL - Clang AST Query Language ClangQL is a tool that allow you to run SQL-like query on C/C++ Code instead of database files using the GitQL SDK.

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

A command-line benchmarking tool
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

An interactive cheatsheet tool for the command-line
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

Coinlive is an interactive command line tool that displays live cryptocurrency prices.
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.

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.

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 18 Dec 15, 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
Pink is a command-line tool inspired by the Unix man command.

Pink is a command-line tool inspired by the Unix man command. It displays custom-formatted text pages in the terminal using a subset of HTML-like tags.

null 3 Nov 2, 2023
A command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects.

CCake CCake is a command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects. Goals To be easily und

Boston Vanseghi 4 Oct 24, 2022
Rust File Management CLI is a command-line tool written in Rust that provides essential file management functionalities. Whether you're working with files or directories, this tool simplifies common file operations with ease.

Rust FileOps Rust File Management CLI is a command-line tool written in Rust that provides essential file management functionalities. Whether you're w

Harikesh Ranjan Sinha 5 May 2, 2024
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 3 Jan 3, 2023
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
A command-line interface for interacting with the ChatGPT API from OpenAI

cligpt cligpt is a command-line interface for interacting with the ChatGPT API from OpenAI. With cligpt, you can quickly and easily generate text by s

Felipe S. S. Schneider 6 Apr 4, 2023
SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project.

SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project. With just a few primary configurations, such as project name, you can get started quickly.

Gabriel Michaliszen 4 May 9, 2023