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

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

Built distribution (wheel)

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

Total release size: 42.7 kB

Release files / netbek_periodic_table-1.0.2.tar.gz

Download URL netbek_periodic_table-1.0.2.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
249e9d300c29416ad0cee3ef5a8352f97ee70a9c65aa1d06055cea44e980b438
BLAKE2b-256 checksum
How to use checksums
10388fd2b6373dd5626da61c4298b5989ecde2019a678710b9a1baa9eef1d562
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.2-py3-none-any.whl

Download URL netbek_periodic_table-1.0.2-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0230352af94a31058413c4e05d79e925313c6192f2a3a0e2fef569d7e39d900
BLAKE2b-256 checksum
How to use checksums
ce4c2421b1042e96a68144fb998992bcef4a24d0e9a1a87d8c1a6cb06c7ba368
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.2

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