Crate brasilapi_client

Crate brasilapi_client 

Source
Expand description

§BrasilAPI rust client wrapper

§Why I created this?

  • Well, I plan to use this API at the company I do work
  • I’m very exhausted to use any language we have on current stack (c#, python, javascript), for real…
  • A friend of mine talk about Rust every single day

§This code resembles X

Yes, probably, event reading some of the official documentation, I checked some cargo SDKs and wrappers, because I plan to use it soon Sorry, I cheated :(

§Brasil API - Rust client wrapper

Rust

Rust client implementation for Brasil API

BrasilAPI GitHub Project

§Installation

To use this client, add the following to your Cargo.toml:

[dependencies]
brasilapi-client = "0.2"

You may also choose a runtime

futures = "0.3" # If not using async runtimes

§Getting Started

 use brasilapi_client::{client::BrasilApiClient};
 use futures::executor::block_on;

 fn main() { block_on(async move {
     // As this API is public, you can use the following default builder
     let cli = BrasilApiClient::new_default();

     // Get the address info for zipcode  "01402-000"
     let zipcode_answer = cli.get_cep("01402-000", None).await.unwrap();

     println!("Street: {}", zipcode_answer.street);
 })}

Output:

Street: Avenida Brigadeiro Luiz Antonio

§APIs

§Banks

Implemented

§CEP (zipcode)

  • V1 -> Implemented
  • V2 -> Implemented

§CNPJ

TODO

§DDD

Implemented

§National Holidays - (Brasil)

Implemented

§FIPE

TODO

§IBGE

TODO

Re-exports§

pub use crate::definitions::*;

Modules§

client
This module should be used to get the Helper Client
commons
constants
definitions
errors