polars-text 0.1.0__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.
Files changed (34) hide show
  1. polars_text-0.1.0/.github/workflows/ci.yml +78 -0
  2. polars_text-0.1.0/.github/workflows/release.yml +154 -0
  3. polars_text-0.1.0/.gitignore +6 -0
  4. polars_text-0.1.0/Cargo.lock +4456 -0
  5. polars_text-0.1.0/Cargo.toml +27 -0
  6. polars_text-0.1.0/Makefile +9 -0
  7. polars_text-0.1.0/PKG-INFO +171 -0
  8. polars_text-0.1.0/PUBLISH.md +404 -0
  9. polars_text-0.1.0/README.md +162 -0
  10. polars_text-0.1.0/polars_text/__init__.py +27 -0
  11. polars_text-0.1.0/polars_text/functions.py +104 -0
  12. polars_text-0.1.0/polars_text/namespace.py +53 -0
  13. polars_text-0.1.0/polars_text/py.typed +0 -0
  14. polars_text-0.1.0/polars_text/token_frequencies.py +202 -0
  15. polars_text-0.1.0/polars_text/topic_modeling.py +41 -0
  16. polars_text-0.1.0/polars_text/utils.py +5 -0
  17. polars_text-0.1.0/pyproject.toml +23 -0
  18. polars_text-0.1.0/pytest.ini +4 -0
  19. polars_text-0.1.0/resources/quote_verb.txt +97 -0
  20. polars_text-0.1.0/src/concordance.rs +185 -0
  21. polars_text-0.1.0/src/expressions.rs +261 -0
  22. polars_text-0.1.0/src/lib.rs +39 -0
  23. polars_text-0.1.0/src/pos_tagging.rs +198 -0
  24. polars_text-0.1.0/src/quotation.rs +630 -0
  25. polars_text-0.1.0/src/token_frequencies.rs +32 -0
  26. polars_text-0.1.0/src/tokenizer.rs +108 -0
  27. polars_text-0.1.0/src/topic_modeling.rs +333 -0
  28. polars_text-0.1.0/tests/test_concordance.py +75 -0
  29. polars_text-0.1.0/tests/test_polars_text_utils.py +29 -0
  30. polars_text-0.1.0/tests/test_quotation.py +105 -0
  31. polars_text-0.1.0/tests/test_token_frequencies.py +37 -0
  32. polars_text-0.1.0/tests/test_tokenize.py +14 -0
  33. polars_text-0.1.0/tests/test_topic_modeling.py +41 -0
  34. polars_text-0.1.0/uv.lock +136 -0
