Ignore:
Timestamp:
27 Jun 2010, 08:51:55 (15 years ago)
Author:
uli
Message:

Update examples.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/ulif-fasttables/src/waeup/sirp/jambtables/README.txt

    r5239 r5243  
    55
    66JAMB data is stored in a JAMBDataTable.
     7
     8Creating JAMB Tables
     9====================
    710
    811We can import JAMB registration data from a regular CSV file:
     
    2629    >>> len(list(table))
    2730    3
     31
     32Accessing JAMB Data
     33===================
     34
     35Getting Entries
     36---------------
    2837
    2938We can get the entries from the table as an iterator:
     
    4958     {...}]
    5059
     60Also a :meth:`keys` and :meth:`items` method are available. They both
     61return an iterator.
     62
     63The :meth:`keys` method in action:
     64
     65     >>> pprint(list(table.keys()))
     66     [u'91100546DD', u'91111834CC', u'91109351AC']
     67
     68The :meth:`items` method in action:
     69
     70     >>> pprint(list(table.items()))
     71     [(u'91100546DD',
     72      {'course1': u'BSCPOL',
     73       'date_of_birth': datetime.date(1982, 5, 25),
     74       'entry_session': '9',
     75       'firstname': u'MOSES',
     76       'fst_sit_fname': u'ISUOSUO MOSES ODOMERO',
     77       'jamb_lga': u'ISO-S',
     78       'jamb_state': u'DEL',
     79       'lastname': u'ISUOSUO',
     80       'middlenames': u'ODOMERO',
     81       'reg_no': u'91100546DD',
     82       'screening_date': u'2009/09/25 09:00:00 GMT+1',
     83       'screening_type': u'pde',
     84       'screening_venue': u'REPRINT SLIP AS FROM WED 23/09/2009',
     85       'sex': u'M'}),
     86     (u'91111834CC',
     87      {...}),
     88     (u'91109351AC',
     89      {...})]
     90
     91A ``values()``-like behaviour cen be archieved by simply using the
     92iterator.
     93
     94Getting JAMB Table Meta Data
     95----------------------------
     96
    5197We can also get a datetime stamp, that tells, when the table was
    5298imported. This could help with maintaining old tables:
Note: See TracChangeset for help on using the changeset viewer.