Skip to main content

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

  1. Clone the repo:

    git clone git@github.com:netbek/periodic-table.git
    
  2. Install Mise and add activation to ~/.bashrc, e.g.

    curl -fsSL https://github.com/jdx/mise/releases/download/v2026.7.13/install.sh | sh
    

    See other installation methods.

  3. Trust mise.toml:

    mise trust
    
  4. 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.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netbek-periodic-table 1.0.4
File Size Uploaded Provenance Actions
netbek_periodic_table-1.0.4.tar.gz 20.2 kB Without provenance Details for netbek_periodic_table-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for netbek-periodic-table 1.0.4
File Interpreter ABI Platform Actions
netbek_periodic_table-1.0.4-py3-none-any.whl Python 3 none any Details for netbek_periodic_table-1.0.4-py3-none-any.whl

Total release size: 42.7 kB

Release files / netbek_periodic_table-1.0.4.tar.gz

Download URL netbek_periodic_table-1.0.4.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0ce3ddcda5c2d7c174b4382249e1a617095d4e04afdfb739c8aed38248497865
BLAKE2b-256 checksum
How to use checksums
8c722bf255e6caf0bc5aeebaded05e4b63ed80571dbcb6922f615d3934babec9
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.4-py3-none-any.whl

Download URL netbek_periodic_table-1.0.4-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4bc710a6c1a467e965f185d70d15230832b365e56183630d5573d739dbf2d0a
BLAKE2b-256 checksum
How to use checksums
4e490f3fe5bdbd0d91f985abc661cefe2ab8ec997cd8bd8d9071f00a9243d3b7
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.4

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.

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page