dse_polars
Work with DSE triples in a polars dataframe
Publishing for marimo HTML-WASM
This package ships as a pure-Python wheel (py3-none-any), so it can be installed in
Pyodide-based marimo HTML-WASM notebooks as long as runtime package constraints are compatible.
Key compatibility choices in this project:
Requires-Python: >=3.13,<3.14polars>=1.18.0
Build and publish:
python -m pip install -U build twine
python -m build
python -m twine check dist/*
python -m twine upload --repository testpypi dist/*
python -m twine upload dist/*
You can sanity-check that the wheel is pure Python by inspecting the wheel metadata:
unzip -p dist/*.whl '*.dist-info/WHEEL'
and confirming it includes:
Tag: py3-none-any
ctsurn_contains usage
ctsurn_contains returns a Polars expression, so you can use it directly in filter/select.
import polars as pl
from dse_polars.texts import ctsurn_contains
df = pl.DataFrame(
{
"urn": [
"urn:cts:compnov:bible.genesis.sept_latin:1.1",
"urn:cts:compnov:bible.genesis.sept_latin:2.1",
"urn:cts:compnov:bible.exodus.sept_latin:1.1",
]
}
)
query = "urn:cts:compnov:bible.genesis:1"
matches = df.filter(ctsurn_contains(pl.col("urn"), query))
print(matches)
# quick boolean check with literals
is_contained = pl.select(
ctsurn_contains(
"urn:cts:compnov:bible.genesis.sept_latin:1.1",
"urn:cts:compnov:bible.genesis:1",
).alias("ok")
).item(0, 0)
print(is_contained) # True
ptinrect usage
ptinrect returns a Polars expression, so you can use it directly in filter/select.
import polars as pl
from dse_polars.images import ptinrect
rects = pl.DataFrame(
{
"label": ["A", "B"],
"x": [10.0, 100.0],
"y": [20.0, 200.0],
"w": [30.0, 20.0],
"h": [40.0, 20.0],
}
)
# filter rectangles containing a literal point (25, 35)
hits = rects.filter(ptinrect(25.0, 35.0))
print(hits)
# use point columns too
points = pl.DataFrame({"px": [25.0, 130.0], "py": [35.0, 210.0]})
checks = rects.with_columns(points).select(
pl.col("label"),
ptinrect(pl.col("px"), pl.col("py")).alias("contains_point"),
)
print(checks)
textcontents usage
textcontents returns a Python list of values in the text column, excluding nulls.
import polars as pl
from dse_polars.texts import textcontents
df = pl.DataFrame(
{
"urn": ["u1", "u2", "u3", "u4"],
"text": ["alpha", None, "beta", "alpha"],
}
)
contents = textcontents(df)
print(contents) # ['alpha', 'beta', 'alpha']
Release files for dse-polars 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dse_polars-0.6.1.tar.gz | 8.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dse_polars-0.6.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.4 MB
Release files / dse_polars-0.6.1.tar.gz
| Download URL | dse_polars-0.6.1.tar.gz |
|---|---|
| Size | 8.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
661f1b5d6fdb565f4ac012c900d73182bb9fa01db29a55fc0fddfa693efff7c3
|
|
BLAKE2b-256 checksum How to use checksums |
a7ec9b700073b12598ad94a807fe3ec944914617ad74b8c4eddbd99cb0cf5663
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 5, 2026.
Transparency logRelease files / dse_polars-0.6.1-py3-none-any.whl
| Download URL | dse_polars-0.6.1-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
01983dd5222fbc2c2e9216d83e00eb2b4fbdc91c08e172d77f71f3fa44c5013d
|
|
BLAKE2b-256 checksum How to use checksums |
9fac7c5fbc145e2cf8b72c8c835e2070a6b824a03f2c6304415901a598bd1fd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 5, 2026.
Transparency log