Formatting Language Commands

The IsisNBP's console is a powerful database manipulation and formatting language's commands program. It is able to execute standard ISIS commands and functions. Ex.:

$ pymx -i

Welcome to ISIS-NBP Cell 0.9.2 Interactive Console
Python 2.6.2 (r262:71600, Jul 20 2009, 02:19:59) 
[GCC 4.4.0 20090630 (prerelease)]
Use the console to test and inspect the collections.

Type 'collection' to see a dictionary with all available collections.
Type '<Ctrl-D>' or 'exit()' followed by '<enter>' to quit.

The available collections are: sample

In [1]: 

First, you can discover databases available in the collection sample:

In [1]: print sample
Databases: cds

Now you can open database:

In [2]: db = sample.cds

Now, let's manipulate some records:

In [3]: rec1 = db[1]
In [4]: print(rec1.format("('- 'v70/)"))
- Magalhaes, A.C.
- Franco, C.M.

In [5]: print(rec1.format('mfn,X1,mstname'))
000001 cds

In [6]: format("proc('a99|New field value|'),v99",rec1)
New field value

In [7]: format("mdu,v24",rec1)
TECHNIQUES FOR THE MEASUREMENT OF TRANSPIRATION OF INDIVIDUAL PLANTS.  

There are several commands and functions already available for use.

IsisNBP uses the Python interpreter as a command board. That means that you can directly use the Python language (assign variables, use loops, define functions, etc.)

In [8]: myvar = format("mdu,v24",rec1)
In [9]: print myvar.split()[0]
TECHNIQUES