Giter VIP home page Giter VIP logo

postmon-clj's Introduction

postmon-clj

Clojars Project Build Status

Simple wrapper for PostmonAPI

Installation

Include into your project.clj

[postmon "1.0.0"]

Usage

Getting CEP (zipcode)

(postmon/cep "02013010")

You'll get a map with CEP especification.

{:bairro "Santana", :cidade "São Paulo", :logradouro "Rua Henrique Bernardelli", :estado_info {:area_km2 "248.221,996", :codigo_ibge "35", :nome "São Paulo"}, :cep "02013010", :cidade_info {:area_km2 "1521,11", :codigo_ibge "3550308"}, :estado "SP"}

Note: You don't need to format your CEP, you can use unformatted CEP string.

Getting City Information

(postmon/city-data "SP" "Leme")
{:area_km2 "402,871", :codigo_ibge "3526704"}

Getting UF (state) Information

(postmon/uf-data "SP")
{:area_km2 "248.221,996", :codigo_ibge "35", :nome "São Paulo"}

Getting object package deliver tracking

(postmon/pack-deliver-tracker "ect" "mocked")
  {:codigo "mocked" :service "ect" :historico {:local "AG Liberdade - Sao Paulo/SP" :data "02/01/2020 13:23:03" :situacao "Postado"}}

Note: Postmon only supports ECT (Correios - Empresa Brasileira de Correios e Telegrafos) yet!

Exceptions

In case your query does return nothing from Postmon services, you will get a custom exception from slingshot! There is the exception for handling.

{:type :postmon.request/nothing-returned :message "nothing returned from postmon"}

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Rynaro/postmon-clj.

License

The lib is available as open source under the terms of the MIT License.

postmon-clj's People

Contributors

rynaro avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.