opencnam

A simple python library for getting caller ID name information using the opencnam API
Download

opencnam Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Public Domain
  • Price:
  • FREE
  • Publisher Name:
  • Randall Degges
  • Publisher web site:
  • http://github.com/comradeb14ck/

opencnam Tags


opencnam Description

opencnam is a simple Python library for getting caller ID name information.This library uses (http://www.opencnam.com "opencnam") as a backend.InstallationInstall from PyPi using (http://www.pip-installer.org/en/latest/), a package manager for Python.pip install opencnamDon't have pip installed? Try installing it, by running this from the command line:curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | pythonOr, you can [download the source code ZIP for opencnam, and then run: python setup.py installYou may need to run the above commands with sudo.UsageUsing python-opencnam is easy:from opencnam import Phonephone = Phone('2024561111')print phone.number, phone.cnamThe main object, Phone, defined in the opencnam module accepts a phone number as input, and (behind the scenes) queries the opencnam API to set the Phone.cnam attribute.To make things insanely easy, python-opencnam transparently handles phone number validation--so you can create a Phone object using any phone number you can possibly imagine, as long as it can be cleaned up into a valid, 10-digit, US phone number.For example:from opencnam import Phonephone = Phone('+1 (818)-217 \\\\9229')assert phone.number == '8182179229'The way the number cleaning algorithm works is:- Remove all non-integer characters.- Grab the last 10 digts of the string.- Make sure those 10 digits are a valid US phone number.So you can go crazy with input, and not worry about getting an opencnam.InvalidPhoneNumberError exception unless the phone number cannot be made valid.Product's homepage


opencnam Related Software