- Timestamp:
- 27 Jun 2010, 08:51:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/branches/ulif-fasttables/src/waeup/sirp/jambtables/README.txt
r5239 r5243 5 5 6 6 JAMB data is stored in a JAMBDataTable. 7 8 Creating JAMB Tables 9 ==================== 7 10 8 11 We can import JAMB registration data from a regular CSV file: … … 26 29 >>> len(list(table)) 27 30 3 31 32 Accessing JAMB Data 33 =================== 34 35 Getting Entries 36 --------------- 28 37 29 38 We can get the entries from the table as an iterator: … … 49 58 {...}] 50 59 60 Also a :meth:`keys` and :meth:`items` method are available. They both 61 return an iterator. 62 63 The :meth:`keys` method in action: 64 65 >>> pprint(list(table.keys())) 66 [u'91100546DD', u'91111834CC', u'91109351AC'] 67 68 The :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 91 A ``values()``-like behaviour cen be archieved by simply using the 92 iterator. 93 94 Getting JAMB Table Meta Data 95 ---------------------------- 96 51 97 We can also get a datetime stamp, that tells, when the table was 52 98 imported. This could help with maintaining old tables:
Note: See TracChangeset for help on using the changeset viewer.