Terminal UI tool for searching materials from the Materials Project database
Project description
MP Search
A terminal-based UI tool for searching materials from the Materials Project database. Built with Textual.
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
- Internationalization — Chinese and English UI (configurable via
.env) - Fast REST API — Directly calls the Materials Project REST API with
requests, avoiding compatibility issues withmp-api
Preview
Quick Start
1. Get an API Key
Sign up at Materials Project and get your API key.
2. Install
git clone https://github.com/sylearn/mp-search.git
cd mp-search
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
3. Configure
cp .env.example .env
Edit .env and set your API key:
MP_API_KEY="your_api_key_here"
4. Run
mp-search
Configuration
| Variable | Description | Default |
|---|---|---|
MP_API_KEY |
Required. Materials Project API key | — |
MP_EXPORT_DIR |
Export directory path | ./result/mp_search |
MP_SEARCH_LANG |
UI language: zh or en |
zh |
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 # Package configuration
├── .env.example # Environment template
├── LICENSE
├── README.md # English docs
├── README_zh.md # Chinese docs
└── mp_search/ # Python package
├── __main__.py # CLI entry point
├── config.py # Configuration loader
├── i18n.py # Internationalization
├── api/
│ └── client.py # Materials Project REST API client
├── export/
│ └── writer.py # POSCAR / CIF / JSON export
└── tui/
├── app.py # Main TUI application
└── detail.py # Material detail modal
Development
pip install -e .
# Changes take effect immediately — just rerun
mp-search
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
mp_search-0.1.0.tar.gz
(14.0 kB
view details)
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
mp_search-0.1.0-py3-none-any.whl
(15.1 kB
view details)
File details
Details for the file mp_search-0.1.0.tar.gz.
File metadata
- Download URL: mp_search-0.1.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dffafd4aa16cec7f35c17266e41c5bc914fb4ee2c15f962b8bd38b2c583ee4ae
|
|
| MD5 |
ae83f18e8c96e15266abff4ba01793c7
|
|
| BLAKE2b-256 |
8fe84329dceb4da6f715485938e8dfe3e7fda9d0a752362ff6b0d0e887f8574b
|
File details
Details for the file mp_search-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mp_search-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2f410c250fa3c7f121ed9a2c4dae1bff404dbc3e274feafca4d3c922cc1acfa
|
|
| MD5 |
29b2a4c84259a4c51c08c6720ac33fe2
|
|
| BLAKE2b-256 |
9cbf2f3937b3226ee147e42c5391dab7d448648413f7c126bbcc47684997b35a
|