oxd

Crates.iooxd
lib.rsoxd
version0.1.6
sourcesrc
created_at2022-11-14 03:06:26.212272
updated_at2023-02-04 22:37:10.928486
descriptionClient to query Oxford Dictionary API
homepagehttps://github.com/chunjiw/oxd
repositoryhttps://github.com/chunjiw/oxd
max_upload_size
id714665
size192,627
Chunji Wang (chunjiw)

documentation

README

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

Commit count: 60

cargo fmt