Metadata-Version: 2.4
Name: marctable
Version: 0.5.0
Summary: Convert MARC to CSV and Parquet
Project-URL: Homepage, https://github.com/sul-dlss-labs/marctable
Author-email: Ed Summers <ehs@pobox.com>
License:                                  Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
        
           1. Definitions.
        
              "License" shall mean the terms and conditions for use, reproduction,
              and distribution as defined by Sections 1 through 9 of this document.
        
              "Licensor" shall mean the copyright owner or entity authorized by
              the copyright owner that is granting the License.
        
              "Legal Entity" shall mean the union of the acting entity and all
              other entities that control, are controlled by, or are under common
              control with that entity. For the purposes of this definition,
              "control" means (i) the power, direct or indirect, to cause the
              direction or management of such entity, whether by contract or
              otherwise, or (ii) ownership of fifty percent (50%) or more of the
              outstanding shares, or (iii) beneficial ownership of such entity.
        
              "You" (or "Your") shall mean an individual or Legal Entity
              exercising permissions granted by this License.
        
              "Source" form shall mean the preferred form for making modifications,
              including but not limited to software source code, documentation
              source, and configuration files.
        
              "Object" form shall mean any form resulting from mechanical
              transformation or translation of a Source form, including but
              not limited to compiled object code, generated documentation,
              and conversions to other media types.
        
              "Work" shall mean the work of authorship, whether in Source or
              Object form, made available under the License, as indicated by a
              copyright notice that is included in or attached to the work
              (an example is provided in the Appendix below).
        
              "Derivative Works" shall mean any work, whether in Source or Object
              form, that is based on (or derived from) the Work and for which the
              editorial revisions, annotations, elaborations, or other modifications
              represent, as a whole, an original work of authorship. For the purposes
              of this License, Derivative Works shall not include works that remain
              separable from, or merely link (or bind by name) to the interfaces of,
              the Work and Derivative Works thereof.
        
              "Contribution" shall mean any work of authorship, including
              the original version of the Work and any modifications or additions
              to that Work or Derivative Works thereof, that is intentionally
              submitted to Licensor for inclusion in the Work by the copyright owner
              or by an individual or Legal Entity authorized to submit on behalf of
              the copyright owner. For the purposes of this definition, "submitted"
              means any form of electronic, verbal, or written communication sent
              to the Licensor or its representatives, including but not limited to
              communication on electronic mailing lists, source code control systems,
              and issue tracking systems that are managed by, or on behalf of, the
              Licensor for the purpose of discussing and improving the Work, but
              excluding communication that is conspicuously marked or otherwise
              designated in writing by the copyright owner as "Not a Contribution."
        
              "Contributor" shall mean Licensor and any individual or Legal Entity
              on behalf of whom a Contribution has been received by Licensor and
              subsequently incorporated within the Work.
        
           2. Grant of Copyright License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              copyright license to reproduce, prepare Derivative Works of,
              publicly display, publicly perform, sublicense, and distribute the
              Work and such Derivative Works in Source or Object form.
        
           3. Grant of Patent License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              (except as stated in this section) patent license to make, have made,
              use, offer to sell, sell, import, and otherwise transfer the Work,
              where such license applies only to those patent claims licensable
              by such Contributor that are necessarily infringed by their
              Contribution(s) alone or by combination of their Contribution(s)
              with the Work to which such Contribution(s) was submitted. If You
              institute patent litigation against any entity (including a
              cross-claim or counterclaim in a lawsuit) alleging that the Work
              or a Contribution incorporated within the Work constitutes direct
              or contributory patent infringement, then any patent licenses
              granted to You under this License for that Work shall terminate
              as of the date such litigation is filed.
        
           4. Redistribution. You may reproduce and distribute copies of the
              Work or Derivative Works thereof in any medium, with or without
              modifications, and in Source or Object form, provided that You
              meet the following conditions:
        
              (a) You must give any other recipients of the Work or
                  Derivative Works a copy of this License; and
        
              (b) You must cause any modified files to carry prominent notices
                  stating that You changed the files; and
        
              (c) You must retain, in the Source form of any Derivative Works
                  that You distribute, all copyright, patent, trademark, and
                  attribution notices from the Source form of the Work,
                  excluding those notices that do not pertain to any part of
                  the Derivative Works; and
        
              (d) If the Work includes a "NOTICE" text file as part of its
                  distribution, then any Derivative Works that You distribute must
                  include a readable copy of the attribution notices contained
                  within such NOTICE file, excluding those notices that do not
                  pertain to any part of the Derivative Works, in at least one
                  of the following places: within a NOTICE text file distributed
                  as part of the Derivative Works; within the Source form or
                  documentation, if provided along with the Derivative Works; or,
                  within a display generated by the Derivative Works, if and
                  wherever such third-party notices normally appear. The contents
                  of the NOTICE file are for informational purposes only and
                  do not modify the License. You may add Your own attribution
                  notices within Derivative Works that You distribute, alongside
                  or as an addendum to the NOTICE text from the Work, provided
                  that such additional attribution notices cannot be construed
                  as modifying the License.
        
              You may add Your own copyright statement to Your modifications and
              may provide additional or different license terms and conditions
              for use, reproduction, or distribution of Your modifications, or
              for any such Derivative Works as a whole, provided Your use,
              reproduction, and distribution of the Work otherwise complies with
              the conditions stated in this License.
        
           5. Submission of Contributions. Unless You explicitly state otherwise,
              any Contribution intentionally submitted for inclusion in the Work
              by You to the Licensor shall be under the terms and conditions of
              this License, without any additional terms or conditions.
              Notwithstanding the above, nothing herein shall supersede or modify
              the terms of any separate license agreement you may have executed
              with Licensor regarding such Contributions.
        
           6. Trademarks. This License does not grant permission to use the trade
              names, trademarks, service marks, or product names of the Licensor,
              except as required for reasonable and customary use in describing the
              origin of the Work and reproducing the content of the NOTICE file.
        
           7. Disclaimer of Warranty. Unless required by applicable law or
              agreed to in writing, Licensor provides the Work (and each
              Contributor provides its Contributions) on an "AS IS" BASIS,
              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
              implied, including, without limitation, any warranties or conditions
              of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
              PARTICULAR PURPOSE. You are solely responsible for determining the
              appropriateness of using or redistributing the Work and assume any
              risks associated with Your exercise of permissions under this License.
        
           8. Limitation of Liability. In no event and under no legal theory,
              whether in tort (including negligence), contract, or otherwise,
              unless required by applicable law (such as deliberate and grossly
              negligent acts) or agreed to in writing, shall any Contributor be
              liable to You for damages, including any direct, indirect, special,
              incidental, or consequential damages of any character arising as a
              result of this License or out of the use or inability to use the
              Work (including but not limited to damages for loss of goodwill,
              work stoppage, computer failure or malfunction, or any and all
              other commercial damages or losses), even if such Contributor
              has been advised of the possibility of such damages.
        
           9. Accepting Warranty or Additional Liability. While redistributing
              the Work or Derivative Works thereof, You may choose to offer,
              and charge a fee for, acceptance of support, warranty, indemnity,
              or other liability obligations and/or rights consistent with this
              License. However, in accepting such obligations, You may act only
              on Your own behalf and on Your sole responsibility, not on behalf
              of any other Contributor, and only if You agree to indemnify,
              defend, and hold each Contributor harmless for any liability
              incurred by, or claims asserted against, such Contributor by reason
              of your accepting any such warranty or additional liability.
        
           END OF TERMS AND CONDITIONS
        
           APPENDIX: How to apply the Apache License to your work.
        
              To apply the Apache License to your work, attach the following
              boilerplate notice, with the fields enclosed by brackets "[]"
              replaced with your own identifying information. (Don't include
              the brackets!)  The text should be enclosed in the appropriate
              comment syntax for the file format. We also recommend that a
              file or class name and description of purpose be included on the
              same "printed page" as the copyright notice for easier
              identification within third-party archives.
        
           Copyright [yyyy] [name of copyright owner]
        
           Licensed under the Apache License, Version 2.0 (the "License");
           you may not use this file except in compliance with the License.
           You may obtain a copy of the License at
        
               http://www.apache.org/licenses/LICENSE-2.0
        
           Unless required by applicable law or agreed to in writing, software
           distributed under the License is distributed on an "AS IS" BASIS,
           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
           See the License for the specific language governing permissions and
           limitations under the License.
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: beautifulsoup4>=4.12.2
Requires-Dist: click>=8.1.7
Requires-Dist: pandas>=2.1.4
Requires-Dist: pyarrow>=14.0.2
Requires-Dist: pymarc>=5.1.0
Requires-Dist: requests>=2.31.0
Description-Content-Type: text/markdown

