Skip to main content

A simple converter of 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

bibxml2-1.5.2.tar.gz (161.8 kB view details)

Uploaded Source

Built Distribution

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

bibxml2-1.5.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file bibxml2-1.5.2.tar.gz.

File metadata

  • Download URL: bibxml2-1.5.2.tar.gz
  • Upload date:
  • Size: 161.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.18

File hashes

Hashes for bibxml2-1.5.2.tar.gz
Algorithm Hash digest
SHA256 d1a174193c97612481066da85575107f0e59a5686e858df33173c1737ad877e1
MD5 96935b8404302fa032ed617c609304a5
BLAKE2b-256 6648e5caff099a33356db0e07a3acfc15e1cf3e8a6dcca50cc88a090248bcab2

See more details on using hashes here.

File details

Details for the file bibxml2-1.5.2-py3-none-any.whl.

File metadata

  • Download URL: bibxml2-1.5.2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.18

File hashes

Hashes for bibxml2-1.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a3c7e724a019087602e134e358cf3e79a4acce9112fa1b998e8759b6f6d093f1
MD5 00871ada1e8e182b392333b04c71e33e
BLAKE2b-256 3e80778154340cd4b1a9b4edd3ccaf7d843e67f0c2f182c87442e9b872af64d1

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