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

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.1.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.1-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mp_search-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 8394429dad364ca6000405b588e03ec6473433652f231cf78f97bd0fdbea4325
MD5 2084bb263a8f1bc664279033c6748aff
BLAKE2b-256 6358be2bdfa6141a14e67dc22110616d02975a039316a6f1474bab174305656a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mp_search-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 15b5df5c444f9129e84f838bf0237cc5c866f3f0c6f55011e78180ea7998c8bc
MD5 70dbe718b3f967615d59e01257725d30
BLAKE2b-256 dfedcc944dd7cb8295677ab4859c9a115d8836acbd06db56e743e86df297639c

See more details on using hashes here.

Provenance

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