# marctable

[![Build Status](https://github.com/edsu/marctable/actions/workflows/test.yml/badge.svg)](https://github.com/edsu/marctable/actions/workflows/test.yml)

*marctable* is a Python command line utility that converts MARC bibliographic data (in transmission format or MARCXML) into tabular formats like [CSV] and [Parquet]. It uses the Library of Congress [MARC Bibliographic documentation] expressed as an [Avram] [JSON file] to determine what MARC fields and subfields to include and whether they can repeat or not.

## Install

```
$ pip install marctable
```

or just run it:

```
$ pipx run marctable
```

## Usage

*marctable* provides a subcommand style interface for exporting MARC data.

### CSV

CSV is a commonly used data format. It doesn't represent lists of values with columns very well though. To convert all the MARC fields to CSV:

```
$ marctable csv data.marc data.csv
```

For example, this will generate a CSV with 215 columns, one column for each MARC field. Fields that can repeat will appear as a list:

```csv
F001,F003,F005,F006,F007,F008,F010,F013,F015,F016,F017,F018,F020,F022,F023,F024,F025,F026,F027,F028,F030,F031,F032,F033,F034,F035,F036,F037,F038,F040,F041,F042,F043,F044,F045,F046,F047,F048,F050,F051,F052,F055,F060,F061,F066,F070,F071,F072,F074,F080,F082,F083,F084,F085,F086,F088,F100,F110,F111,F130,F210,F222,F240,F242,F243,F245,F246,F247,F250,F251,F254,F255,F256,F257,F258,F260,F263,F264,F270,F300,F306,F307,F310,F321,F334,F335,F336,F337,F338,F340,F341,F342,F343,F344,F345,F346,F347,F348,F351,F352,F353,F355,F357,F361,F362,F363,F365,F366,F370,F377,F380,F381,F382,F383,F384,F385,F386,F387,F388,F490,F500,F501,F502,F504,F505,F506,F507,F508,F510,F511,F513,F514,F515,F516,F518,F520,F521,F522,F524,F525,F526,F530,F532,F533,F534,F535,F536,F538,F540,F541,F542,F544,F545,F546,F547,F550,F552,F555,F556,F561,F562,F563,F565,F567,F580,F581,F583,F584,F585,F586,F588,F600,F610,F611,F630,F647,F648,F650,F651,F653,F654,F655,F656,F657,F658,F662,F688,F700,F710,F711,F720,F730,F740,F751,F752,F753,F754,F758,F788,F800,F810,F811,F830,F850,F852,F856,F857,F880,F881,F882,F883,F884,F885,F886,F887
00021631 ,DLC,20030624102241.0,,['co |||||||||||'],000110s2000    ohu    f   m        eng  ,   00021631 ,,,,,,['1571170383'],,,,,,,,,,,,,,,,,DLC DLC,,,,,,,,,['TA165'],,,,,,,,,,,,['620.1 13'],,,,,,,,,,,,,,,"Leak testing CD-ROM [computer file] / technical editors, Charles N. Jackson, Jr., Charles N. Sherlock ; editor, Patrick O. Moore.",,,,,,,Computer data and program.,,,"['Columbus, Ohio : American Society for Nondestructive Testing, c2000.']",,,,['1 computer optical disc ; 4 3/4 in.'],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,['Nondestructive testing handbook. Third edition ; v. 1'],['Title from disc label.'],,,,,,,,,,,,,,,['Theory and application of nondestructive tests for characterization and inspection of industrial materials and components.'],"['Quality control engineers, inspectors.']",,,,,,,,,,,"['System requirements for Windows: i486 or Pentium processor-based PC; 8MB RAM on Windows 95 or 98 (16MB recommended); 16MB RAM on Windows NT (24MB recommended); Microsoft Windows 95, 98, or NT 4.0 with Service Pack 3 or later; CD-ROM drive.', 'System requirements for Macintosh: Apple Power Macintosh ; 4.5MB RAM available to Acrobat Reader (6.5 recommended); Apple System Software 7.1.2 or later; 8MB available hard disk space; CD-ROM drive.']",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"['Leak detectors.', 'Gas leakage.']",,,,,,,,,,"['Jackson, Charles N.', 'Sherlock, Charles N.', 'Moore, Patrick O.']",['American Society for Nondestructive Testing.'],,,,,,,,,,,,,,['Nondestructive testing handbook (3rd ed. : Electronic resource) ; v. 1.'],,,,,,,,,,,,
00022451 ,DLC,20101012120708.0,,['co||||'],000114s2000    miu    f   m        eng  ,   00022451 ,,,,,,['0472002759'],,,,,,,,,,,,,,,,,DLC DLC DLC,,,,,,,,,['PR2015'],,,,,,,,,,,,['821 13'],,,,,,"Langland, William, 1330?-1400?",,,,,,,,,"The Piers Plowman electronic archive. Vol. 1, Corpus Christi College, Oxford MS 201 (F) [computer file] / William Langland ; edited by Robert Adams ... [et al.] ; associate editors, M. Gail Duggan and Catherine A Farley.",,,,,,,Computer data and program.,,,"['Ann Arbor : University of Michigan Press, c2000.']",,,,['1 computer optical disc ; 4 3/4 in.'],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,['Title from disc label.'],,,,,,,,,,,,,,,['Early scribal version of the alpha family of B text of Piers Plowman. Includes sixteen passus and contains about 170 lines not shared with the majority of other B manuscripts. Features SGML and HTML versions of text and images.'],['Middle English scholars.'],,,,,,,,,,,"['System requirements for Windows: 80486 PC; 8MB RAM; Windows 3.1 (Windows 95/98/NT for SGML version); Microsoft Internet Explorer 3.0 or Netscape 3.0; CD-ROM drive.', 'System requirements for HTML version for the Macintosh: Macintosh capable of Internet access; Netscape 3.0 or Internet Explorer 3.0; CD-ROM drive.']",,,,,,,,,,,,,,,,,,,,,,,,"['Langland, William, 1330?-1400? Piers Plowman Criticism, Textual.', 'Langland, William, 1330?-1400? Manuscripts.']",,,,,,"['Christian pilgrims and pilgrimages Poetry.', 'Manuscripts, English (Middle)']",,,,,,,,,,"['Adams, Robert, 1946-']",,,,,,,,,,,,,,,,,,,,,,,,,,,
00022452 ,DLC,20040524123949.0,,['co||||'],000119s2000    vau        m f      eng  ,   00022452 ,,,,,,,,,,,,,,,,,,,,,,,DLC DLC,,,,,,,,,['TN153'],,,,,,,,,,,,['553 13'],,,,,,,,,,,,,,,"U.S. Geological Survey mineral databases, MRDS and MAS/MILS [computer file] / [E.J. McFaul ... et al.].",,,,,,,Computer data and program.,,,"['[Reston, Va.] : U.S. Geological Survey, 2000.']",0001,,,['2 computer optical discs ; 4 3/4 in.'],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,['Title from disc label.'],,,,['disc 1. Minerals information for North America -- disc 2. Minerals information for the world exclusive of North America.'],,,,,,,,,,,"['Contains Mineral Resource Data System (MRDS) and Minerals Availability System/Minerals Industry Location System (MAS/MILS) databases. MRDS database features almost 200 data fields describing metallic and nonmetallic mineral resource, deposits, and commodities. MAS/MILS database includes almost 100 data fields describing mines and mineral processing plants.']",['Geologists.'],,,,,,,,,,,"['System requirements: Pentium I or better; Windows 95, 98, or NT; hard drive; CD-ROM drive.']",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"['Mines and mineral resources Databases.', 'Mines and mineral resources Directories.']",,,,,,,,,,"['McFaul, E. J.']",['Geological Survey (U.S.)'],,,,,,,,,,,,,,,,,,,,,,,,,,
00022453 ,DLC,20020304100307.0,,['cj||||'],000119s2000    mau    f   b        eng  ,   00022453 ,,,,,,,,,,,,,,,,,,,,,,,DLC DLC DLC,,,,,,,,,['TK7871.6'],,,,,,,,,,,,['621.382 13'],,,,,,"Kolundžija, Branko M.",,,,,,,,,"WIPL-D [computer file] : electromagnetic modeling of composite metallic and dielectric structures / Branko Kolundzija, Jovan S. Ognjanovic, and Tapan K. Sarkar.",,,,,,,Computer program.,,,"['Boston : Artech House, c2000.']",,,,"[""2 computer disks ; 3 1/2 in. + 1 user's manual.""]",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,['Title from disk label.'],,,,,,,,,,,,,,,"['Provides analysis of metallic and/or dielectric/magnetic structures such as antennas, scatterers, and passive microwave circuits.']",['Engineers.'],,,,,,,,,,,['System requirements: IBM-compatible PC (Pentium preferred); 16MB RAM; Windows 95 or NT; 6MB hard disk space; mouse.'],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"['Antennas (Electronics) Software.', 'Microwave circuits Software.', 'Electromagnetic waves Software.']",,,,,,,,,,"['Ognjanovic, Jovan S.', 'Sarkar, Tapan (Tapan K.)']",,,,,,,,,,,,,,,,,,,,,,,,,,,
00022454 ,DLC,20130524080406.0,,['co||||'],000204s2000    ilu    g   m        grc  ,   00022454 ,,,,,,['0252025857'],,,,,,,,,,,,,,,,,DLC DLC DLC,['grc eng'],,['a-tu--- e-uk-en'],,,,,,['BX370'],,,,,,,,,,,,['264 13'],,,,,,,,,,,,,,,Theodore psalter [computer file] : electronic facsimile / edited by Charles Barber.,,,,,,,Computer data and program.,,,"['Champaign, IL : University of Illinois Press in association with the British Library, c2000.']",,,,['1 computer optical disc ; 4 3/4 in.'],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"['Title from jewel case.', 'Produced from the original text held in the British Library Rare Books collection.']",,,,,,,,,,,,,,,"['Digital version of illuminated liturgical manuscript (BL Add. 19352) from the Byzantine Empire, known as the Theodore psalter; the digital version features full-color magnified views of all pages, searchable text in original Greek and in English translation, and scholarly essays.']",,,,,,,,,,,,"['System requirements for Macintosh: Power Macintosh; 8MB RAM; System 7.0 or higher; CD-ROM drive.', 'System requirements for PC: Pentium PC; 8MB RAM (16MB for Windows NT 4.0); Windows 95 or higher, or Windows NT 4.0 or higher; VGA graphics capability; CD-ROM drive.']",,,,,,,,,,,,,,,,,,,,,,,,,"['Orthodox Eastern Church Liturgy Texts Illustrations.', 'British Library.']",,['Theodore psalter Illustrations.'],,,"['Psalters Illustrations.', 'Manuscripts, Greek Facsimiles.', 'Illumination of books and manuscripts, Byzantine Turkey Istanbul.']",,,,,,,,,,"['Barber, Charles, 1964-']","['University of Illinois (Urbana-Champaign campus). Press.', 'British Library.', 'Orthodox Eastern Church. Psalterion. English & Greek.']",,,"['Theodore psalter.', 'Bible. Psalms. Greek.']",,,,,,,,,,,,,,,,,,,,,,,
00022456 ,DLC,20000228141517.0,,['co||||'],000218s2000    ilu        m        eng  ,   00022456 ,,,,,,['1570737061'],,,,,,,,,,,,,,,,,DLC DLC,,,['n-us---'],,,,,,['KF3775'],,,,,,,,,,,,['344.73 13'],,,,,,"Nichols, Nils, 1956-",,,,,,,,,NEPA casebook [computer file] : a digest of U.S. Supreme Court and Circuit Court cases on the National Environmental Policy Act / by Nils Nichols.,['National Environmental Policy Act casebook'],,['Version 1.0.'],,,,Computer data and program.,,,"['Chicago, IL : ABA Section of Environment, Energy, and Resources, c2000.']",0002,,,['1 computer optical disc ; 4 3/4 in.'],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,['Title from disc label.'],,,,,,,,,,,,,,,['Searchable database of all applicable case law to the National Environmental Protection Act.'],,,,,,,,,,,,['System requirements: IBM PC or Macintosh; 16MB RAM; Windows; Adobe Acrobat; CD-ROM drive.'],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,['Environmental law United States Cases.'],,,,,,,,,,,"['American Bar Association. Section of Environment, Energy, and Resources.']",,,,,,,,,,,,,,,,,,,,,,,,,,
00022457 ,DLC,20070411080441.0,,['co||||'],000218s2000    vau    f   d f      eng  ,   00022457 ,,,,,,['0607942746'],,,,,,,,,,,,,,,,,DLC DLC,,,['n-us---'],,,,,,['QE76'],,,,,,,,,,,,['557.3 13'],,,,,,,,,,,,,,,"Records and history of the United States Geological Survey [electronic resource] / Clifford M. Nelson, editor.",,,,,,,,,,"['[Reston, Va.] : USGS, 2000.']",,,,['1 CD-ROM ; 4 3/4 in.'],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,['Title from disc label.'],,,,,,,,,,,,,,,"['Contains two presentations: Renee M. Jaussaud\'s inventory of the documents accessioned by the end of 1997 into Record Group 57 (Geological Survey), and Mary C. Rabbitt\'s ""The United States Geological Survey 1879-1989,"" which appeared in 1989 as USGS Circular 1050.']",['Historians.'],,,,,,,,,,,"['System requirements for Windows: 486 PC or higher; 32MB RAM; Windows 3.1 or higher; VGA or SVGA color monitor capable of displaying 256 colors; CD-ROM drive.', 'Systems requirements for Macintosh: 68020 or higher processor; 8MB RAM; Apple System Software version 7.0 or later; 13-inch color  monitor capable of displaying 256 colors; CD-ROM drive.']",,,,,,,,,,,,,,,,,,,,,,,,,['Geological Survey (U.S.) History.'],,,,,['Geological surveys United States History.'],,,,,,,,,,"['Nelson, Clifford M.', 'Jaussaud, Renée.', 'Rabbitt, Mary C. United States Geological Survey, 1879-1989.']",,,,,,,,,,,,,,,,,,,,,,,,,,,
00022458 ,DLC,20070410080439.0,,['co||||'],000329s2001    pau    f   m        eng  ,   00022458 ,,,,,,['1582550719'],,,,,,,,,,,,,,,,,DLC DLC DLC,,,,,,,,,['RT41'],,,,,,,,,,,,['610.73 13'],,,,,,,,,,,,,,,Nursing procedures [computer file].,['Subtitle on container: Interactive guide to better clinical skills'],,,,,,Computer data and program.,,,"['Springhouse, Pa. : Springhouse Interactive, c2001.']",,,,"[""1 computer optical disc ; 4 3/4 in. + 1 user's manual.""]",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,['Title from disc label.'],,,,,,,,,,,,,,,"['Provides detailed descriptions of more than 500 nursing procedures. Each entry offers complete instructions, including the necessary equipment, preparation guidelines, implementation steps, special considerations, and documentation. Features video clips.']",,,,,,,,,,,,['System requirements: IBM-compatible PC with 133MHz processor or higher; 32MB RAM or more; Windows 95 or higher; 40MB free hard-disk space; SVGA display (256 colors); CD-ROM drive; mouse.'],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,['Nursing.'],,,,,,,,,,,['Springhouse Interactive (Firm)'],,,,,,,,,,,,,,,,,['Publisher description http://www.loc.gov/catdir/enhancements/fy0711/00022458-d.html'],,,,,,,,,
00022459 ,DLC,20070410080440.0,,['co||||'],000329s2001    pau    f   m        eng  ,   00022459 ,,,,,,['1582550603'],,,,,,,,,,,,,,,,,DLC DLC DLC,,,,,,,,,['RM301'],,,,,,,,,,,,['615 13'],,,,,,,,,,,,,,,Nursing pharmacology made incredibly easy! [computer file].,,,,,,,Computer data and program.,,,"['[Springhouse, Pa.] : Springhouse Interactive, c2001.']",,,,"[""1 computer optical disc ; 4 3/4 in. + 1 player's manual.""]",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,['Title from disc label.'],,,,,,,,,,,,,,,"['1,000 review questions for nursing students and practicing nurses who are seeking advanced certification in nursing pharmacology.']",,,,,,,,,,,,"['System requirements for Pentium: Pentium 166 PC; 32MB RAM; Windows 95 or higher; SVGA monitor capable of displaying 800 x 600 resolution; 25MB free hard disk space; 8X CD-ROM drive; Microsoft-compatible mouse.', 'System requirements for Macintosh: Macintosh; 64MB RAM; System 8.5 or higher; SVGA monitor capable of displaying 800 x 600 resolution; 25MB free hard disk space; 8X CD-ROM drive; mouse.']",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"['Pharmacology.', 'Nursing.']",,,,,,,,,,,['Springhouse Interactive (Firm)'],,,,,,,,,,,,,,,,,['Publisher description http://www.loc.gov/catdir/enhancements/fy0711/00022459-d.html'],,,,,,,,,
```

If you only want specific field and subfields you can pass in one or more rules. This will extract the `245` subfield `a`, the 650 subfields `a` and `v`, and the entirety of the  `500` fields, all as separate columns:

```
$ marctable csv --rule 245a --rule 650av --rule 500 data.marc data.csv 
```

```csv
F245a,F650a,F650v,F500
Leak testing CD-ROM,Gas leakage.,,['Title from disc label.']
The Piers Plowman electronic archive.,"Manuscripts, English (Middle)",['Poetry.'],['Title from disc label.']
"U.S. Geological Survey mineral databases, MRDS and MAS/MILS",Mines and mineral resources,"['Databases.', 'Directories.']",['Title from disc label.']
WIPL-D,Electromagnetic waves,"['Software.', 'Software.', 'Software.']",['Title from disk label.']
Theodore psalter,"Illumination of books and manuscripts, Byzantine","['Illustrations.', 'Facsimiles.']","['Title from jewel case.', 'Produced from the original text held in the British Library Rare Books collection.']"
NEPA casebook,Environmental law,['Cases.'],['Title from disc label.']
Records and history of the United States Geological Survey,Geological surveys,,['Title from disc label.']
Nursing procedures,Nursing.,,['Title from disc label.']
Nursing pharmacology made incredibly easy!,Nursing.,,['Title from disc label.']
```

### Parquet

You can also write the data as a [Parquet] file, which has advantages in that it can represent lists of elements in columns for repeatable fields and subfields, and it works in data analysis environments.

```
$ marctable parquet data.marc data.parquet
```

or with rules:

```
$ marctable parquet --rules 245a --rule 650a data.marc data.parquet
```

### JSONL

And you can write the table as JSON Lines (JSONL), where each line is a distinct JSON object.

```
$ marctable jsonl data.marc data.jsonl
```

## Regenerate Avram Schema

You can also regenerate the [Avram] [JSON file] from the Library of Congress website:

```
$ marctable avram
```

## Develop

To help develop *marctable* you will want to:

```
$ git clone https://github.com/sul-dlss-labs/marctable`
$ cd marctable
$ pip3 install uv
$ uv run pytest
```

And then to build and publish a new version:

```
$ uv build
$ uv publish
```

[MARC Bibliographic documentation]: https://www.loc.gov/marc/bibliographic/
[Avram]: https://format.gbv.de/schema/avram/specification
[JSON file]: https://github.com/edsu/marctable/blob/main/marctable/marc.json
[Parquet]: https://en.wikipedia.org/wiki/Apache_Parquet
[CSV]: https://en.wikipedia.org/wiki/Comma-separated_values
