Periodic table
Periodic table with responsive layout.
Demo
netbek.github.io/periodic-table
Integration
Install the packages:
npm install @netbek/periodic-table
pip install netbek-periodic-table
Create a Sass file:
@import 'node_modules/@netbek/periodic-table/src/css/mixins';
// Define vars that should override defaults
$nb-periodic-table-cell-bg: #eee;
$nb-periodic-table-cell-border: #ccc;
// Load default vars
@import 'node_modules/@netbek/periodic-table/src/css/variables';
// Mobile-first layout
@include nb-periodic-table-base;
@include nb-periodic-table-color;
@include nb-periodic-table-size;
// Wide breakpoint layout
@media (min-width: 82em) {
@include nb-periodic-table-color('category');
@include nb-periodic-table-size('wide');
}
Create a Jinja template:
{%- from "nb_pt_legend.jinja2" import nb_pt_legend %}
{%- from "nb_pt_table_18.jinja2" import nb_pt_table_18 %}
<!DOCTYPE html>
<html>
<body>
{{ nb_pt_legend(elements, categories, element_columns) }}
{{ nb_pt_table_18(elements, groups) }}
</body>
</html>
Render the Jinja template:
from jinja2 import ChoiceLoader, Environment, FileSystemLoader, PackageLoader
from netbek.periodic_table import data
env = Environment(
loader=ChoiceLoader(
[
FileSystemLoader("path/to/templates"),
PackageLoader("netbek.periodic_table", "jinja/macros"),
]
),
autoescape=True,
# Required by nb_pt_legend.jinja2
extensions=["jinja2.ext.do"],
)
template = env.get_template("template.jinja2")
html = template.render(
categories=data.categories,
elements=list(data.elements.values()),
groups=data.groups,
element_columns=data.element_columns,
)
Development: Installation
-
Clone the repo:
git clone git@github.com:netbek/periodic-table.git
-
Install Mise and add activation to
~/.bashrc, e.g.curl -fsSL https://github.com/jdx/mise/releases/download/v2026.7.13/install.sh | sh
-
Trust
mise.toml:mise trust -
Create a PyPI API token, and add the token to the system keyring as the password:
keyring set pypi-periodic-table __token__
Development: Usage
Build and publish the JavaScript and Python distribution packages:
make bump-version [major|minor|patch]
git push
make build-and-commit
git push
make create-release
make publish
Feature ideas
- Group and period axes
- Color by group or block; different palettes (mendeleevapp)
Credit
Data from mendeleev (MIT License)
License
Copyright (c) 2016 Hein Bekker. Licensed under the GNU Affero General Public License, version 3.
Metadata
Release files for netbek-periodic-table 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| netbek_periodic_table-1.0.3.tar.gz | 20.2 kB | Without provenance | Details for netbek_periodic_table-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| netbek_periodic_table-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for netbek_periodic_table-1.0.3-py3-none-any.whl |
Total release size: 42.7 kB
Release files / netbek_periodic_table-1.0.3.tar.gz
| Download URL | netbek_periodic_table-1.0.3.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8cc451224f672c3bd7f97163b356936a4908043cebf7743777e978610a243db
|
|
BLAKE2b-256 checksum How to use checksums |
610da513857a3743f75a37dd42adeb9be6cba2a305b95a6c3dc109905e4e4148
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|
Release files / netbek_periodic_table-1.0.3-py3-none-any.whl
| Download URL | netbek_periodic_table-1.0.3-py3-none-any.whl |
|---|---|
| Size | 22.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa0cfcb4d4db18c4ac66ec388566c0980f1ef6f2565d93bacbd71718894a9e04
|
|
BLAKE2b-256 checksum How to use checksums |
04004d0aeac581ffc1de87fb5ef0a45404218c56866529e421103aeffbdf5b7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.11
|
Security for netbek-periodic-table 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.