A simple converter of MARCXML/PICAXML to CSV/TSV
Project description
marcxml2csv
A simple converter of (possibly gzipped) MARCXML/PICAXML to (possibly gzipped) CSV/TSV.
The resulting CSV/TSV 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 flow if needed.
For the MARC leader and control fields, subfield_number
will be empty.
For MARC data fields, ind1
and ind2
values are reported as separate rows with the subfield_code
being ind1
or ind2
, but only when non-empty. The also have an empty subfield_number
.
Installation
Install from pypi with e.g. pipx install marcxml2csv
.
Usage
Usage: marcxml2csv [OPTIONS] [INPUT]...
Convert from MARCXML (gz) input files into (gzipped) CSV/TSV
Options:
-o, --output TEXT Output CSV/TSV (gz) file [required]
--help Show this message and exit.
Usage: picaxml2csv [OPTIONS] [INPUT]...
Convert from PICAXML (gz) input files into (gzipped) CSV/TSV
Options:
-o, --output TEXT Output CSV/TSV (gz) file [required]
--help Show this message and exit.
Files will be read/written using gzip if the filename ends with .gz
. 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
Built Distribution
File details
Details for the file marcxml2csv-1.0.0.tar.gz
.
File metadata
- Download URL: marcxml2csv-1.0.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Darwin/21.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38c9e9e244df15079651af87fe4efdb1da3d02ef6a5509143340714248cd255b |
|
MD5 | 62bd165db921af0816391bd1ca01a56e |
|
BLAKE2b-256 | a5a8ffe34401e95c389c8b96d1c33d276238b188eb8d9c47928031d51f39654a |
File details
Details for the file marcxml2csv-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: marcxml2csv-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Darwin/21.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56cf891df3cf81092c94ba85caea2876b0775613faaa96f6f76a5d7ac3f5de14 |
|
MD5 | dd9c138f305cd06c2b9d52eeae36f936 |
|
BLAKE2b-256 | 5b1a64ac5f6a5d6c5e2caf5794b452f5044809ed37b47add95610d9db2fe29cf |