@@ -0,0 +1,78 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - "**"
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ concurrency:
11
+ group: polars-text-ci-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ test:
19
+ name: Test ${{ matrix.name }}
20
+ runs-on: ${{ matrix.os }}
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ include:
25
+ - name: linux-x86_64
26
+ os: ubuntu-latest
27
+ target: x86_64-unknown-linux-gnu
28
+ - name: macos-arm64
29
+ os: macos-14
30
+ target: aarch64-apple-darwin
31
+ - name: windows-x86_64
32
+ os: windows-latest
33
+ target: x86_64-pc-windows-msvc
34
+ python-architecture: x64
35
+
36
+ steps:
37
+ - name: Check out repository
38
+ uses: actions/checkout@v4
39
+
40
+ - name: Set up Python
41
+ uses: actions/setup-python@v5
42
+ with:
43
+ python-version: "3.14"
44
+ architecture: ${{ matrix.python-architecture || 'x64' }}
45
+
46
+ - name: Cache Cargo build artifacts
47
+ uses: Swatinem/rust-cache@v2
48
+
49
+ - name: Cache Hugging Face downloads
50
+ uses: actions/cache@v4
51
+ with:
52
+ path: ~/.cache/huggingface
53
+ key: huggingface-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
54
+ restore-keys: |
55
+ huggingface-${{ runner.os }}-
56
+
57
+ - name: Install Linux build dependencies
58
+ if: runner.os == 'Linux'
59
+ run: |
60
+ sudo apt-get update
61
+ sudo apt-get install -y pkg-config libssl-dev
62
+
63
+ - name: Build wheel
64
+ uses: PyO3/maturin-action@v1
65
+ with:
66
+ target: ${{ matrix.target }}
67
+ container: off
68
+ args: --release --out dist --interpreter 3.14
69
+
70
+ - name: Install test dependencies
71
+ shell: bash
72
+ run: |
73
+ python -m pip install --upgrade pip pytest
74
+ python -m pip install --force-reinstall --find-links dist polars-text
75
+
76
+ - name: Run pytest
77
+ shell: bash
78
+ run: pytest -q
@@ -0,0 +1,154 @@
1
+ name: Package And Release
2
+
3
+ "on":
4
+ pull_request:
5
+ push:
6
+ tags:
7
+ - "v*"
8
+ workflow_dispatch:
9
+ inputs:
10
+ publish_target:
11
+ description: Optional package index for a manual publish of the selected ref
12
+ type: choice
13
+ required: true
14
+ default: none
15
+ options:
16
+ - none
17
+ - testpypi
18
+
19
+ concurrency:
20
+ group: polars-text-release-${{ github.ref }}
21
+ cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
22
+
23
+ permissions:
24
+ contents: read
25
+
26
+ jobs:
27
+ build_wheels:
28
+ name: Build ${{ matrix.name }} Wheel
29
+ runs-on: ${{ matrix.os }}
30
+ strategy:
31
+ fail-fast: false
32
+ matrix:
33
+ include:
34
+ - name: linux-x86_64
35
+ os: ubuntu-latest
36
+ target: x86_64-unknown-linux-gnu
37
+ manylinux: "2_28"
38
+ before-script-linux: dnf install -y openssl-devel && dnf clean all
39
+ - name: macos-arm64
40
+ os: macos-14
41
+ target: aarch64-apple-darwin
42
+ - name: windows-x86_64
43
+ os: windows-latest
44
+ target: x86_64-pc-windows-msvc
45
+ python-architecture: x64
46
+ steps:
47
+ - name: Check out repository
48
+ uses: actions/checkout@v4
49
+
50
+ - name: Set up Python
51
+ uses: actions/setup-python@v5
52
+ with:
53
+ python-version: "3.14"
54
+ architecture: ${{ matrix.python-architecture || 'x64' }}
55
+
56
+ - name: Build wheel
57
+ uses: PyO3/maturin-action@v1
58
+ with:
59
+ target: ${{ matrix.target }}
60
+ manylinux: ${{ matrix.manylinux || '' }}
61
+ before-script-linux: ${{ matrix.before-script-linux || '' }}
62
+ args: --release --out dist --interpreter 3.14 --compatibility pypi
63
+
64
+ - name: Verify wheel metadata
65
+ shell: bash
66
+ run: |
67
+ python -m pip install --upgrade twine
68
+ twine check --strict dist/*
69
+
70
+ - name: Upload wheels
71
+ uses: actions/upload-artifact@v4
72
+ with:
73
+ name: dist-${{ matrix.name }}
74
+ path: dist/*
75
+ if-no-files-found: error
76
+
77
+ build_sdist:
78
+ name: Build Source Distribution
79
+ runs-on: ubuntu-latest
80
+ steps:
81
+ - name: Check out repository
82
+ uses: actions/checkout@v4
83
+
84
+ - name: Set up Python
85
+ uses: actions/setup-python@v5
86
+ with:
87
+ python-version: "3.14"
88
+
89
+ - name: Build source distribution
90
+ uses: PyO3/maturin-action@v1
91
+ with:
92
+ command: sdist
93
+ args: --out dist
94
+
95
+ - name: Verify source distribution metadata
96
+ shell: bash
97
+ run: |
98
+ python -m pip install --upgrade twine
99
+ twine check --strict dist/*
100
+
101
+ - name: Upload source distribution
102
+ uses: actions/upload-artifact@v4
103
+ with:
104
+ name: dist-sdist
105
+ path: dist/*
106
+ if-no-files-found: error
107
+
108
+ publish_testpypi:
109
+ name: Publish To TestPyPI
110
+ needs:
111
+ - build_wheels
112
+ - build_sdist
113
+ if: github.event_name == 'workflow_dispatch' && inputs.publish_target == 'testpypi'
114
+ runs-on: ubuntu-latest
115
+ permissions:
116
+ contents: read
117
+ id-token: write
118
+ steps:
119
+ - name: Download built distributions
120
+ uses: actions/download-artifact@v4
121
+ with:
122
+ pattern: dist-*
123
+ path: dist
124
+ merge-multiple: true
125
+
126
+ - name: Publish package distributions to TestPyPI
127
+ uses: pypa/gh-action-pypi-publish@release/v1
128
+ with:
129
+ repository-url: https://test.pypi.org/legacy/
130
+ packages-dir: dist
131
+ skip-existing: true
132
+
133
+ publish_pypi:
134
+ name: Publish To PyPI
135
+ needs:
136
+ - build_wheels
137
+ - build_sdist
138
+ if: startsWith(github.ref, 'refs/tags/v')
139
+ runs-on: ubuntu-latest
140
+ permissions:
141
+ contents: read
142
+ id-token: write
143
+ steps:
144
+ - name: Download built distributions
145
+ uses: actions/download-artifact@v4
146
+ with:
147
+ pattern: dist-*
148
+ path: dist
149
+ merge-multiple: true
150
+
151
+ - name: Publish package distributions to PyPI
152
+ uses: pypa/gh-action-pypi-publish@release/v1
153
+ with:
154
+ packages-dir: dist
@@ -0,0 +1,6 @@
1
+ target/
2
+ __pycache__/
3
+ *.egg-info/
4
+ *.so
5
+ *.dylib
6
+ *.pyd