How to create a new database

If you want to create a new database, just start the IsisNBP's console and create a new database by typing the following command:

In [1]: newdb = MasterFile('newdb')

now newdb is a MasterFile? object in memory, and you can put records on it. Before that, it is necessary creates MasterRecord? and MasterField? objects to populate database.

In [1]: record = MasterRecord()
In [2]: field1 = MasterField(24,'Techniques for the measurement of transpiration of')
In [3]: field2 = MasterField(70,'Magalhaes, A.C.')
In [4]: field3 = MasterField(70,'Franco, C.M.')
In [5]: record[24] = field1
In [6]: record[70] = [field2, field3]

Now you can save record on database newdb, typing:

In [8]: record.save(newdb)

and you can get the first record data:

In [9]: newdb[1]
Out [9]: MasterRecord(mfn=1, status=0, fields={24:MasterField(24, 'Techniques for the measurement of transpiration of'), 70:[MasterField(70, 'Magalhaes, A.C.'), MasterField(70, 'Franco, C.M.')]})

In [10]: newdb[1][24]
Out[10]: MasterField(24, 'Techniques for the measurement of transpiration of')

In [11]: newdb[1][24].data
Out[11]: u'Techniques for the measurement of transpiration of'