| 1 |
.. _db_api: |
| 2 |
|
| 3 |
API documentation for the database interface |
| 4 |
====================================================== |
| 5 |
|
| 6 |
.. module:: calibre.db.cache |
| 7 |
:synopsis: The API for accessing and manipulating a calibre library. |
| 8 |
|
| 9 |
This API is thread safe (it uses a multiple reader, single writer locking scheme). You can access this API like this:: |
| 10 |
|
| 11 |
from calibre.library import db |
| 12 |
db = db('Path to calibre library folder').new_api |
| 13 |
|
| 14 |
If you are in a calibre plugin that is part of the main calibre GUI, you |
| 15 |
get access to it like this instead:: |
| 16 |
|
| 17 |
db = self.gui.current_db.new_api |
| 18 |
|
| 19 |
.. autoclass:: Cache |
| 20 |
:members: |
| 21 |
|
| 22 |
|