Skip to main content

METS Reader & Writer

By Artefactual

PyPI version GitHub CI codecov

METSRW is a library to help with parsing and creating METS files. It provides an API, and abstracts away the actual creation of the XML. METSRW was initially created for use in Archivematica and is managed as part of that project.

You are free to copy, modify, and distribute metsrw with attribution under the terms of the AGPL license. See the LICENSE file for details.

Installation & Dependencies

METSRW can be installed with pip.

pip install metsrw

METSRW is tested with the all the supported versions of Python.

Basic Usage

Read a METS file

mets = metsrw.METSDocument.fromfile('path/to/file')  # Reads a file
mets = metsrw.METSDocument.fromstring('<mets document>')  # Parses a string
mets = metsrw.METSDocument.fromtree(lxml.ElementTree)  # Parses an lxml.Element or lxml.ElementTree

Create a new METS file

mets = metsrw.METSDocument()

Contributing

METSRW is in early development and welcomes feedback on the API and overall design! Design goals, use cases, and a proposed API are in the Github wiki

Release files for metsrw 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metsrw 0.7.0
File Size Uploaded
metsrw-0.7.0.tar.gz 121.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for metsrw 0.7.0
File Interpreter ABI Platform
metsrw-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 214.2 kB

Release files / metsrw-0.7.0.tar.gz

Download URL metsrw-0.7.0.tar.gz
Size 121.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5aa79345d01983ab212926247a700977e325fb87e4f47ab659ea61c1275e49fd
BLAKE2b-256 checksum
How to use checksums
c13a8c7cf141a4215bba644b4be4a5f0e5b464d65dbfa1465271cb08a780bfcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.

Transparency log

Release files / metsrw-0.7.0-py3-none-any.whl

Download URL metsrw-0.7.0-py3-none-any.whl
Size 92.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9cde54438a8cacb56bcf6f05b7526eae0f4d175441f0fcaddbfb3b33d6e3acb
BLAKE2b-256 checksum
How to use checksums
bccfd89c851bd05cd5f2b49fea4a6c1a25eae2bf18062708e217f57d0c554963
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.23

2 release files

0.3.22

2 release files

0.3.21

2 release files

0.3.19

2 release files

0.3.18

2 release files

0.3.17

2 release files

0.3.16

2 release files

0.3.14

2 release files

0.3.12

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

1 release file

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page