IMPORTANT This library is alpha-quality/stability. Tread carefully!
keepassdb is a python module to provide an API to read and write KeePass 1.x / KeePassX database files.
This project began as a desire to merge together several python keepass projects that provided strengths in different areas (but none of which worked fully as a standalone solution).
Specifically this project owes its roots to:
- kppy by Karsten-Kai König [email protected],
- python-keepass by Brett Viren [email protected], and
- kptool by Wakayama Shirou [email protected]
This project currently supports Python 2.x and 3.x (using 2to3).
This software is licensed under the GPLv3 (or later), in accordance with the upstream libraries and the KeePass project itself.
- Homepage: https://github.com/hozn/keepassdb
- Project Documentation: http://packages.python.org/keepassdb/
- Python 2.6+. (This does work with Python 3.x using 2to3.)
- Setuptools/Distribute
- PyCrypto
- Supports only KeePass V1 databases.
- Currently supports only AES encryption.
- Does not fully support the tree state MetaInfo entries that may be added by other programs.
- Does not work (yet) on Python 3.x
Via easy_install/distribute:
easy_install keepassdb
Or more traditionally:
python setup.py install
from keepassdb import Database
db = Database('./test.kdb', password='test'):
# Display a flat list of all groups and the entries in each group.
for group in db.groups:
print group.name
for entry in group.entries:
print "\t-%s" % entry.name
# A locking database will create the .lock file that other KeePass programs expect.
from keepassdb import LockingDatabase
with LockingDatabase('./new.kdb', new=True) as db:
group = db.create_group(title='A new group')
entry = group.create_entry(title='Entry1', username='root', password='test')
# etc.
db.save(password='test')