Skip to main content

postalcodes-ni

Python package for handle Nicaragua postal codes

made-with-python made-with-python PyPI version Travis-ci GitHub version Documentation Status

Quickstart

Install postalcodes-ni:

$ pip install postalcodes-ni

Then use it in your project:

from postalcodes_ni import (
    get_all_municipalities_by_iso, get_all_municipalities_by_postal,
    get_municipality_by_name, get_municipality_by_postal
)

You can find the documentation in https://postalcodes-ni.readthedocs.io

This package uses data from those websites:

Usage

postalcodes_ni exposes the following methods:

  • get_all_municipalities_by_iso for get all the municipalities in a department using the ISO code - Ex MN for Managua department.
  • get_all_municipalities_by_postal for get all the municipalities in a department using the postal code - Ex 10000 for Managua department.
  • get_municipality_by_name for get an specific municipality using his name - Ex Altagracia for the Rivas department.
  • get_municipality_by_postal for get an specific municipality using his postal code - Ex 48800 for the municipality of Altagracia from Rivas department.

Example

First, you need import the methods that you want to use

from postalcodes_ni import (
    get_all_municipalities_by_iso, get_all_municipalities_by_postal,
    get_municipality_by_name, get_municipality_by_postal
)

For get all the municipalities in a department use the following methods

>>> # Get all the municipalities in Carazo department using iso code
>>> get_all_municipalities_by_iso('CA')
[('Jinotepe', 45000), ('Dolores', 46100), ('El Rosario', 46200), ...]

>>> # Get all the municipalities in Carazo department using postal code
>>> get_all_municipalities_by_postal(45000)
[('Jinotepe', 45000), ('Dolores', 46100), ('El Rosario', 46200), ...]

For get an specific municipality in a department use the following methods

>>> # Get a municipality using his name
>>> get_municipality_by_name('nindiri')
('Nindirí', 42200)

>>> # Get a municipality using his postal code
>>> get_municipality_by_postal(42500)
('Catarina', 42500)

Running Tests

Does the code actually work?

$ source env/bin/activate
(env) $ pip install -r requirements_dev.txt
(env) $ make test-all

History

1.0.0 (2019-03-27)

  • First release on PyPI.

Metadata

Release files for postalcodes-ni 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for postalcodes-ni 1.2.0
File Size Uploaded
postalcodes_ni-1.2.0.tar.gz 26.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for postalcodes-ni 1.2.0
File Interpreter ABI Platform
postalcodes_ni-1.2.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 43.6 kB

Release files / postalcodes_ni-1.2.0.tar.gz

Download URL postalcodes_ni-1.2.0.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a215459a1082143b04259854eb1efd9a14b4f76a9de7b1310ade159a9f0df861
BLAKE2b-256 checksum
How to use checksums
d6c875388d45539e35cf3c8bf87926569a89c544fcf7f311c90f24aad68d8f87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / postalcodes_ni-1.2.0-py2.py3-none-any.whl

Download URL postalcodes_ni-1.2.0-py2.py3-none-any.whl
Size 16.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2a488e7ba91498ce52f98f2ab269f761c603c0e97ba6523ae8fb50455a65c602
BLAKE2b-256 checksum
How to use checksums
697efba5d0941dbe90adde916fe60d52acbbf01259d5226e2cbe8e2fb9b6c5ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page