Skip to main content

A Python client for accessing the Electron Microscopy Data Bank (EMDB)

Project description

EMDB Python Client

A Python client for accessing and interacting with the Electron Microscopy Data Bank (EMDB).
This package provides an easy-to-use interface to query EMDB entries, access metadata, and download associated files.

🚀 Features

  • Retrieve EMDB entries by ID
  • Query metadata such as resolution, sample description, and related PDBs
  • Download associated files (maps, images, metadata)
  • Utility models for plotting and file handling
  • Access to validation analysis and annotation data

📚 Documentation

Full API documentation is available at:
👉 https://emdb.readthedocs.io/en/latest/

🔧 Installation

You can install the EMDB client via pip:

pip install emdb

✨ Quick Start

from emdb.client import EMDB
from emdb.exceptions import EMDBNotFoundError

client = EMDB()

try:
    # Retrieve an entry by ID
    entry = client.get_entry("EMD-8117")
    print(entry.resolution)
    
    # Access cross-reference annotations
    annotations = entry.get_annotations()
    for annotation in annotations:
        print(annotation)
    
    # Access validation data and plot FSC
    validation = entry.get_validation()
    validation.plots.fsc.plot()
    
    # Download all files
    entry.download_all_files(output_dir="/tmp/emd1234/")
    
    # Perform a query to return EMDB entries
    results = client.search("HIV")
    for entry in results:
        print(entry.id, entry.method, entry.resolution)
    
    # Perform a query to return a DataFrame
    table = client.csv_search("HIV")
    print(table)
except EMDBNotFoundError:
    print("Entry not found.")

🛠 Requirements

🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

For detailed contributing guidelines, see CONTRIBUTING.md.

Running Tests

This project uses pytest for testing. To run the tests:

# Install test dependencies
pip install -e ".[test]"

# Run all tests
pytest

# Run with coverage report
pytest --cov=emdb --cov-report=html

# Run specific test file
pytest tests/test_client.py

📄 License

This project is licensed under the Apache License 2.0.

📧 Contact

For questions or feedback, please open an issue on GitHub or contact the maintainers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emdb-0.1.10.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

emdb-0.1.10-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file emdb-0.1.10.tar.gz.

File metadata

  • Download URL: emdb-0.1.10.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for emdb-0.1.10.tar.gz
Algorithm Hash digest
SHA256 c889b886b06011248b2fdfe4765ed7e29fb9bf5ae5cc37e94a6d93dd1d0392dd
MD5 74e4e950631a7565d6c71cd28771c179
BLAKE2b-256 e82731cd84390d59ac349c51d80b7702d3c1c9d90a192801dcd44ec014938dea

See more details on using hashes here.

File details

Details for the file emdb-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: emdb-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for emdb-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 718c26fc409986c59eee8b2dfe5e262df944502675f451a5f8de991e2b9e5241
MD5 c96587c6aa8276a2025b24a6774b9aea
BLAKE2b-256 4534e855a816b478a0c9226721cd8005af04f0a02e404529a1e19a57449b2e15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page