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

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.0
File Size Uploaded Provenance Actions
netbek_periodic_table-1.0.0.tar.gz 20.2 kB Without provenance Details for netbek_periodic_table-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 42.7 kB

Release files / netbek_periodic_table-1.0.0.tar.gz

Download URL netbek_periodic_table-1.0.0.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a36b272e2856c25a8da6916f9221e6b9dfbce087ca47145a5b412151f6ac4088
BLAKE2b-256 checksum
How to use checksums
294763e0d79ceb66df2bc881870227f0786247ab2e322a1493e4bc4b84a275ae
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.0-py3-none-any.whl

Download URL netbek_periodic_table-1.0.0-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f4ab2ae24432e69fd8efddc32c692517adfb01dd9b347fefc35629882907223
BLAKE2b-256 checksum
How to use checksums
bcdadaeb4c38edfa2e2a771864efe5b2266fd8ca675f5a249d2c444f4e74fb0b
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.0

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