Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
138 lines (121 sloc) 3.67 KB
-------------------------
One simple record test
-------------------------
Open file and read the record label::
>>> from iso2709 import IsoFile
>>> iso_file = IsoFile('fixtures/field3/field3.iso')
>>> rec = iso_file.next()
>>> rec #doctest: +ELLIPSIS
<iso2709.IsoRecord object at ...>
>>> len(rec)
93
>>> rec.show_label()
rec_len : 93
rec_status : '0'
impl_codes : '0000'
indicator_len : 0
identifier_len : 0
base_addr : 61
user_defined : '000'
fld_len_len : 4
start_len : 5
impl_len : 0
reserved : '0'
Read the directory::
>>> len(rec.directory)
3
>>> rec.directory[0].show()
tag : '011'
len : 5
start : 0
impl : ''
>>> rec.directory[1].show()
tag : '022'
len : 14
start : 5
impl : ''
>>> rec.directory[2].show()
tag : '333'
len : 12
start : 19
impl : ''
Read the field contents::
>>> rec.directory[0].value
'onze'
>>> rec.directory[1].value
'^avinte^bdois'
>>> rec.directory[2].value
'zebra^xzulu'
-------------------------------
CDS sample tests
-------------------------------
Open file and read the record label::
>>> iso_file = IsoFile('fixtures/cds/cds.iso')
>>> rec = iso_file.next()
>>> len(rec)
433
Read directory spanning the 80-column break::
>>> len(rec.directory)
8
>>> rec.directory[0].show()
tag : '044'
len : 78
start : 0
impl : ''
>>> rec.directory[-1].show()
tag : '070'
len : 13
start : 298
impl : ''
Show the record contents::
>>> rec.dump() #doctest: +ELLIPSIS
044 'Methodology of plant eco-physiology: proceedings of the Montpellier...
050 'Incl. bibl.'
069 'Paper on: <plant physiology><plant transpiration><measurement and...
024 'Techniques for the measurement of transpiration of individual plants'
026 '^aParis^bUnesco^c-1965'
030 '^ap. 211-224^billus.'
070 'Magalhaes, A.C.'
070 'Franco, C.M.'
-------------------------------
Lilacs-30 sample tests
-------------------------------
>>> iso_file = IsoFile('fixtures/lilacs30/lilacs30.iso')
>>> rec = iso_file.next()
>>> rec.indicator_len
0
>>> rec.identifier_len # XXX: why does lilacs30.iso have an identifier_len != 0???
2
>>> rec.dump() #doctest: +ELLIPSIS
001 'BR1.1'
002 '538905'
004 'LILACS'
004 'LLXPEDT'
005 'S'
006 'as'
008 'Internet^ihttp://www.demneuropsy.com.br/imageBank/PDF/v3n4a15-ing...
010 'Takada, Leonel Tadao^1Universidade de S\xe3o Paulo^2Faculdade de ...
010 'Camiz, Paulo^1Universidade de S\xe3o Paulo^2Faculdade de Medicina...
010 'Grinberg, Lea T^1University of California^2Department of Neurolog...
010 'Leite, Claudia da Costa^1University of S\xe3o Paulo^2Faculty of M...
012 'Non-inflammatory cerebral amyloid angiopathy as a cause of rapidl...
012 'Angiopatia amil\xf3ide cerebral n\xe3o inflamat\xf3ria como causa...
030 'Dement. neuropsychol'
031 '3'
032 '4'
035 '1980-5764'
040 'Pt'
041 'En'
041 'Pt'
064 'dezembro/2009'
065 '20090000'
067 'BR'
083 'Abstract ? A 77 year-old men developed a subacute-onset, rapidly ...
083 'Resumo ? Um homem de setenta e sete anos desenvolveu quadro de in...
084 '2010-03-05'
091 '20100221'
092 'BR1876.9'
092 'EDT'
098 'FONTE'
113 'p'
778 '538905^dBIREME_LLXPEDT^sS1980-576420090005000200014'
Something went wrong with that request. Please try again.