An implementation of Android-like Contact book API, written in Python.
- Tested with Python 3.4+.
- virtualenv is recommended.
- Activate virtualenv.
- This library depends on SQLAlchemy, whose latest version
often cannot be built on older setuptools. Update your setuptools using
pip install --upgrade pip setuptools
- Install this library using
pip install git+https://github.com/ninadpage/contact-book-python.git
Testsuite can be executed using python setup.py test
>>> import contactbook
>>> contactbook.init_contactbook(sqlite_db_path='test.db')
>>> cb = contactbook.ContactBookDB()
>>> p = cb.create_person(first_name='First', last_name='Last')
>>> cb.get_all_persons()
[<Person> First Last
Phone numbers: []
Email addresses: []
Addresses: []
Groups: []]
Full API documentation can be found here.
This library needs a database to store all data. Simplest option is to provide a SQLite db file, like above example. But it may work with any major database engine. See init_contact for more details.