daily pastebin goal
1%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from pymarc import MARCReader
  2. from pymarc import Record, Field
  3.  
  4. with open('machiavellism_biu_2018.mrc', 'rb') as fh:
  5.     reader = MARCReader(fh, to_unicode=True)
  6.     # loop 1
  7.     recnum = 0
  8.     for record in reader:
  9.         # loop 2
  10.         recnum += 1
  11.         for tield_contents in record.get_fields():
  12.             print ('%09d' % recnum,' ',tield_contents.tag,'  ',' L',tield_contents.value())
  13.         ## end loop 2
  14.    
  15. python pymarc_000002.py
  16.    
  17. 000000001   001     L 002547390
  18. 000000001   003     L OCoLC
  19. 000000001   005     L 20181016125657.0
  20. 000000001   008     L 180214t20182018enka     b    001 0 eng
  21. 000000001   092     L 302 BER m
  22. 000000001   020     L 9781138093317
  23. 000000001   035     L (OCoLC)991673448
  24. 000000001   040     L eng rda
  25. 000000001   041     L eng
  26. 000000001   100     L Bereczkei, Tamás lat author
  27. 000000001   245     L Machiavellianism : the psychology of manipulation / Tamas Bereczkei.
  28. 000000001   264     L London : Routledge, 2018.
  29. 000000001   264     L ©2018
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top