Skip to main content

Terminal UI tool for searching materials from the Materials Project database

Project description

MP Search

PyPI version Python 3.10+ License: MIT

中文文档

A terminal UI tool for searching materials from the Materials Project database. Built with Textual.

Preview

Setup Wizard

Main Interface

Search Results

Filters Panel


Features

  • Three search modes — Search by chemical formula, elements, or chemical system
  • Property filters — Filter by band gap, energy above hull, atom count, crystal system, and stability
  • Material detail view — Full properties, lattice parameters, and symmetry info
  • Export — One-click export to POSCAR / CIF / JSON
  • First-run setup wizard — Interactive configuration on first launch, no manual file editing needed
  • Internationalization — Chinese and English UI

Installation

From PyPI (recommended)

pip install mp-search

Or with uv:

# Install as a global tool
uv tool install mp-search

# Or run directly without installing
uvx mp-search

From source

git clone https://github.com/sylearn/mp-search.git
cd mp-search
pip install -e .

Configuration

First launch (recommended)

Simply run mp-search. If no configuration is found, an interactive setup wizard will guide you through entering:

  • API Key — get yours at Materials Project
  • Export directory — where to save POSCAR / CIF / JSON files
  • Language — English or Chinese

Settings are saved to ~/.config/mp-search/config.env.

Manual configuration

You can also set environment variables directly or create a config file:

# Option 1: Shell environment
export MP_API_KEY="your_key_here"

# Option 2: Config file
mkdir -p ~/.config/mp-search
cat > ~/.config/mp-search/config.env << 'EOF'
MP_API_KEY="your_key_here"
MP_EXPORT_DIR="~/mp-search-exports"
MP_SEARCH_LANG="en"
EOF
Variable Description Default
MP_API_KEY Required. Materials Project API key
MP_EXPORT_DIR Export directory path ~/mp-search-exports
MP_SEARCH_LANG UI language: zh or en en

Config lookup order: environment variables → ~/.config/mp-search/config.env.env in current directory.


Usage

mp-search

Keyboard Shortcuts

Key Action
/ Focus search input
f Toggle filter panel
Enter View selected material detail
e Export selected material
Escape Back from detail
q Quit

Project Structure

mp-search/
├── pyproject.toml
├── .env.example
└── mp_search/
    ├── __main__.py      # CLI entry point
    ├── config.py         # Multi-location config loader
    ├── i18n.py           # Internationalization
    ├── api/client.py     # REST API client
    ├── export/writer.py  # POSCAR / CIF / JSON export
    └── tui/
        ├── app.py        # Main TUI
        ├── detail.py     # Detail modal
        └── setup.py      # First-run setup wizard

License

MIT

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

mp_search-0.1.2.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

mp_search-0.1.2-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file mp_search-0.1.2.tar.gz.

File metadata

  • Download URL: mp_search-0.1.2.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mp_search-0.1.2.tar.gz
Algorithm Hash digest
SHA256 873912616ec29293c02eaf1dd21a39ef3479429c10c07d2bfd44a1a6e92665e0
MD5 493355aabf78db6e7eff9d6f119cb5a0
BLAKE2b-256 dfc4c4073bb3eff9a5de61853f4e15f71505e364c9d43d3dbf278fd57988d00e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mp_search-0.1.2.tar.gz:

Publisher: publish.yml on sylearn/mp-search

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mp_search-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mp_search-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mp_search-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7ef0235bbe33c84bce2c65f8405c9183340dcabb563a8de77605d3c8de34af5c
MD5 4c6f83dc6cdf53e3c2bd989338eed441
BLAKE2b-256 012d7ee72222c45ca4f8b7a29c5eab5adb1b6f83893d340ef76cdece85744546

See more details on using hashes here.

Provenance

The following attestation bundles were made for mp_search-0.1.2-py3-none-any.whl:

Publisher: publish.yml on sylearn/mp-search

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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