2.2. Writing your own scripts

To start writing your own script, you can read what follows, and then have a look at the existing scripts. Trying to adapt them to fit your personal needs can be a good way of testing what you read.

2.2.1. Some concepts

This section describes some basic classes and ideas that are useful to understand how pybliographer works. More information can be found in Reference I, Class reference.

In the following, all the modules that will be refered to belong to the Pyblio domain. So, to access the members of the Open module, you'll have to write at the beginning of your script something like

from Pyblio import Open

The Base module contains some of the most basical classes used in the application:

Key.Key is the object that uniquely identifies an entry. This object must be unique over the whole application, and is composed of a database part and an entry part.

An Iterator is an object that provides a way to access a sequence of items in order. These iterators are used extensively in pybliographer, because they hide the underlying access mechanism, and provide the same access on any database. They are also perfectly suited for implementing transparent filtering and sorting of entries: the Selection.Selection class for example takes an iterator (on a database for example) and return a new one which will only iterate on a subset of the entries, according to a search criterion.