--- id: pymarc version: "5.4.0" license: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above… (full text in the JSON record) license_treatment: unclear maintenance: active --- # pymarc — Read, write and modify MARC bibliographic data License: unclear · Maintenance: active · Downloads: 93.8K/mo ## What it is and what it does pymarc is a Python library for working with MARC21 records—the standard bibliographic data format used by libraries worldwide. It provides an API to read MARC binary files, extract fields and subfields, create new records, and serialize to JSON or XML formats. The library was originally designed as an escape route for extracting data out of MARC into more modern representations, but has evolved to support full record creation and modification as MARC remains in widespread use despite decades of calls for its replacement. The package exposes MARC records as Python objects with both convenience properties (like `title`, `author`, `isbn`) and direct field access via numeric tags and subfield codes. It handles the complexity of MARC's hierarchical structure—fields contain indicators and subfields—and supports batch processing through iterators. As of version 5.0.0, subfields are represented as named tuples rather than flat string lists, with a conversion utility for legacy code. Use it for: - Extract titles, authors, and ISBNs from a batch of MARC records for import into a database or search index. - Convert MARC binary files to JSON or XML for distribution to systems that cannot parse MARC natively. - Migrate bibliographic data out of legacy library systems by reading MARC dumps and transforming them into modern formats. - Create or update MARC records programmatically when integrating with library management systems. - Process subject headings and other repeating fields from MARC records for analysis or enrichment. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. pymarc reads, writes, and modifies MARC21 bibliographic records, the standard format used by libraries to encode catalog metadata. Yes. pymarc is actively maintained, has no dependencies, installs easily, and is the standard tool for MARC processing in Python. Install it if you work with library data, need to migrate MARC records, or integrate with library systems. The license is permissive. No known security vulnerabilities. ## Install pip install pymarc uv add pymarc poetry add pymarc ## Installing pymarc Before you install: Low install friction with no runtime dependencies. Actively maintained as of 43 days ago with support for current Python versions (requires Python 3.10+). License in practice: License text indicates a BSD-style permissive license (unclear SPDX classification in metadata), allowing use in most projects with attribution and liability disclaimer. Quickstart: from pymarc import MARCReader with open('records.dat', 'rb') as fh: reader = MARCReader(fh) for record in reader: print(record.title) Requires Python 3.10 or later. MARC data must be in binary MARC21 format (typically .dat or .mrc files). Verify before relying: - Whether the package is suitable for production use in large-scale library systems or primarily for data migration tasks. - Performance characteristics when processing very large MARC record batches. ## Package facts - License: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above… (full text in the JSON record) (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 93.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags MARC record processing, bibliographic data library, MARC21 parser, library catalog data, MARC reader writer, bibliographic metadata, MARC field extraction, library-data, bibliographic-metadata [View on SkillFed](https://skillfed.io/packages/pymarc) · [View on PyPI](https://pypi.org/project/pymarc/)