Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agrausem/pyromarc
Python implementation of MARC:MIR
https://github.com/agrausem/pyromarc
Last synced: 8 days ago
JSON representation
Python implementation of MARC:MIR
- Host: GitHub
- URL: https://github.com/agrausem/pyromarc
- Owner: agrausem
- Created: 2013-04-17T17:58:11.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-11-12T18:06:17.000Z (about 11 years ago)
- Last Synced: 2024-10-06T06:49:51.449Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 617 KB
- Stars: 4
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
========
Pyromarc
========.. image:: https://secure.travis-ci.org/agrausem/pyromarc.png?branch=master
:target: https://travis-ci.org/agrausem/pyromarc.. image:: https://coveralls.io/repos/agrausem/pyromarc/badge.png?branch=master
:target: https://coveralls.io/r/agrausem/pyromarc?branch=masterMARC::MIR est une spécification de représentation mémoire (sous la forme de
tableau de tableaux) de données bibliographiques cataloguée en MARC. elle
permet d'établir des ponts simples entre les différents outils exitants de
traitement, sérialisation, indexation, ...Install
=======Pyromarc is only working under *Python 3.2* for the moment. To install the module, use pip ::
$> pip install pyromarc
Reading
=======ISO2709
-------Load MIRs from ISO2709 ::
from pyromarc import reader
mirs = reader('/path/to/records.iso2709', 'ISO2709')
for mir in mirs:
do_something_with(mir)Or, with a filehandler ::
from pyromarc import readerb
with open('/path/to/records/example.iso2709', 'rb') as filehandler:
mirs = readerb(filehandler, 'ISO2709')
for mir in mirs:
do_something_with(mir)Msgpack
-------Load MIRs from stdin ::
import sys
from pyromarc import readerbmirs = readerb(sys.stdin, 'MsgPack')
for mir in mirs:
do_something_with(mir)Writing
=======ISO2709
-------Write MIRs in file ::
from pyromarc import writer
[...]
writer('/path/to/records.iso2709', mirs, 'ISO2709')Writing ISO2709 records in JSON ::
from pyromarc import reader, writer
mirs = reader('/path/to/records.iso2709', 'ISO2709')
writer('/path/to/records.json', mirs, 'Json')MsgPack
-------Writing on stdout ::
import sys
from pyromarc import writerb[...]
writerb(sys.stdout, mirs, 'MsgPack')