Terminal UI tool for searching materials from the Materials Project database
Project description
MP Search
A terminal UI tool for searching materials from the Materials Project database. Built with Textual.
Preview
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baade5383f0c10abb8a6deb96dec4eab2d2de52b8830ec82563f24538793dcbf
|
|
| MD5 |
2225088c9c7c0fc988c9b106c1ce84de
|
|
| BLAKE2b-256 |
d1a1561b0174770c00e1a320b2fa64071ab5d4d4913750623ef49d2072c040e5
|
Provenance
The following attestation bundles were made for mp_search-0.1.3.tar.gz:
Publisher:
publish.yml on sylearn/mp-search
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mp_search-0.1.3.tar.gz -
Subject digest:
baade5383f0c10abb8a6deb96dec4eab2d2de52b8830ec82563f24538793dcbf - Sigstore transparency entry: 1155046571
- Sigstore integration time:
-
Permalink:
sylearn/mp-search@f0fe62e4b0e291734666f9c30c21a9cfa6ec357c -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/sylearn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f0fe62e4b0e291734666f9c30c21a9cfa6ec357c -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
540463ede6709ea12e15b32617eea8b918d767b240dad4b21988468948c0ee30
|
|
| MD5 |
6770196cdd4b4aea01383c43ae484f21
|
|
| BLAKE2b-256 |
9e36ac7c8a1423560a94d11848fcdad14e1c7e112c6df58067b6eeeb4b9c72c5
|
Provenance
The following attestation bundles were made for mp_search-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on sylearn/mp-search
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mp_search-0.1.3-py3-none-any.whl -
Subject digest:
540463ede6709ea12e15b32617eea8b918d767b240dad4b21988468948c0ee30 - Sigstore transparency entry: 1155046572
- Sigstore integration time:
-
Permalink:
sylearn/mp-search@f0fe62e4b0e291734666f9c30c21a9cfa6ec357c -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/sylearn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f0fe62e4b0e291734666f9c30c21a9cfa6ec357c -
Trigger Event:
release
-
Statement type: