Elementary is a Swift package that provides information about elements in the Periodic Table.
Uses Periodic-Table-JSON by Bowserinator to generate elements.
Elementary is available through Swift Package Manager. To install it, simply include it in your package dependency list:
dependencies: [
.package(url: "https://github.com/devmaximilian/Elementary.git", from: "1.0.0"),
]
– alternatively using Xcode via File > Swift Packages > Add Package Dependency...
Check the atomic mass of Hydrogen 🔬
/// Get Hydrogen's atomic mass
Elements.hydrogen.mass // -> 1.008
Get all liquid phase elements ⚗️
/// Get all liquid phase elements
Elements.allElements.filter { $0.phase == .liquid } // -> [Element, Element, ...]
- Combine elements to create compounds.
See LICENSE for license details concerning this package. The CC-BY-SA 3.0 license is required by upstream data sources.