Skip to main content

a thin wrapper around getziptastic's API v2

Project description


[![PyPI version](]( [![License](](

pyzipcode-cli is a thin wrapper around getziptastic's API v2




- Supports all the Country codes specified in the ISO specification i.e all **264 countries** where they have a pin code.
- Gives ouput in `JSON` format.
- A clean command line interface which abides with `POSIX` interface.
- written in python
- works on Mac, Linux, Windows


##Option 1: installing from source

$ git clone
$ cd pyzipcode-cli/pyzipcode-cli
$ python install

##Option 2: installing through [pip](

[pypi package link](

`$ pip install pyzipcode-cli`


$ pyzipcode --p=248001 --c=IN
{'county': 'Dehradun', 'country': 'IN', 'postal_code': '248001', 'state_short': '39', 'city': 'Kanwali', 'state': 'Uttarakhand'}

If you don't specify the option `--c`, country code will default as `IN` and `pyzipcode` will try to search for the particular zipcode in `India`

$ pyzipcode --p=603203
{'postal_code': '603203', 'city': 'Kavanur', 'state': 'Tamil Nadu', 'county': 'Kanchipuram', 'state_short': '25', 'country': 'IN'}

$ pyzipcode --p=48867 --c=US
{'county': 'Shiawassee', 'city': 'Owosso', 'country': 'US', 'postal_code': '48867', 'state': 'Michigan', 'state_short': 'MI'}

####Get list of all countries with their country codes

`$ pyzipcode ls`

You can search for a country by piping it

$ ./ ls | grep kistan
PK : Pakistan
UZ : Uzbekistan
TJ : Tajikistan

$ pyzipcode -v


$ pyzipcode --help
Usage: (ls | list) --p=PINCODE --c=COUNTRYCODE --p=PINCODE --version (-h | --help)
-h --help Show this screen
-v --version Show version


- [ ] Add support for calculating distance between two cities
- [ ] adding details like
- [ ] Longitude and Latitude
- [ ] Time zone


Feel free to contribute

1. Fork it.
2. Create your feature branch (`git checkout -b my-new-awesome-feature`)
3. Commit your changes (`git commit -am 'Added <xyz> feature'`)
4. Push to the branch (`git push origin my-new-awesome-feature`)
5. Create new Pull Request


Please report the bugs at the [issue tracker](

## License :

MIT License []( &copy; Tasdik Rahman

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyzipcode-cli-0.0.11.tar.gz (7.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page