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
Metadata
Release files for mp-search 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mp_search-0.1.3.tar.gz | 16.0 kB | With provenance | Details for mp_search-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mp_search-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for mp_search-0.1.3-py3-none-any.whl |
Total release size: 33.8 kB
Release files / mp_search-0.1.3.tar.gz
| Download URL | mp_search-0.1.3.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
baade5383f0c10abb8a6deb96dec4eab2d2de52b8830ec82563f24538793dcbf
|
|
BLAKE2b-256 checksum How to use checksums |
d1a1561b0174770c00e1a320b2fa64071ab5d4d4913750623ef49d2072c040e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 22, 2026.
Transparency logRelease files / mp_search-0.1.3-py3-none-any.whl
| Download URL | mp_search-0.1.3-py3-none-any.whl |
|---|---|
| Size | 17.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
540463ede6709ea12e15b32617eea8b918d767b240dad4b21988468948c0ee30
|
|
BLAKE2b-256 checksum How to use checksums |
9e36ac7c8a1423560a94d11848fcdad14e1c7e112c6df58067b6eeeb4b9c72c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 22, 2026.
Transparency logSecurity for mp-search 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mp_search-0.1.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.