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.

Reconfigure

mp-search config          # Re-open setup wizard
mp-search config --show   # Show current config
mp-search config --reset  # Delete config file

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.3.tar.gz (16.0 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.3-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mp_search-0.1.3.tar.gz
  • Upload date:
  • Size: 16.0 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.3.tar.gz
Algorithm Hash digest
SHA256 baade5383f0c10abb8a6deb96dec4eab2d2de52b8830ec82563f24538793dcbf
MD5 2225088c9c7c0fc988c9b106c1ce84de
BLAKE2b-256 d1a1561b0174770c00e1a320b2fa64071ab5d4d4913750623ef49d2072c040e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for mp_search-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: mp_search-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 17.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 540463ede6709ea12e15b32617eea8b918d767b240dad4b21988468948c0ee30
MD5 6770196cdd4b4aea01383c43ae484f21
BLAKE2b-256 9e36ac7c8a1423560a94d11848fcdad14e1c7e112c6df58067b6eeeb4b9c72c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for mp_search-0.1.3-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