w3w-api

Crates.iow3w-api
lib.rsw3w-api
version0.1.1
sourcesrc
created_at2021-03-29 15:35:07.567591
updated_at2021-03-29 15:38:03.21264
descriptionRust library for what3words public API
homepage
repositoryhttps://github.com/Br1ght0ne/w3w-rs/
max_upload_size
id375242
size7,527
Oleksii Filonenko (Br1ght0ne)

documentation

README

w3w-rs

Rust crates for accessing what3words public API

w3w-cli

Lib.rs Crates.io downloads

CLI that provided access to what3words public API in batch mode.

Features

  • Reasonably fast
  • Zero system dependencies
  • Supports most what3words public API endpoints, excluding speech recognition
  • WIP: Interactive mode with autosuggest

Installation

Binary releases are not provided yet. If you have a recent installation of Rust, you can use cargo install:

cargo install w3w-cli

The binary name is w3w for brevity.

Usage

You need to have a what3words API key. You can provide it via -k|--key flag or via W3W_API_KEY env variable.

w3w uses the same strategy as cat(1) for handling files and standard input. (WIP: w3w doesn't currently support multiple files, you can use cat(1) beforehand :smile:) If no [file] is provided, input is read from stdout.

`w3w --help`
USAGE:
    w3w [OPTIONS] --api-key <api-key> <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -k, --api-key <api-key>         Your what3words API key [env: W3W_API_KEY]
        --log-format <format>       Log format to be used by tracing-subscriber [env: W3W_LOG_FORMAT=]  [default: full]
                                    [possible values: compact, full, json, pretty]
    -o, --output-format <format>    Output format to write to stdout [env: W3W_OUTPUT_FORMAT=]  [default: plain]
                                    [possible values: plain, json]

SUBCOMMANDS:
    available-languages    List all available language for three-word-addresses
    help                   Prints this message or the help of the given subcommand(s)
    to-3wa                 Convert geographic coordinates to three-word-addresses
    to-coords              Convert three-word-addresses to geographic coordinates

Examples

$ w3w to-coords <(echo "filled.count.soap")
51.520847,-0.195521

$ w3w -o json to-coords <(echo "filled.count.soap") | jq .coordinates
{ "lat": 51.520847, "lng": -0.195521 }

$ w3w to-3wa <(echo "51.520847,-0.195521")
filled.count.soap

$ w3w available-languages
English (en), German (de), ...

w3w-api

Lib.rs docs.rs

Rust library for what3words public API.

Contributing

All kinds of contributions are welcome, especially about increasing the coverage of upstream API.

License

This project is licensed under MIT license.

Commit count: 7

cargo fmt