Skip to content

Commit

Permalink
Switch to Avram
Browse files Browse the repository at this point in the history
This commit moves from using a bespoke YAML format for representing the MARC
specification to using Avram JSON. https://format.gbv.de/schema/avram/specification

Note: it might also be nice to be able to use a custom Avram schema from the
command line.

Closes #1
  • Loading branch information
edsu committed Dec 30, 2023
1 parent 01fa97e commit acdfe37
Show file tree
Hide file tree
Showing 8 changed files with 12,589 additions and 7,361 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ __pycache__
test-data/*.csv
test-data/*.parquet
*.pyc
dist
7 changes: 4 additions & 3 deletions marctable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ def jsonl(infile: click.File, outfile: click.File, rules: list, batch: int) -> N


@cli.command()
def yaml() -> None:
@click.argument("outfile", type=click.File("w"), default="-")
def avram(outfile: click.File) -> None:
"""
Generate YAML for the MARC specification by scraping the Library of Congress.
Generate Avram (YAML) from scraping the Library of Congress MARC bibliographic website.
"""
marctable.marc.main()
marctable.marc.crawl(outfile=outfile)


def main() -> None:
Expand Down
Loading

0 comments on commit acdfe37

Please sign in to comment.