Skip to main content

pyd3js-selection

PyPI version Python versions License CI Security

Python port of d3-selection.

Tracked version: see upstream_lock.json.

What you get

  • 100% upstream export parity for the pinned d3-selection@3.0.0 (see matrix below).
  • 100% Python test coverage for pyd3js_selection.
  • Upstream d3-selection JS tests vendored and passing via a pytest gate (-m upstream).

Install

From PyPI:

pip install pyd3js-selection

For local development (uv workspace):

uv sync --group dev

Usage

import pyd3js_selection as d3

root = d3.create("div")
root.append("span").text("hi")

print(root.node().innerHTML)
<span>hi</span>

Stability & intentional deviations

  • Minimal DOM: this package includes a tiny DOM shim sufficient for upstream d3-selection semantics and tests; it is not a full browser DOM implementation.
  • Callback “this”: D3’s this binding is represented explicitly (callbacks receive this as their first argument).

Compatibility matrix

Pinned upstream inventory: docs/UPSTREAM_API.md.

Legend:

  • [ported]: implemented and covered by ported upstream tests.
  • [missing]: reserved for future upstream drift.

Upstream exports (d3-selection@3.0.0)

  • create — [ported]
  • creator — [ported]
  • local — [ported]
  • matcher — [ported]
  • namespace — [ported]
  • namespaces — [ported]
  • pointer — [ported]
  • pointers — [ported]
  • select — [ported]
  • selectAll — [ported]
  • selection — [ported]
  • selector — [ported]
  • selectorAll — [ported]
  • style — [ported]
  • window — [ported]

Testing

Run the package tests:

uv run pytest packages/pyd3js-selection/package_tests

Coverage (Python)

uv run pytest packages/pyd3js-selection/package_tests --cov=pyd3js_selection --cov-report=term-missing

Upstream d3-selection test suite (vendored)

We vendor the pinned upstream d3-selection repo (including its Mocha test suite) and run it via pytest:

uv run python scripts/vendor_upstream.py
cd packages/pyd3js-selection/upstream/d3-selection && npm install --legacy-peer-deps
uv run pytest -m upstream packages/pyd3js-selection/package_tests

Documentation

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyd3js_selection-0.1.0.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyd3js_selection-0.1.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file pyd3js_selection-0.1.0.tar.gz.

File metadata

  • Download URL: pyd3js_selection-0.1.0.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for pyd3js_selection-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1ded053806e5c9574552ae95edef103b66b4e3144f926486061cc0f5da4dbdcc
MD5 00bfa631abebd03295f6df18c5397d60
BLAKE2b-256 dd9f68fd203748a00c9a426cccd91b506b71090d9f2c5aaced1e260481af653c

See more details on using hashes here.

File details

Details for the file pyd3js_selection-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyd3js_selection-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 561c7d5282abcab286a0a818e6f4bb93dcefb23b1cdb48a42988f9f9bc20a2f3
MD5 83dc8a5d1719f32b022e036fe9d8658d
BLAKE2b-256 dd8a2e6704f4184cd786db47059af618822b8dac4c1aeb72f928590f09a91c5c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page