innertext 0.2.2__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -115,7 +115,7 @@ dependencies = [
115
115
 
116
116
  [[package]]
117
117
  name = "innertext-core"
118
- version = "0.2.2"
118
+ version = "0.2.3"
119
119
  dependencies = [
120
120
  "html5ever",
121
121
  "markup5ever",
@@ -128,7 +128,7 @@ dependencies = [
128
128
 
129
129
  [[package]]
130
130
  name = "innertext-java"
131
- version = "0.2.2"
131
+ version = "0.2.3"
132
132
  dependencies = [
133
133
  "innertext-core",
134
134
  "jni",
@@ -137,7 +137,7 @@ dependencies = [
137
137
 
138
138
  [[package]]
139
139
  name = "innertext-node"
140
- version = "0.2.2"
140
+ version = "0.2.3"
141
141
  dependencies = [
142
142
  "innertext-core",
143
143
  "napi",
@@ -146,7 +146,7 @@ dependencies = [
146
146
 
147
147
  [[package]]
148
148
  name = "innertext-python"
149
- version = "0.2.2"
149
+ version = "0.2.3"
150
150
  dependencies = [
151
151
  "innertext-core",
152
152
  "pyo3",
@@ -6,7 +6,7 @@ members = ["crates/innertext-core", "bindings/innertext-python"]
6
6
  resolver = "2"
7
7
 
8
8
  [workspace.package]
9
- version = "0.2.2"
9
+ version = "0.2.3"
10
10
  edition = "2021"
11
11
  license = "MIT"
12
12
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: innertext
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: Developers
@@ -55,6 +55,26 @@ print(innertext.inner_text(html)) # "Hello World"
55
55
  print(innertext.text_content(html)) # "Hello hidden console.log("not shown")"
56
56
  ```
57
57
 
58
+ ## Packaging Notes
59
+
60
+ The published Python package uses a two-layer layout:
61
+ - `innertext` is a regular Python package with a runtime `__init__.py`
62
+ - the compiled Rust extension is loaded as `innertext._innertext`
63
+
64
+ This avoids namespace-package import issues and ensures `import innertext`
65
+ always exposes `inner_text`, `outer_text`, and `text_content`.
66
+
67
+ ## Type Hints
68
+
69
+ This package ships with PEP 561-compatible typing metadata:
70
+ - `innertext/__init__.pyi` defines the public API types
71
+ - `innertext/py.typed` marks the package as typed
72
+
73
+ Type checkers such as mypy and pyright can therefore infer:
74
+ - `inner_text(html: str) -> str`
75
+ - `outer_text(html: str) -> str`
76
+ - `text_content(html: str) -> str`
77
+
58
78
  ## API
59
79
 
60
80
  ### Functions
@@ -27,6 +27,26 @@ print(innertext.inner_text(html)) # "Hello World"
27
27
  print(innertext.text_content(html)) # "Hello hidden console.log("not shown")"
28
28
  ```
29
29
 
30
+ ## Packaging Notes
31
+
32
+ The published Python package uses a two-layer layout:
33
+ - `innertext` is a regular Python package with a runtime `__init__.py`
34
+ - the compiled Rust extension is loaded as `innertext._innertext`
35
+
36
+ This avoids namespace-package import issues and ensures `import innertext`
37
+ always exposes `inner_text`, `outer_text`, and `text_content`.
38
+
39
+ ## Type Hints
40
+
41
+ This package ships with PEP 561-compatible typing metadata:
42
+ - `innertext/__init__.pyi` defines the public API types
43
+ - `innertext/py.typed` marks the package as typed
44
+
45
+ Type checkers such as mypy and pyright can therefore infer:
46
+ - `inner_text(html: str) -> str`
47
+ - `outer_text(html: str) -> str`
48
+ - `text_content(html: str) -> str`
49
+
30
50
  ## API
31
51
 
32
52
  ### Functions
@@ -27,6 +27,26 @@ print(innertext.inner_text(html)) # "Hello World"
27
27
  print(innertext.text_content(html)) # "Hello hidden console.log("not shown")"
28
28
  ```
29
29
 
30
+ ## Packaging Notes
31
+
32
+ The published Python package uses a two-layer layout:
33
+ - `innertext` is a regular Python package with a runtime `__init__.py`
34
+ - the compiled Rust extension is loaded as `innertext._innertext`
35
+
36
+ This avoids namespace-package import issues and ensures `import innertext`
37
+ always exposes `inner_text`, `outer_text`, and `text_content`.
38
+
39
+ ## Type Hints
40
+
41
+ This package ships with PEP 561-compatible typing metadata:
42
+ - `innertext/__init__.pyi` defines the public API types
43
+ - `innertext/py.typed` marks the package as typed
44
+
45
+ Type checkers such as mypy and pyright can therefore infer:
46
+ - `inner_text(html: str) -> str`
47
+ - `outer_text(html: str) -> str`
48
+ - `text_content(html: str) -> str`
49
+
30
50
  ## API
31
51
 
32
52
  ### Functions
@@ -29,7 +29,7 @@ fn text_content(html: &str) -> Result<String, PyErr> {
29
29
  }
30
30
 
31
31
  #[pymodule]
32
- fn innertext(m: &Bound<'_, PyModule>) -> PyResult<()> {
32
+ fn _innertext(m: &Bound<'_, PyModule>) -> PyResult<()> {
33
33
  m.add_function(wrap_pyfunction!(inner_text, m)?)?;
34
34
  m.add_function(wrap_pyfunction!(outer_text, m)?)?;
35
35
  m.add_function(wrap_pyfunction!(text_content, m)?)?;
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "innertext"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "Pure Rust WHATWG-compliant innerText, outerText, and textContent extraction"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -38,5 +38,6 @@ Homepage = "https://github.com/joshfayer/innertext"
38
38
 
39
39
  [tool.maturin]
40
40
  features = ["pyo3/extension-module", "pyo3/abi3-py37"]
41
+ module-name = "innertext._innertext"
41
42
  manifest-path = "bindings/innertext-python/Cargo.toml"
42
43
  python-source = "python"
@@ -0,0 +1,8 @@
1
+ """innertext - Pure Rust WHATWG-compliant text extraction from HTML.
2
+
3
+ This package re-exports functions from the compiled Rust extension.
4
+ """
5
+
6
+ from ._innertext import inner_text, outer_text, text_content
7
+
8
+ __all__ = ["inner_text", "outer_text", "text_content"]
File without changes