MacroMolecular DataFrames (mmdf)
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
Patharguments inmmdf.read() - moved to
pyproject.tomlbased 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)
| File | Size | Uploaded | |
|---|---|---|---|
| mmdf-0.0.5.tar.gz | 5.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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