Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

Create MEF JSON record #38

Open
reropag opened this issue Jul 1, 2018 · 2 comments
Open

Create MEF JSON record #38

reropag opened this issue Jul 1, 2018 · 2 comments
Assignees

Comments

@reropag
Copy link
Contributor

reropag commented Jul 1, 2018

No description provided.

@reropag
Copy link
Contributor Author

reropag commented Jul 1, 2018

L'objectif de cette tâche est de développer une classe permettant de créer un MEF JSON record.
Cette classe doit offrir les outils permettant la fusion des données des différentes sources BNF, GND, RERO dans un MEF JSON record.

@reropag reropag self-assigned this Jul 1, 2018
@reropag
Copy link
Contributor Author

reropag commented Jul 1, 2018

branche: pag-#38-create-mef-record-json

example of usage:
from marctojson.mef_record import MEF_record

    mef_record_data = {}
    mef_record = MEF_record(
        json_data=mef_record_data,
        logger=file_logger,
        verbose=options.verbose
    )

bnf_data.json = # a JSON containing the BNF data
    mef_record.update_source(source='bnf', json_data=bnf_data.json)
    print(json.dumps(mef_record.json, ensure_ascii=False, indent=2), end='')

gnd_data.json = # a JSON containing the GND data
    mef_record.update_source(source='gnd', json_data=gnd_data.json)
    print(json.dumps(mef_record.json, ensure_ascii=False, indent=2), end='')

NOTE:
The update_source method add or update the source JSON data to the MEF JSON.
A md5 is added if not present to the source JSON data.
Other usage examples can be see in the test_mef_record.py file

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant