A fast, interactive Command-Line Interface (CLI) tool to explore, search, compare, and study chemical elements from the periodic table using a structured JSON database. Perfect for students, teachers, and devs who want a lightweight educational utility.
- π Study an element by Name, Symbol, or Atomic Number
- π§ Browse elements by Group or Period
- βοΈ Compare two elements side-by-side
- π Keyword search across element data
- π² Random element picker and a Daily Pick feature
- β Lightweight JSON database (data/elements.json) for easy extension
chemistry_element_data/
βββ data/
β βββ elements.json # Core JSON database containing element properties
βββ study/
β βββ study_element.py # Individual element lookup logic
β βββ study_group.py # Element lookup by Group
β βββ study_period.py # Element lookup by Period
β βββ study_compare.py # Dual element comparison logic
βββ tools/
β βββ search.py # Keyword search tool
β βββ random_element.py # Random element picker
β βββ daily_element.py # Daily featured element system
β βββ daily_elements.json # Cached daily element state
βββ main.py # Main Interactive CLI Menu (Entry Point)
βββ LICENSE # Project License (MIT)
βββ README.md # Documentation
- Python 3.10 or newer
- Works cross-platform but tested on Debian-based Linux
Clone the repository and run:
git clone https://github.com/siyametj/chemistry_element_data.git
cd chemistry_element_data
python3 -m venv .venv # optional but recommended
source .venv/bin/activate # macOS / Linux
pip install -r requirements.txt Run the interactive CLI:
python3 main.pyTypical menu:
- Study Element (by name / symbol / number)
- Study by Group
- Study by Period
- Compare Two Elements
- Search Elements
- Random Element
- Exit
Example quick lookups (from scripts/tools):
- Study element by symbol (if CLI supports args): python3 main.py --element O
- Pick a random element: python3 tools/random_element.py
- Search keyword: python3 tools/search.py "alkaline"
(If you want CLI arguments support, I can add a small argparse wrapper.)
Elements are stored in data/elements.json as an array of element objects. Each element typically contains fields such as:
{
"name": "Oxygen",
"symbol": "O",
"atomic_number": 8,
"atomic_mass": 15.999,
"group": 16,
"period": 2,
"category": "nonmetal",
"electronegativity": 3.44,
"standard_state": "gas",
"density": 0.001429,
"melting_point": 54.36,
"boiling_point": 90.20,
"discovery_year": 1774,
"summary": "Essential for respiration and combustion"
}Add or extend fields freelyβtools use keys by name so keep them consistent.
- Edit or add entries in data/elements.json.
- Keep keys consistent (name, symbol, atomic_number, group, period, etc.).
- If you add large data, consider adding import scripts to tools/.
Contributions are welcome!
- Fork the repo
- Create a feature branch (feature/your-feature)
- Make your changes and add tests if applicable
- Open a Pull Request describing the change
Please follow these guidelines:
- Keep functions small and documented
- Update README when you add features
- Respect the existing JSON schema or document schema changes
- Add CLI flags for non-interactive usage (e.g.,
--element,--compare a b) - Add unit tests for study and search utilities
- Add fuzzy search and autocomplete
- Provide CSV import/export for elements
- Build a web UI (Flask / FastAPI) for visual browsing
This project is licensed under the MIT License β see the LICENSE file.
Siyam (@siyametj)
GitHub: https://github.com/siyametj
If you found this tool helpful, please star the repo! β