Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vinibrsl/cep.ex
π Brazilian zipcode lookup (CEP) library for Elixir
https://github.com/vinibrsl/cep.ex
Last synced: 2 months ago
JSON representation
π Brazilian zipcode lookup (CEP) library for Elixir
- Host: GitHub
- URL: https://github.com/vinibrsl/cep.ex
- Owner: vinibrsl
- License: mit
- Created: 2021-05-14T02:18:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-16T02:50:39.000Z (over 3 years ago)
- Last Synced: 2023-03-20T22:38:00.988Z (almost 2 years ago)
- Language: Elixir
- Homepage: https://hexdocs.pm/cepex
- Size: 13.7 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
# cep.ex
> Brazilian zipcode lookup (CEP) library for Elixir.## Installing
The package can be installed by adding `cepex` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:cepex, "~> 0.1.0"}
]
end# => Rock on! π
```## Usage
```elixir
# With formatted zipcode strings :)
iex> Cepex.lookup("80010-180")
{:ok, %Cepex.Address{
address: "Rua BarΓ£o do Rio Branco",
cep: "80010180",
city: "Curitiba",
complement: "",
http_response: %Cepex.HTTP.Response{},
neighborhood: "Centro",
state: "PR"
}}# With zipcode integers :)
iex> Cepex.lookup(80010180)
{:ok, %Cepex.Address{
address: "Rua BarΓ£o do Rio Branco",
cep: "80010180",
city: "Curitiba",
complement: "",
http_response: %Cepex.HTTP.Response{},
neighborhood: "Centro",
state: "PR"
}}# With unformatted zipcode strings :)
iex> Cepex.lookup("80210130")
{:ok, %Cepex.Address{
address: "Rua BarΓ£o do Rio Branco",
cep: "80010180",
city: "Curitiba",
complement: "",
http_response: %Cepex.HTTP.Response{},
neighborhood: "Centro",
state: "PR"
}}
```## Docs
The full documentation is available on [Hex](https://hexdocs.pm/cepex/api-reference.html).## Contributing
1. Create a fork (https://github.com/vnbrs/cep.ex/fork)
2. Create a branch (git checkout -b my-new-feature)
3. Make a commit (git commit -am 'Add some feature')
4. Push your code (git push origin my-new-feature)
5. Create a Pull Request
6. Thanks! π€