Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Latest commit

 

History

History
44 lines (28 loc) · 1.07 KB

README.md

File metadata and controls

44 lines (28 loc) · 1.07 KB

Elementary

Elementary is a Swift package that provides information about elements in the Periodic Table.

Uses Periodic-Table-JSON by Bowserinator to generate elements.


Installation

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...

Usage

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, ...]

Planned

  • Combine elements to create compounds.

License

See LICENSE for license details concerning this package. The CC-BY-SA 3.0 license is required by upstream data sources.