Skip to main content

MacroMolecular DataFrames (mmdf)

License PyPI Python Version CI codecov

MacroMolecular DataFrames (mmdf) is a small package for reading and writing macromolecular structure files (.pdb/.mmCIF) using pandas dataframes.

The heavy lifting of reading structure files is performed by gemmi.

Usage

import mmdf

# Read a PDBx/mmCIF file into a dataframe
df = mmdf.read('4v6x.cif')
df.head()
Out[3]: 
  model chain residue  residue_id  ...       z charge occupancy  b_isotropic
0     1    Az     ASN           3  ... -54.829      0       1.0         10.0
1     1    Az     ASN           3  ... -54.691      0       1.0         10.0
2     1    Az     ASN           3  ... -53.642      0       1.0         10.0
3     1    Az     ASN           3  ... -53.007      0       1.0         10.0
4     1    Az     ASN           3  ... -54.239      0       1.0         10.0
[5 rows x 13 columns]

# Other dataframe manipulation...

# Write dataframe to a PDBx/mmCIF file
mmdf.write('4v6x_new.cif', df)

You can also fetch structures by their PDB ID, they will be cached in your home directory.

import mmdf

df = mmdf.read("pdb:1crn")

Changelog

v0.0.4 (05/12/25)

  • add pdb download functionality

v0.0.3 (12/12/24)

  • added basic write functionality
  • resolved gemmi 0.7.0 incompatibility issues

v0.0.2 (20/01/24)

  • added atomic properties to dataframe output
  • added support for Path arguments in mmdf.read()
  • moved to pyproject.toml based packaging

v0.0.1

  • first release

Metadata

Release files for mmdf 0.0.5

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

Source distribution (sdist)

Source distribution for mmdf 0.0.5
File Size Uploaded
mmdf-0.0.5.tar.gz 5.7 MB Details

Built distribution (wheel)

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

Total release size: 5.7 MB

Release files / mmdf-0.0.5.tar.gz

Download URL mmdf-0.0.5.tar.gz
Size 5.7 MB
Tags Source
SHA-256 checksum
How to use checksums
af2c12bc22d1a5d0f36cfb1823209d61aa0813e2bd1f545554869e8139277b6a
BLAKE2b-256 checksum
How to use checksums
b14cee31a4f8404347990d91090c327667ff43e439f4f1648e061236aba27eaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Dec 6, 2025.

Transparency log

Release files / mmdf-0.0.5-py3-none-any.whl

Download URL mmdf-0.0.5-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6164718171ee9789dea17818ff82a6b901a891b5b001ecba58adb669f3add645
BLAKE2b-256 checksum
How to use checksums
d78b9d613d2ed8056f1e179fd0a897797338a726b8a583cdcf5559694777f6db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Dec 6, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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