Skip to main content

A simple converter of MARC/MARCXML/PICAXML to CSV/TSV/parquet

Project description

bibxml2

A simple converter of (possibly compressed) MARCXML/PICAXML to (possibly compressed) CSV/TSV/parquet.

The resulting CSV/TSV/parquet has been designed to be easy to use as a data table, but also to retain all ordering informaation in the original when such is needed. The format is as follows: record_number,field_number,subfield_number,field_code,subfield_code,value

Here, record_number identifies the MARC/PICA+ record, while field_number and subfield_number can be used for more exact filtering / reconstructing the original field structure/order if needed.

For MARC data fields, ind1 and ind2 values are reported as separate rows with the subfield_code being Y or Z, but only when non-empty (MARC requires subfield codes to be lowercase, so this should be relatively safe). The MARC leader is output with field code LDR.

Installation

Install from pypi with e.g. pipx install bibxml2.

Usage

Usage: marcxml2 [OPTIONS] [INPUT]...

  Convert from MARCXML (compressed) input files into (compressed) CSV/TSV/parquet

Options:
  -o, --output TEXT  Output CSV/TSV (compressed) / parquet file  [required]
  --help             Show this message and exit.
Usage: picaxml2csv [OPTIONS] [INPUT]...

  Convert from PICAXML (compressed) input files into (compressed) CSV/TSV/parquet

Options:
  -o, --output TEXT  Output CSV/TSV (compressed) / parquet file  [required]
  --help             Show this message and exit.

If the output file extension is .parquet, the output will be in parquet format, compressed with zstd, and with field typings maximally compatible with common R and Python ecosystems. Otherwise, compressed files will be read/written if the filename ends with an identifier recognised by fsspec. TSV format will be used if the output filename contains .tsv, otherwise CSV will be used.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bib2-1.7.1.tar.gz (149.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bib2-1.7.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file bib2-1.7.1.tar.gz.

File metadata

  • Download URL: bib2-1.7.1.tar.gz
  • Upload date:
  • Size: 149.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bib2-1.7.1.tar.gz
Algorithm Hash digest
SHA256 ca3b38d2ca372c06ea6d1afa31744a9c8b2a4d70ed98c161823b0991ad303718
MD5 6e762e62f79183496489591dab6f7ec2
BLAKE2b-256 32159099185c8eea65bf2f4107093f9804cbe8caacf6b7916db2eb86b0939122

See more details on using hashes here.

File details

Details for the file bib2-1.7.1-py3-none-any.whl.

File metadata

  • Download URL: bib2-1.7.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bib2-1.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 42e1da955f25ab6228df7994e0bc03fd69f6607abcb4cf81dfcc610bc0f382e3
MD5 064b827e0bacb0c312bd577efadd2c79
BLAKE2b-256 98e448a8adc0126cab4e31a3bde6aa3d2d1956d3d96de626612045510a125d48

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page