PHPackages                             switchcat/periodic - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. switchcat/periodic

ActiveLibrary

switchcat/periodic
==================

Periodic table utility class

v1.0.2(5y ago)08MITPHPPHP &gt;=7.4

Since Nov 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/SwitchCat/periodic)[ Packagist](https://packagist.org/packages/switchcat/periodic)[ RSS](/packages/switchcat-periodic/feed)WikiDiscussions main Synced 5d ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

[![Twitter Follow](https://camo.githubusercontent.com/8f03a95e3a1824bccb9b611ed38015dbb2e4437f117150cf02c839bb08a299e5/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f537769746368636174413f7374796c653d736f6369616c)](https://twitter.com/SwitchcatA)[![Issues](https://camo.githubusercontent.com/a49807cd251c2c77d4a18caac568c1dd2f9afe166df78ccc8d8483f126cffc5d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f5377697463684361742f6672616d65776f726b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/SwitchCat/periodic/issues)[![GitHub All Releases](https://camo.githubusercontent.com/c19e9375c308a2c79d135cbc18ce09c247904925054d47f27b0fc38b56a39790/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f5377697463684361742f706572696f6469632f746f74616c3f6c6f676f3d476974487562)](https://camo.githubusercontent.com/c19e9375c308a2c79d135cbc18ce09c247904925054d47f27b0fc38b56a39790/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f5377697463684361742f706572696f6469632f746f74616c3f6c6f676f3d476974487562)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Codacy Badge](https://camo.githubusercontent.com/bafebbd2057b389447c526795fd17f420876831ef2412bac00c8ff702ffed2f5/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3733333765666631653463373439373939343630353532653235646234623036)](https://www.codacy.com/gh/SwitchCat/periodic/dashboard?utm_source=github.com&utm_medium=referral&utm_content=SwitchCat/periodic&utm_campaign=Badge_Grade)[![](https://camo.githubusercontent.com/17c7ac55bf11c605c135598a2da28bf06dee477f3108f6c4ec10cb147cdda8ae/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d537769746368436174266d6573736167653d4672616d65776f726b26636f6c6f723d666637373031267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/17c7ac55bf11c605c135598a2da28bf06dee477f3108f6c4ec10cb147cdda8ae/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d537769746368436174266d6573736167653d4672616d65776f726b26636f6c6f723d666637373031267374796c653d666c61742d737175617265)

SwitchCat/periodic
==================

[](#switchcatperiodic)

Table of Contents
-----------------

[](#table-of-contents)

- [Getting Started](#getting-started)
    - [Prerequisites](#prerequisites)
    - [Dependencies](#dependencies)
    - [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
- [Acknowledgements](#acknowledgements)

Getting Started
---------------

[](#getting-started)

To get a local copy up and running follow these simple steps.

### Prerequisites

[](#prerequisites)

- PHP7.4+
- [Composer](https://getcomposer.org/)

### Dependencies

[](#dependencies)

- [jajo/jsondb](https://packagist.org/packages/jajo/jsondb)
- [hansott/range-regex](https://github.com/hansott/range-regex)

### Installation

[](#installation)

Use composer from the root of your project folder to download the library.

```
composer require switchcat/periodic
```

Usage
-----

[](#usage)

All method return an array containing either the element's data either an array of elements with their data.

- Create the periodic object

```
$Periodic = new \SwitchCat\Periodic\Periodic();
```

- Get all elements from the periodic table

```
$Periodic->getAll();
```

- Get an element by name

```
$Periodic->getElementByName(string $name);
```

- Get an element by symbol

```
$Periodic->getElementBySymbol(string $name);
```

- Get an element by number

```
$Periodic->getElementByNumber(int $number);
```

- Get an element by category

```
$Periodic->getElementsByCategory(string $category);
```

- Get a collection of elements by atomic mass range

```
$Periodic->getElementsByAtomicMass(float $min, float $max);
```

- Get an element by phase

```
$Periodic->getElementsByPhase(string $phase);
```

- Get a collection of elements by melting point range

```
$Periodic->getElementsByMeltingPoint(float $min, float $max);
```

- Get a collection of elements by boiling point range

```
$Periodic->getElementsByBoilingPoint(float $min, float $max);
```

- Get a collection of elements by density range

```
$Periodic->getElementsByDensity(float $min, float $max);
```

Contributing
------------

[](#contributing)

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

License
-------

[](#license)

Distributed under the MIT License. See `LICENSE` for more information.

Contact
-------

[](#contact)

[![](https://camo.githubusercontent.com/c0ad3ece61855ee2ca223a53e4d7c33fbdb386ce98382e8ddd6379f6cbb4c0d7/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d537769746368436174266d6573736167653d4167656e637926636f6c6f723d666637373031267374796c653d666f722d7468652d6261646765)](https://switchcat.agency)

Based on the work of [Bowserinator/Periodic-Table-JSON](https://github.com/Bowserinator/Periodic-Table-JSON)
------------------------------------------------------------------------------------------------------------

[](#based-on-the-work-of-bowserinatorperiodic-table-json)

### Periodic-Table-JSON

[](#periodic-table-json)

A json of the entire periodic table. Feel free to use it in your projects.

Temperatures such as boiling points and melting points are given in degrees kelvin. Densities are given in g/l for gases and g/cm³ for solids and liquids and molar heat in (mol\*K). Information that is missing is represented as null. Some elements may have an image link to their spectral bands.

All elements have a three sentence summary from Wikipedia. Currently the color tag is useless, so please use appearance instead.

**Electron configuration** is given as a string, with each orbital separated by a space. **Electron configuration semantic** is given as a string, this is the short-hand version of the electron configuration. Elements with a semantic electron configuration marked with a "\*" mean that the electron configuration has not yet been confirmed. **Electron shells** are given as an array, the first item is the number of electrons in the first shell, the 2nd item is the number of electrons in the second shell, and so on.

Both **ionization energy** and **first electron affinities** are given as the energy required to *detach* an electron from the anion. Ionization energies are given as an array for successive ionization energy.

A link to the source where the information was from is provided in each element under the key "source".

Here's an example of how it's formatted:

```
{
	"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"
	}]
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2009d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/73464234?v=4)[SwitchCat Agency](/maintainers/switchcat)[@SwitchCat](https://github.com/SwitchCat)

---

Top Contributors

[![SwitchCat](https://avatars.githubusercontent.com/u/73464234?v=4)](https://github.com/SwitchCat "SwitchCat (17 commits)")

---

Tags

boiling-pointsjsonmelting-pointsmendeleievperiodic-tableperiodic-table-of-elementsphpphp74switchcat-frameworkatomicphysicsperiodicchemistrymendeleiev

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/switchcat-periodic/health.svg)

```
[![Health](https://phpackages.com/badges/switchcat-periodic/health.svg)](https://phpackages.com/packages/switchcat-periodic)
```

###  Alternatives

[nette/safe-stream

Nette SafeStream: provides isolation for thread safe manipulation with files via native PHP functions.

1174.9M140](/packages/nette-safe-stream)[pattern-lab/core

The core functionality for Pattern Lab.

421.4M36](/packages/pattern-lab-core)[damianopetrungaro/php-commitizen

Help writing Git commit following conventional commit specs

11981.7k17](/packages/damianopetrungaro-php-commitizen)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
