switchcat / periodic

元素周期表工具类

v1.0.2 2020-11-13 15:49 UTC

This package is auto-updated.

Last update: 2024-09-14 03:10:41 UTC


README

Twitter Follow Issues GitHub All Releases License: MIT Codacy Badge


SwitchCat/periodic

目录

入门

要获取本地副本并运行,请按照以下简单步骤进行。

先决条件

依赖项

安装

使用项目文件夹根目录下的 composer 下载库。

composer require switchcat/periodic

用法

所有方法返回一个包含元素数据的数组,或者包含元素数据的元素数组。

  • 创建 periodic 对象
$Periodic = new \SwitchCat\Periodic\Periodic();
  • 从元素周期表中获取所有元素
$Periodic->getAll();
  • 按名称获取元素
$Periodic->getElementByName(string $name);
  • 按符号获取元素
$Periodic->getElementBySymbol(string $name);
  • 按编号获取元素
$Periodic->getElementByNumber(int $number);
  • 按类别获取元素
$Periodic->getElementsByCategory(string $category);
  • 按原子质量范围获取元素集合
$Periodic->getElementsByAtomicMass(float $min, float $max);
  • 按相态获取元素
$Periodic->getElementsByPhase(string $phase);
  • 按熔点范围获取元素集合
$Periodic->getElementsByMeltingPoint(float $min, float $max);
  • 按沸点范围获取元素集合
$Periodic->getElementsByBoilingPoint(float $min, float $max);
  • 按密度范围获取元素集合
$Periodic->getElementsByDensity(float $min, float $max);

贡献

贡献使开源社区成为一个如此美妙的学习、灵感和创造的地方。您所做出的任何贡献都将受到极大的赞赏。

  1. 分支项目
  2. 创建您的特性分支(git checkout -b feature/AmazingFeature
  3. 提交您的更改(git commit -m 'Add some AmazingFeature'
  4. 推送到分支(git push origin feature/AmazingFeature
  5. 发起拉取请求

许可证

基于 MIT 许可证分发。有关更多信息,请参阅 LICENSE 文件。

联系方式

基于 Bowserinator/Periodic-Table-JSON 的作品

Periodic-Table-JSON

整个元素周期表的 json。请随意在您的项目中使用它。

如沸点和熔点等温度以开尔文为单位给出。密度以 g/l 给出气体,以 g/cm³ 给出固体和液体,摩尔热以 (mol*K) 给出。缺失的信息表示为 null。一些元素可能有光谱带的图片链接。

所有元素都有来自维基百科的三个句子摘要。目前颜色标签无用,请使用外观代替。

电子排布 以字符串形式给出,每个轨道之间用空格分隔。电子排布语义 也以字符串形式给出,这是电子排布的简写形式。带 * 标记的具有语义电子排布的元素表示电子排布尚未得到确认。电子壳层 以数组形式给出,第一个元素是第一个壳层中的电子数,第二个元素是第二个壳层中的电子数,依此类推。

离子化能和第一次电子亲和力都以移除阴离子中电子所需的能量给出。

每个元素下都提供了信息来源的链接,键为 "source"。

以下是如何格式化的示例

{
	"elements" : [{
		"name": "Hydrogen",
		"symbol": "H",
		"number": 1,
		"period": 1,
		"category": "diatomic nonmetal ",
		"atomic_mass": 1.008,
		"color": null,
		"appearance": "colorless gas",
		"phase": "Gas",
		"melt": 13.99,
		"boil": 20.271,
		"density": 0.08988,
		"discovered_by": "Henry Cavendish",
		"molar_heat": 28.836,
		"source":"https://en.wikipedia.org/wiki/Hydrogen",
		"named_by": "Antoine Lavoisier",
		"spectral_img": "https://en.wikipedia.org/wiki/File:Hydrogen_Spectra.jpg",
		"summary": "Hydrogen is a chemical element with chemical symbol H and atomic number 1. With an atomic weight of 1.00794 u, hydrogen is the lightest element on the periodic table. Its monatomic form (H) is the most abundant chemical substance in the Universe, constituting roughly 75% of all baryonic mass.",
		"ypos": 1,
		"xpos": 1,
		"shells": [
			1
		],
		"electron_configuration": "1s1",
		"electron_configuration_semantic": "1s1", 
		"electron_affinity": 72.769,
		"electronegativity_pauling": 2.20,
		"ionization_energies": [
			1312.0
		],
		"cpk-hex": "ffffff"
	}]
}