datar-polars 0.0.1__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 (214) hide show
  1. datar_polars-0.0.1/.github/workflows/ci.yml +54 -0
  2. datar_polars-0.0.1/.github/workflows/docs.yml +30 -0
  3. datar_polars-0.0.1/.gitignore +130 -0
  4. datar_polars-0.0.1/API_AUDIT.md +486 -0
  5. datar_polars-0.0.1/CLAUDE.md +42 -0
  6. datar_polars-0.0.1/PKG-INFO +14 -0
  7. datar_polars-0.0.1/README.md +75 -0
  8. datar_polars-0.0.1/datar_polars/__init__.py +13 -0
  9. datar_polars-0.0.1/datar_polars/api/__init__.py +1 -0
  10. datar_polars-0.0.1/datar_polars/api/base/__init__.py +1 -0
  11. datar_polars-0.0.1/datar_polars/api/base/arithm.py +954 -0
  12. datar_polars-0.0.1/datar_polars/api/base/asis.py +155 -0
  13. datar_polars-0.0.1/datar_polars/api/base/bessel.py +146 -0
  14. datar_polars-0.0.1/datar_polars/api/base/complex.py +137 -0
  15. datar_polars-0.0.1/datar_polars/api/base/cum.py +79 -0
  16. datar_polars-0.0.1/datar_polars/api/base/factor.py +458 -0
  17. datar_polars-0.0.1/datar_polars/api/base/random.py +134 -0
  18. datar_polars-0.0.1/datar_polars/api/base/rank.py +267 -0
  19. datar_polars-0.0.1/datar_polars/api/base/seq.py +587 -0
  20. datar_polars-0.0.1/datar_polars/api/base/sets.py +256 -0
  21. datar_polars-0.0.1/datar_polars/api/base/special.py +286 -0
  22. datar_polars-0.0.1/datar_polars/api/base/stats.py +184 -0
  23. datar_polars-0.0.1/datar_polars/api/base/string.py +637 -0
  24. datar_polars-0.0.1/datar_polars/api/base/table.py +102 -0
  25. datar_polars-0.0.1/datar_polars/api/base/trig.py +307 -0
  26. datar_polars-0.0.1/datar_polars/api/base/types.py +342 -0
  27. datar_polars-0.0.1/datar_polars/api/base/verbs.py +452 -0
  28. datar_polars-0.0.1/datar_polars/api/base/which.py +41 -0
  29. datar_polars-0.0.1/datar_polars/api/dplyr/__init__.py +1 -0
  30. datar_polars-0.0.1/datar_polars/api/dplyr/across.py +338 -0
  31. datar_polars-0.0.1/datar_polars/api/dplyr/arrange.py +126 -0
  32. datar_polars-0.0.1/datar_polars/api/dplyr/bind.py +134 -0
  33. datar_polars-0.0.1/datar_polars/api/dplyr/context.py +315 -0
  34. datar_polars-0.0.1/datar_polars/api/dplyr/count.py +244 -0
  35. datar_polars-0.0.1/datar_polars/api/dplyr/desc.py +29 -0
  36. datar_polars-0.0.1/datar_polars/api/dplyr/distinct.py +119 -0
  37. datar_polars-0.0.1/datar_polars/api/dplyr/filter_.py +136 -0
  38. datar_polars-0.0.1/datar_polars/api/dplyr/funs.py +374 -0
  39. datar_polars-0.0.1/datar_polars/api/dplyr/glimpse.py +83 -0
  40. datar_polars-0.0.1/datar_polars/api/dplyr/group_by.py +101 -0
  41. datar_polars-0.0.1/datar_polars/api/dplyr/group_data.py +210 -0
  42. datar_polars-0.0.1/datar_polars/api/dplyr/group_iter.py +250 -0
  43. datar_polars-0.0.1/datar_polars/api/dplyr/if_else.py +335 -0
  44. datar_polars-0.0.1/datar_polars/api/dplyr/join.py +263 -0
  45. datar_polars-0.0.1/datar_polars/api/dplyr/mutate.py +364 -0
  46. datar_polars-0.0.1/datar_polars/api/dplyr/order_by.py +145 -0
  47. datar_polars-0.0.1/datar_polars/api/dplyr/pick.py +33 -0
  48. datar_polars-0.0.1/datar_polars/api/dplyr/pull.py +95 -0
  49. datar_polars-0.0.1/datar_polars/api/dplyr/rank.py +201 -0
  50. datar_polars-0.0.1/datar_polars/api/dplyr/recode.py +206 -0
  51. datar_polars-0.0.1/datar_polars/api/dplyr/reframe.py +23 -0
  52. datar_polars-0.0.1/datar_polars/api/dplyr/relocate.py +100 -0
  53. datar_polars-0.0.1/datar_polars/api/dplyr/rename.py +101 -0
  54. datar_polars-0.0.1/datar_polars/api/dplyr/rows.py +349 -0
  55. datar_polars-0.0.1/datar_polars/api/dplyr/select.py +142 -0
  56. datar_polars-0.0.1/datar_polars/api/dplyr/sets.py +173 -0
  57. datar_polars-0.0.1/datar_polars/api/dplyr/slice_.py +338 -0
  58. datar_polars-0.0.1/datar_polars/api/dplyr/summarise.py +359 -0
  59. datar_polars-0.0.1/datar_polars/api/dplyr/tidyselect.py +261 -0
  60. datar_polars-0.0.1/datar_polars/api/forcats.py +1493 -0
  61. datar_polars-0.0.1/datar_polars/api/misc.py +91 -0
  62. datar_polars-0.0.1/datar_polars/api/tibble.py +687 -0
  63. datar_polars-0.0.1/datar_polars/api/tidyr.py +1588 -0
  64. datar_polars-0.0.1/datar_polars/broadcast.py +163 -0
  65. datar_polars-0.0.1/datar_polars/collections.py +304 -0
  66. datar_polars-0.0.1/datar_polars/common.py +123 -0
  67. datar_polars-0.0.1/datar_polars/contexts.py +91 -0
  68. datar_polars-0.0.1/datar_polars/operators.py +96 -0
  69. datar_polars-0.0.1/datar_polars/plugin.py +181 -0
  70. datar_polars-0.0.1/datar_polars/polars.py +27 -0
  71. datar_polars-0.0.1/datar_polars/tibble.py +328 -0
  72. datar_polars-0.0.1/datar_polars/utils.py +162 -0
  73. datar_polars-0.0.1/datar_polars/version.py +1 -0
  74. datar_polars-0.0.1/docs/examples/index.md +48 -0
  75. datar_polars-0.0.1/docs/examples/notebooks/across.ipynb +1194 -0
  76. datar_polars-0.0.1/docs/examples/notebooks/add_column.ipynb +247 -0
  77. datar_polars-0.0.1/docs/examples/notebooks/add_row.ipynb +362 -0
  78. datar_polars-0.0.1/docs/examples/notebooks/arrange.ipynb +487 -0
  79. datar_polars-0.0.1/docs/examples/notebooks/base-arithmetic.ipynb +1479 -0
  80. datar_polars-0.0.1/docs/examples/notebooks/base-funs.ipynb +404 -0
  81. datar_polars-0.0.1/docs/examples/notebooks/base.ipynb +1340 -0
  82. datar_polars-0.0.1/docs/examples/notebooks/between.ipynb +344 -0
  83. datar_polars-0.0.1/docs/examples/notebooks/bind.ipynb +789 -0
  84. datar_polars-0.0.1/docs/examples/notebooks/case_when.ipynb +463 -0
  85. datar_polars-0.0.1/docs/examples/notebooks/chop.ipynb +510 -0
  86. datar_polars-0.0.1/docs/examples/notebooks/coalesce.ipynb +194 -0
  87. datar_polars-0.0.1/docs/examples/notebooks/complete.ipynb +208 -0
  88. datar_polars-0.0.1/docs/examples/notebooks/context.ipynb +832 -0
  89. datar_polars-0.0.1/docs/examples/notebooks/count.ipynb +793 -0
  90. datar_polars-0.0.1/docs/examples/notebooks/cumall.ipynb +437 -0
  91. datar_polars-0.0.1/docs/examples/notebooks/desc.ipynb +197 -0
  92. datar_polars-0.0.1/docs/examples/notebooks/distinct.ipynb +692 -0
  93. datar_polars-0.0.1/docs/examples/notebooks/drop_na.ipynb +370 -0
  94. datar_polars-0.0.1/docs/examples/notebooks/enframe.ipynb +345 -0
  95. datar_polars-0.0.1/docs/examples/notebooks/expand.ipynb +911 -0
  96. datar_polars-0.0.1/docs/examples/notebooks/expand_grid.ipynb +295 -0
  97. datar_polars-0.0.1/docs/examples/notebooks/extract.ipynb +299 -0
  98. datar_polars-0.0.1/docs/examples/notebooks/fill.ipynb +370 -0
  99. datar_polars-0.0.1/docs/examples/notebooks/filter-joins.ipynb +309 -0
  100. datar_polars-0.0.1/docs/examples/notebooks/filter.ipynb +532 -0
  101. datar_polars-0.0.1/docs/examples/notebooks/forcats_fct_multi.ipynb +400 -0
  102. datar_polars-0.0.1/docs/examples/notebooks/forcats_lvl_addrm.ipynb +703 -0
  103. datar_polars-0.0.1/docs/examples/notebooks/forcats_lvl_order.ipynb +1787 -0
  104. datar_polars-0.0.1/docs/examples/notebooks/forcats_lvl_value.ipynb +2596 -0
  105. datar_polars-0.0.1/docs/examples/notebooks/forcats_misc.ipynb +1051 -0
  106. datar_polars-0.0.1/docs/examples/notebooks/full_seq.ipynb +122 -0
  107. datar_polars-0.0.1/docs/examples/notebooks/group_by.ipynb +637 -0
  108. datar_polars-0.0.1/docs/examples/notebooks/group_map.ipynb +325 -0
  109. datar_polars-0.0.1/docs/examples/notebooks/group_split.ipynb +567 -0
  110. datar_polars-0.0.1/docs/examples/notebooks/group_trim.ipynb +188 -0
  111. datar_polars-0.0.1/docs/examples/notebooks/lazy.ipynb +206 -0
  112. datar_polars-0.0.1/docs/examples/notebooks/lead-lag.ipynb +658 -0
  113. datar_polars-0.0.1/docs/examples/notebooks/mutate-joins.ipynb +737 -0
  114. datar_polars-0.0.1/docs/examples/notebooks/mutate.ipynb +958 -0
  115. datar_polars-0.0.1/docs/examples/notebooks/n_distinct.ipynb +184 -0
  116. datar_polars-0.0.1/docs/examples/notebooks/na_if.ipynb +373 -0
  117. datar_polars-0.0.1/docs/examples/notebooks/nb_helpers.py +65 -0
  118. datar_polars-0.0.1/docs/examples/notebooks/near.ipynb +151 -0
  119. datar_polars-0.0.1/docs/examples/notebooks/nest-join.ipynb +225 -0
  120. datar_polars-0.0.1/docs/examples/notebooks/nest.ipynb +772 -0
  121. datar_polars-0.0.1/docs/examples/notebooks/nth.ipynb +408 -0
  122. datar_polars-0.0.1/docs/examples/notebooks/pack.ipynb +571 -0
  123. datar_polars-0.0.1/docs/examples/notebooks/pivot_longer.ipynb +641 -0
  124. datar_polars-0.0.1/docs/examples/notebooks/pivot_wider.ipynb +630 -0
  125. datar_polars-0.0.1/docs/examples/notebooks/pull.ipynb +504 -0
  126. datar_polars-0.0.1/docs/examples/notebooks/ranking.ipynb +517 -0
  127. datar_polars-0.0.1/docs/examples/notebooks/readme.ipynb +263 -0
  128. datar_polars-0.0.1/docs/examples/notebooks/recode.ipynb +964 -0
  129. datar_polars-0.0.1/docs/examples/notebooks/reframe.ipynb +450 -0
  130. datar_polars-0.0.1/docs/examples/notebooks/relocate.ipynb +677 -0
  131. datar_polars-0.0.1/docs/examples/notebooks/rename.ipynb +991 -0
  132. datar_polars-0.0.1/docs/examples/notebooks/replace_na.ipynb +339 -0
  133. datar_polars-0.0.1/docs/examples/notebooks/rows.ipynb +776 -0
  134. datar_polars-0.0.1/docs/examples/notebooks/rowwise.ipynb +388 -0
  135. datar_polars-0.0.1/docs/examples/notebooks/select.ipynb +854 -0
  136. datar_polars-0.0.1/docs/examples/notebooks/separate.ipynb +695 -0
  137. datar_polars-0.0.1/docs/examples/notebooks/setops.ipynb +731 -0
  138. datar_polars-0.0.1/docs/examples/notebooks/slice.ipynb +1599 -0
  139. datar_polars-0.0.1/docs/examples/notebooks/summarise.ipynb +526 -0
  140. datar_polars-0.0.1/docs/examples/notebooks/tibble.ipynb +1140 -0
  141. datar_polars-0.0.1/docs/examples/notebooks/uncount.ipynb +286 -0
  142. datar_polars-0.0.1/docs/examples/notebooks/unite.ipynb +291 -0
  143. datar_polars-0.0.1/docs/examples/notebooks/with_groups.ipynb +295 -0
  144. datar_polars-0.0.1/docs/stylesheets/extra.css +25 -0
  145. datar_polars-0.0.1/mkdocs.yml +129 -0
  146. datar_polars-0.0.1/pyproject.toml +54 -0
  147. datar_polars-0.0.1/tests/__init__.py +0 -0
  148. datar_polars-0.0.1/tests/base/__init__.py +0 -0
  149. datar_polars-0.0.1/tests/base/test_arithm.py +191 -0
  150. datar_polars-0.0.1/tests/base/test_asis.py +155 -0
  151. datar_polars-0.0.1/tests/base/test_bessel.py +64 -0
  152. datar_polars-0.0.1/tests/base/test_complex.py +60 -0
  153. datar_polars-0.0.1/tests/base/test_cum.py +115 -0
  154. datar_polars-0.0.1/tests/base/test_factor.py +197 -0
  155. datar_polars-0.0.1/tests/base/test_funs.py +171 -0
  156. datar_polars-0.0.1/tests/base/test_random.py +44 -0
  157. datar_polars-0.0.1/tests/base/test_rank.py +142 -0
  158. datar_polars-0.0.1/tests/base/test_seq.py +207 -0
  159. datar_polars-0.0.1/tests/base/test_sets.py +115 -0
  160. datar_polars-0.0.1/tests/base/test_special.py +112 -0
  161. datar_polars-0.0.1/tests/base/test_stats.py +197 -0
  162. datar_polars-0.0.1/tests/base/test_string.py +162 -0
  163. datar_polars-0.0.1/tests/base/test_string_ext.py +317 -0
  164. datar_polars-0.0.1/tests/base/test_table.py +52 -0
  165. datar_polars-0.0.1/tests/base/test_trig.py +444 -0
  166. datar_polars-0.0.1/tests/base/test_types.py +302 -0
  167. datar_polars-0.0.1/tests/base/test_verbs.py +280 -0
  168. datar_polars-0.0.1/tests/base/test_which.py +97 -0
  169. datar_polars-0.0.1/tests/conftest.py +102 -0
  170. datar_polars-0.0.1/tests/core/__init__.py +0 -0
  171. datar_polars-0.0.1/tests/core/test_tibble.py +191 -0
  172. datar_polars-0.0.1/tests/core/test_utils.py +272 -0
  173. datar_polars-0.0.1/tests/dplyr/__init__.py +0 -0
  174. datar_polars-0.0.1/tests/dplyr/test_across.py +213 -0
  175. datar_polars-0.0.1/tests/dplyr/test_arrange.py +195 -0
  176. datar_polars-0.0.1/tests/dplyr/test_bind.py +91 -0
  177. datar_polars-0.0.1/tests/dplyr/test_coalesce.py +35 -0
  178. datar_polars-0.0.1/tests/dplyr/test_context.py +212 -0
  179. datar_polars-0.0.1/tests/dplyr/test_count.py +132 -0
  180. datar_polars-0.0.1/tests/dplyr/test_distinct.py +167 -0
  181. datar_polars-0.0.1/tests/dplyr/test_empty_groups.py +25 -0
  182. datar_polars-0.0.1/tests/dplyr/test_filter.py +230 -0
  183. datar_polars-0.0.1/tests/dplyr/test_funs.py +194 -0
  184. datar_polars-0.0.1/tests/dplyr/test_glimpse.py +19 -0
  185. datar_polars-0.0.1/tests/dplyr/test_group_by.py +233 -0
  186. datar_polars-0.0.1/tests/dplyr/test_if_else.py +164 -0
  187. datar_polars-0.0.1/tests/dplyr/test_join.py +273 -0
  188. datar_polars-0.0.1/tests/dplyr/test_lazy.py +90 -0
  189. datar_polars-0.0.1/tests/dplyr/test_lead_lag.py +65 -0
  190. datar_polars-0.0.1/tests/dplyr/test_mutate.py +443 -0
  191. datar_polars-0.0.1/tests/dplyr/test_mutate_windowed.py +32 -0
  192. datar_polars-0.0.1/tests/dplyr/test_n_distinct.py +45 -0
  193. datar_polars-0.0.1/tests/dplyr/test_order_by.py +20 -0
  194. datar_polars-0.0.1/tests/dplyr/test_pick.py +21 -0
  195. datar_polars-0.0.1/tests/dplyr/test_pull.py +60 -0
  196. datar_polars-0.0.1/tests/dplyr/test_rank.py +134 -0
  197. datar_polars-0.0.1/tests/dplyr/test_recode.py +99 -0
  198. datar_polars-0.0.1/tests/dplyr/test_relocate.py +87 -0
  199. datar_polars-0.0.1/tests/dplyr/test_rename.py +71 -0
  200. datar_polars-0.0.1/tests/dplyr/test_rows.py +148 -0
  201. datar_polars-0.0.1/tests/dplyr/test_select.py +159 -0
  202. datar_polars-0.0.1/tests/dplyr/test_sets.py +24 -0
  203. datar_polars-0.0.1/tests/dplyr/test_slice.py +192 -0
  204. datar_polars-0.0.1/tests/dplyr/test_summarise.py +282 -0
  205. datar_polars-0.0.1/tests/dplyr/test_tidyselect.py +159 -0
  206. datar_polars-0.0.1/tests/forcats/__init__.py +1 -0
  207. datar_polars-0.0.1/tests/forcats/test_forcats.py +705 -0
  208. datar_polars-0.0.1/tests/test_plugin.py +88 -0
  209. datar_polars-0.0.1/tests/tibble/__init__.py +1 -0
  210. datar_polars-0.0.1/tests/tibble/test_tibble.py +707 -0
  211. datar_polars-0.0.1/tests/tidyr/__init__.py +7 -0
  212. datar_polars-0.0.1/tests/tidyr/test_tidyr_verbs.py +525 -0
  213. datar_polars-0.0.1/tests/tidyr/test_tidyr_verbs_ext.py +378 -0
  214. datar_polars-0.0.1/uv.lock +5287 -0
@@ -0,0 +1,54 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ release:
7
+ types: [published]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ python-version: ["3.9", "3.10", "3.11", "3.12"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v6
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v8.0.0
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ - name: Install dependencies
24
+ run: |
25
+ uv sync --all-extras
26
+ - name: Show versions
27
+ run: uv run python -c 'import datar; datar.get_versions()'
28
+ - name: Test with pytest
29
+ run: uv run pytest tests/ --junitxml=junit/test-results-${{ matrix.python-version }}.xml
30
+ - name: Upload pytest test results
31
+ uses: actions/upload-artifact@v7
32
+ with:
33
+ name: pytest-results-${{ matrix.python-version }}
34
+ path: junit/test-results-${{ matrix.python-version }}.xml
35
+ if: ${{ always() }}
36
+
37
+ deploy:
38
+ needs: build
39
+ runs-on: ubuntu-latest
40
+ if: github.event_name == 'release'
41
+ strategy:
42
+ matrix:
43
+ python-version: ["3.12"]
44
+ steps:
45
+ - uses: actions/checkout@v6
46
+ - name: Install uv
47
+ uses: astral-sh/setup-uv@v8.0.0
48
+ with:
49
+ python-version: ${{ matrix.python-version }}
50
+ - name: Build and publish to PyPI
51
+ run: |
52
+ uv build
53
+ uv publish --token ${{ secrets.PYPI_PASSWORD }}
54
+ if: success()
@@ -0,0 +1,30 @@
1
+ name: Build Docs
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ docs:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ python-version: ["3.12"]
11
+ steps:
12
+ - uses: actions/checkout@v6
13
+ - name: Install uv
14
+ uses: astral-sh/setup-uv@v8.0.0
15
+ with:
16
+ python-version: ${{ matrix.python-version }}
17
+ - name: Install dependencies
18
+ run: uv sync --group dev
19
+ - name: Install ipykernel
20
+ run: |
21
+ uv run python -m ipykernel install --user --name python --display-name python
22
+ uv run python -m ipykernel install --user --name python3 --display-name python3
23
+ - name: Build docs
24
+ run: |
25
+ cp README.md docs/index.md
26
+ uv run mkdocs build
27
+ if: success()
28
+ - name: Deploy docs
29
+ run: uv run mkdocs gh-deploy --clean --force
30
+ if: success()
@@ -0,0 +1,130 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ env/
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+
27
+ # PyInstaller
28
+ # Usually these files are written by a python script from a template
29
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .coverage
41
+ .coverage.*
42
+ .cache
43
+ nosetests.xml
44
+ coverage.xml
45
+ .coverage.xml
46
+ cov.xml
47
+ *,cover
48
+ .hypothesis/
49
+
50
+ # Translations
51
+ *.mo
52
+ *.pot
53
+
54
+ # Django stuff:
55
+ *.log
56
+ local_settings.py
57
+
58
+ # Flask stuff:
59
+ instance/
60
+ .webassets-cache
61
+
62
+ # Scrapy stuff:
63
+ .scrapy
64
+
65
+ # Sphinx documentation
66
+ docs/_build/
67
+
68
+ # PyBuilder
69
+ target/
70
+
71
+ # IPython Notebook
72
+ .ipynb_checkpoints
73
+
74
+ # pyenv
75
+ .python-version
76
+
77
+ # celery beat schedule file
78
+ celerybeat-schedule
79
+
80
+ # dotenv
81
+ .env
82
+
83
+ # virtualenv
84
+ venv/
85
+ ENV/
86
+
87
+ # Spyder project settings
88
+ .spyderproject
89
+
90
+ # Rope project settings
91
+ .ropeproject
92
+
93
+ workdir/
94
+ node_modules/
95
+ _book/
96
+ .vscode
97
+ export/
98
+ *.svg
99
+ *.dot
100
+ *.queue.txt
101
+ site/
102
+
103
+ # poetry
104
+ # poetry.lock
105
+
106
+ # backup files
107
+ *.bak
108
+
109
+ docs/index.md
110
+ docs/logo.png
111
+ docs/example.png
112
+ docs/example2.png
113
+ docs/api/
114
+ docs/*.nbconvert.ipynb
115
+ docs/*/*.nbconvert.ipynb
116
+
117
+ # vscode's local history extension
118
+ .history/
119
+
120
+ # For quick test
121
+ /_t.py
122
+ /_t.ipynb
123
+ /prompt*.txt
124
+ /temp_*
125
+ .claude
126
+ run_notebooks.py
127
+ categorize_errors.py
128
+ _test_setequal.py
129
+ .venv
130
+ docs/api-*/
@@ -0,0 +1,486 @@
1
+ # datar-polars API Surface Audit
2
+
3
+ ## Executive Summary
4
+
5
+ - **Total API surface**: 369 functions across 6 API groups
6
+ - **Implemented in datar-polars**: 24 functions (~6.5%)
7
+ - **Remaining**: 345 functions
8
+ - **Current state**: Only dplyr core verbs + misc (lazy/collect) are done
9
+
10
+ ---
11
+
12
+ ## 1. Complete API Inventory
13
+
14
+ ### 1.1 dplyr API (115 functions)
15
+
16
+ #### Core Data Verbs (registered to Tibble)
17
+
18
+ | # | Function | Status | Notes |
19
+ |---|----------|--------|-------|
20
+ | 1 | `mutate` | ✅ | Fully implemented |
21
+ | 2 | `transmute` | ✅ | Delegates to mutate with _keep="none" |
22
+ | 3 | `select` | ✅ | Fully implemented |
23
+ | 4 | `filter_` | ✅ | Fully implemented |
24
+ | 5 | `arrange` | ✅ | Fully implemented |
25
+ | 6 | `distinct` | ✅ | Fully implemented |
26
+ | 7 | `summarise` | ✅ | Fully implemented |
27
+ | 8 | `reframe` | ✅ | Fully implemented |
28
+ | 9 | `group_by` | ✅ | Fully implemented |
29
+ | 10 | `ungroup` | ✅ | Fully implemented |
30
+ | 11 | `rowwise` | ✅ | Fully implemented |
31
+ | 12 | `group_by_drop_default` | ✅ | Fully implemented |
32
+ | 13 | `group_vars` | ✅ | Fully implemented |
33
+ | 14 | `inner_join` | ✅ | Fully implemented |
34
+ | 15 | `left_join` | ✅ | Fully implemented |
35
+ | 16 | `right_join` | ✅ | Fully implemented |
36
+ | 17 | `full_join` | ✅ | Fully implemented |
37
+ | 18 | `semi_join` | ✅ | Fully implemented |
38
+ | 19 | `anti_join` | ✅ | Fully implemented |
39
+ | 20 | `nest_join` | ✅ | Fully implemented |
40
+ | 21 | `cross_join` | ✅ | Fully implemented |
41
+ | 22 | `desc` | ✅ | Series-level only |
42
+
43
+ #### Remaining dplyr Verbs (93 functions)
44
+
45
+ | # | Function | Priority | File count | Notes |
46
+ |---|----------|----------|------------|-------|
47
+ | 23 | `pick` | HIGH | 1 | Column selection helper |
48
+ | 24 | `across` | HIGH | 1 | Apply function across columns |
49
+ | 25 | `c_across` | MEDIUM | 1 | Column selection in rowwise |
50
+ | 26 | `if_any` | HIGH | 1 | Used with filter/across |
51
+ | 27 | `if_all` | HIGH | 1 | Used with filter/across |
52
+ | 28 | `symdiff` | LOW | 1 | Set difference |
53
+ | 29 | `bind_rows` | HIGH | 1 | Concatenate data frames |
54
+ | 30 | `bind_cols` | MEDIUM | 1 | Column-bind data frames |
55
+ | 31 | `cur_column` | HIGH | 1 | Current column name in across |
56
+ | 32 | `cur_data` | HIGH | 1 | Current data in grouped ops |
57
+ | 33 | `n` | HIGH | 1 | Row count (used everywhere) |
58
+ | 34 | `cur_data_all` | MEDIUM | 1 | Current data with all columns |
59
+ | 35 | `cur_group` | MEDIUM | 1 | Current group dataframe |
60
+ | 36 | `cur_group_id` | MEDIUM | 1 | Current group integer id |
61
+ | 37 | `cur_group_rows` | MEDIUM | 1 | Current group row indices |
62
+ | 38 | `count` | HIGH | 1 | Count observations by group |
63
+ | 39 | `tally` | MEDIUM | 1 | Count rows by group |
64
+ | 40 | `add_count` | MEDIUM | 1 | Add count column |
65
+ | 41 | `add_tally` | MEDIUM | 1 | Add tally column |
66
+ | 42 | `n_distinct` | MEDIUM | 1 | Count distinct values |
67
+ | 43 | `glimpse` | LOW | 1 | Preview data (nice-to-have) |
68
+ | 44 | `slice_` | HIGH | 1 | Row indexing |
69
+ | 45 | `slice_head` | HIGH | 1 | First N rows |
70
+ | 46 | `slice_tail` | HIGH | 1 | Last N rows |
71
+ | 47 | `slice_sample` | HIGH | 1 | Random rows |
72
+ | 48 | `slice_min` | HIGH | 1 | Rows with min values |
73
+ | 49 | `slice_max` | HIGH | 1 | Rows with max values |
74
+ | 50 | `between` | MEDIUM | 1 | Value in range check |
75
+ | 51 | `cummean` | MEDIUM | 1 | Cumulative mean |
76
+ | 52 | `cumall` | MEDIUM | 1 | Cumulative all |
77
+ | 53 | `cumany` | MEDIUM | 1 | Cumulative any |
78
+ | 54 | `coalesce` | MEDIUM | 1 | First non-NA value |
79
+ | 55 | `consecutive_id` | MEDIUM | 1 | Consecutive group ids |
80
+ | 56 | `na_if` | MEDIUM | 1 | Replace value with NA |
81
+ | 57 | `near` | MEDIUM | 1 | Safe floating point equality |
82
+ | 58 | `nth` | HIGH | 1 | Extract nth element |
83
+ | 59 | `first` | HIGH | 1 | First element |
84
+ | 60 | `last` | HIGH | 1 | Last element |
85
+ | 61 | `group_indices` | MEDIUM | 1 | Integer group ids |
86
+ | 62 | `group_keys` | MEDIUM | 1 | Group key dataframes |
87
+ | 63 | `group_size` | MEDIUM | 1 | Size of each group |
88
+ | 64 | `group_rows` | MEDIUM | 1 | Row indices per group |
89
+ | 65 | `group_cols` | MEDIUM | 1 | Group column names |
90
+ | 66 | `group_data` | MEDIUM | 1 | Full group metadata |
91
+ | 67 | `n_groups` | MEDIUM | 1 | Number of groups |
92
+ | 68 | `group_map` | MEDIUM | 1 | Apply function per group |
93
+ | 69 | `group_modify` | MEDIUM | 1 | Modify each group |
94
+ | 70 | `group_split` | MEDIUM | 1 | Split into list of frames |
95
+ | 71 | `group_trim` | LOW | 1 | Remove empty groups |
96
+ | 72 | `group_walk` | LOW | 1 | Side-effect per group |
97
+ | 73 | `with_groups` | MEDIUM | 1 | Temporary regroup |
98
+ | 74 | `if_else` | HIGH | 1 | Vectorized if/else |
99
+ | 75 | `case_match` | HIGH | 1 | Multi-value switch |
100
+ | 76 | `case_when` | HIGH | 1 | Vectorized case statement |
101
+ | 77 | `lead` | HIGH | 1 | Shift forward |
102
+ | 78 | `lag` | HIGH | 1 | Shift backward |
103
+ | 79 | `order_by` | MEDIUM | 1 | Control window order |
104
+ | 80 | `with_order` | MEDIUM | 1 | Apply fn with custom order |
105
+ | 81 | `pull` | HIGH | 1 | Extract column as series |
106
+ | 82 | `row_number` | HIGH | 1 | Row number (wrapper) |
107
+ | 83 | `row_number_` | HIGH | 1 | Row number (impl) |
108
+ | 84 | `ntile` | MEDIUM | 1 | N-tile buckets (wrapper) |
109
+ | 85 | `ntile_` | MEDIUM | 1 | N-tile (impl) |
110
+ | 86 | `min_rank` | HIGH | 1 | Min rank (wrapper) |
111
+ | 87 | `min_rank_` | HIGH | 1 | Min rank (impl) |
112
+ | 88 | `dense_rank` | MEDIUM | 1 | Dense rank (wrapper) |
113
+ | 89 | `dense_rank_` | MEDIUM | 1 | Dense rank (impl) |
114
+ | 90 | `percent_rank` | MEDIUM | 1 | Percent rank (wrapper) |
115
+ | 91 | `percent_rank_` | MEDIUM | 1 | Percent rank (impl) |
116
+ | 92 | `cume_dist` | MEDIUM | 1 | Cumulative distribution (w) |
117
+ | 93 | `cume_dist_` | MEDIUM | 1 | Cumulative distribution (i) |
118
+ | 94 | `recode` | MEDIUM | 1 | Replace values in vector |
119
+ | 95 | `recode_factor` | MEDIUM | 1 | Replace factor levels |
120
+ | 96 | `relocate` | HIGH | 1 | Move columns |
121
+ | 97 | `rename` | HIGH | 1 | Rename columns |
122
+ | 98 | `rename_with` | HIGH | 1 | Rename with function |
123
+ | 99 | `rows_insert` | MEDIUM | 1 | Insert rows by key |
124
+ | 100 | `rows_update` | MEDIUM | 1 | Update rows by key |
125
+ | 101 | `rows_patch` | MEDIUM | 1 | Patch NA values by key |
126
+ | 102 | `rows_upsert` | MEDIUM | 1 | Upsert rows by key |
127
+ | 103 | `rows_delete` | MEDIUM | 1 | Delete rows by key |
128
+ | 104 | `rows_append` | MEDIUM | 1 | Append rows |
129
+ | 105 | `union_all` | MEDIUM | 1 | Combine two datasets |
130
+ | 106 | `where` | MEDIUM | 1 | Column selection helper |
131
+ | 107 | `everything` | MEDIUM | 1 | Select all columns |
132
+ | 108 | `last_col` | MEDIUM | 1 | Select last column |
133
+ | 109 | `starts_with` | MEDIUM | 1 | Column name pattern |
134
+ | 110 | `ends_with` | MEDIUM | 1 | Column name pattern |
135
+ | 111 | `contains` | MEDIUM | 1 | Column name pattern |
136
+ | 112 | `matches` | MEDIUM | 1 | Column name regex |
137
+ | 113 | `num_range` | MEDIUM | 1 | Column name range |
138
+ | 114 | `all_of` | MEDIUM | 1 | Strict column selection |
139
+ | 115 | `any_of` | MEDIUM | 1 | Loose column selection |
140
+
141
+ **dplyr subtotal: 22 done, 93 remaining**
142
+
143
+ ### 1.2 base API (183 functions)
144
+
145
+ Categorized by module:
146
+
147
+ #### Arithmetic/Statistics (31 functions)
148
+ `ceiling`, `cov`, `floor`, `mean`, `median`, `pmax`, `pmin`, `sqrt`, `var`, `scale`,
149
+ `col_sums`, `col_means`, `col_sds`, `col_medians`, `row_sums`, `row_means`, `row_sds`, `row_medians`,
150
+ `min_`, `max_`, `round_`, `sum_`, `abs_`, `prod`, `sign`, `signif`, `trunc`, `sd`, `weighted_mean`, `quantile`, `proportions`
151
+
152
+ **Status: ⬜ ALL NOT STARTED** (0/31)
153
+
154
+ #### Log/Exp (7 functions)
155
+ `exp`, `log`, `log2`, `log10`, `log1p`
156
+
157
+ **Status: ⬜ ALL NOT STARTED** (0/5)
158
+ Note: `log` counted again below with variants.
159
+
160
+ Actually, let me recategorize:
161
+ - `exp`, `log`, `log2`, `log10`, `log1p` = 5
162
+
163
+ #### Bessel Functions (4 functions)
164
+ `bessel_i`, `bessel_j`, `bessel_k`, `bessel_y`
165
+
166
+ **Status: ⬜ ALL NOT STARTED** (0/4)
167
+
168
+ #### Type Conversion/Coercion (12 functions)
169
+ `as_double`, `as_integer`, `as_logical`, `as_character`, `as_factor`, `as_ordered`,
170
+ `as_date`, `as_numeric`, `as_complex`, `as_null`
171
+
172
+ Plus type-checking: `is_integer`, `is_numeric`, `is_double`, `is_logical`, `is_character`,
173
+ `is_complex`, `is_factor`, `is_ordered`, `is_atomic`, `is_null`, `is_na`, `is_finite`, `is_infinite`,
174
+ `is_true`, `is_false`, `any_na`
175
+
176
+ **Status: ⬜ ALL NOT STARTED** (0/~26)
177
+
178
+ #### Complex Numbers (6 functions)
179
+ `arg`, `conj`, `mod`, `re_`, `im`
180
+
181
+ **Status: ⬜ ALL NOT STARTED** (0/5)
182
+
183
+ #### Cumulative Functions (4 functions)
184
+ `cummax`, `cummin`, `cumprod`, `cumsum`
185
+
186
+ **Status: ⬜ ALL NOT STARTED** (0/4)
187
+
188
+ #### Factor/Level Functions (8 functions)
189
+ `droplevels`, `levels`, `set_levels`, `is_factor`, `is_ordered`, `nlevels`,
190
+ `factor`, `ordered`, `cut`
191
+
192
+ **Status: ⬜ ALL NOT STARTED** (0/9)
193
+
194
+ #### Sequence Functions (5 functions)
195
+ `seq`, `seq_along`, `seq_len`, `diff`, `rep`
196
+
197
+ **Status: ⬜ ALL NOT STARTED** (0/5)
198
+
199
+ #### Random Number Generation (8 functions)
200
+ `set_seed`, `rnorm`, `runif`, `rpois`, `rbinom`, `rcauchy`, `rchisq`, `rexp`
201
+
202
+ **Status: ⬜ ALL NOT STARTED** (0/8)
203
+
204
+ #### String Functions (19 functions)
205
+ `grep`, `grepl`, `sub`, `gsub`, `strsplit`, `paste`, `paste0`, `sprintf`,
206
+ `substr`, `substring`, `startswith`, `endswith`, `strtoi`, `trimws`,
207
+ `toupper`, `tolower`, `chartr`, `nchar`, `nzchar`
208
+
209
+ **Status: ⬜ ALL NOT STARTED** (0/19)
210
+
211
+ #### Trigonometry (16 functions)
212
+ `acos`, `acosh`, `asin`, `asinh`, `atan`, `atanh`, `cos`, `cosh`, `cospi`,
213
+ `sin`, `sinh`, `sinpi`, `tan`, `tanh`, `tanpi`, `atan2`
214
+
215
+ **Status: ⬜ ALL NOT STARTED** (0/16)
216
+
217
+ #### Special Math (13 functions)
218
+ `beta`, `lgamma`, `digamma`, `trigamma`, `choose`, `factorial`, `gamma`,
219
+ `lfactorial`, `lchoose`, `lbeta`, `psigamma`
220
+
221
+ **Status: ⬜ ALL NOT STARTED** (0/11)
222
+
223
+ #### Set/Vector Operations (15 functions)
224
+ `match`, `order`, `sort`, `rev`, `sample`, `c_`, `length`, `lengths`,
225
+ `append`, `intersect`, `setdiff`, `setequal`, `unique`, `union`, `duplicated`
226
+
227
+ **Status: ⬜ ALL NOT STARTED** (0/15)
228
+
229
+ #### Data Frame Inspection (12 functions)
230
+ `colnames`, `set_colnames`, `rownames`, `set_rownames`, `dim`, `ncol`, `nrow`,
231
+ `head`, `tail`, `complete_cases`, `diag`, `max_col`
232
+
233
+ **Status: ⬜ ALL NOT STARTED** (0/12)
234
+
235
+ #### Table Functions (2 functions)
236
+ `table`, `tabulate`
237
+
238
+ **Status: ⬜ ALL NOT STARTED** (0/2)
239
+
240
+ #### Other (7 functions)
241
+ `make_names`, `make_unique`, `rank`, `identity`, `expand_grid`, `outer`, `which`, `which_max`, `which_min`, `any_`, `all_`, `t`
242
+
243
+ **Status: ⬜ ALL NOT STARTED** (0/~12)
244
+
245
+ **base subtotal: 0 done, 183 remaining**
246
+
247
+ ### 1.3 tibble API (14 functions)
248
+
249
+ | # | Function | Priority |
250
+ |---|----------|----------|
251
+ | 1 | `tibble` | HIGH (BLOCKER) |
252
+ | 2 | `tibble_` | MEDIUM |
253
+ | 3 | `tribble` | MEDIUM |
254
+ | 4 | `tibble_row` | MEDIUM |
255
+ | 5 | `as_tibble` | HIGH (BLOCKER) |
256
+ | 6 | `enframe` | MEDIUM |
257
+ | 7 | `deframe` | MEDIUM |
258
+ | 8 | `add_row` | MEDIUM |
259
+ | 9 | `add_column` | MEDIUM |
260
+ | 10 | `has_rownames` | LOW |
261
+ | 11 | `remove_rownames` | LOW |
262
+ | 12 | `rownames_to_column` | LOW |
263
+ | 13 | `rowid_to_column` | LOW |
264
+ | 14 | `column_to_rownames` | LOW |
265
+
266
+ **Status: ⬜ ALL NOT STARTED** (0/14)
267
+
268
+ NOTE: `as_tibble` and `tibble` already exist in `datar_polars/tibble.py` as the Tibble class and constructor, but not registered as API functions.
269
+
270
+ ### 1.4 tidyr API (21 functions)
271
+
272
+ | # | Function | Priority |
273
+ |---|----------|----------|
274
+ | 1 | `full_seq` | MEDIUM |
275
+ | 2 | `chop` | MEDIUM |
276
+ | 3 | `unchop` | MEDIUM |
277
+ | 4 | `nest` | MEDIUM |
278
+ | 5 | `unnest` | HIGH |
279
+ | 6 | `pack` | LOW |
280
+ | 7 | `unpack` | LOW |
281
+ | 8 | `expand` | HIGH |
282
+ | 9 | `nesting` | MEDIUM |
283
+ | 10 | `crossing` | MEDIUM |
284
+ | 11 | `complete` | HIGH |
285
+ | 12 | `drop_na` | HIGH |
286
+ | 13 | `extract` | MEDIUM |
287
+ | 14 | `fill` | HIGH |
288
+ | 15 | `pivot_longer` | HIGH |
289
+ | 16 | `pivot_wider` | HIGH |
290
+ | 17 | `separate` | HIGH |
291
+ | 18 | `separate_rows` | MEDIUM |
292
+ | 19 | `uncount` | MEDIUM |
293
+ | 20 | `unite` | MEDIUM |
294
+ | 21 | `replace_na` | HIGH |
295
+
296
+ **Status: ⬜ ALL NOT STARTED** (0/21)
297
+
298
+ ### 1.5 forcats API (34 functions)
299
+
300
+ | # | Function | Priority |
301
+ |---|----------|----------|
302
+ | 1 | `fct_relevel` | MEDIUM |
303
+ | 2 | `fct_inorder` | MEDIUM |
304
+ | 3 | `fct_infreq` | MEDIUM |
305
+ | 4 | `fct_inseq` | MEDIUM |
306
+ | 5 | `fct_reorder` | MEDIUM |
307
+ | 6 | `fct_reorder2` | LOW |
308
+ | 7 | `fct_shuffle` | LOW |
309
+ | 8 | `fct_rev` | MEDIUM |
310
+ | 9 | `fct_shift` | LOW |
311
+ | 10 | `first2` | LOW |
312
+ | 11 | `last2` | LOW |
313
+ | 12 | `fct_anon` | LOW |
314
+ | 13 | `fct_recode` | MEDIUM |
315
+ | 14 | `fct_collapse` | MEDIUM |
316
+ | 15 | `fct_lump` | MEDIUM |
317
+ | 16 | `fct_lump_min` | LOW |
318
+ | 17 | `fct_lump_prop` | LOW |
319
+ | 18 | `fct_lump_n` | LOW |
320
+ | 19 | `fct_lump_lowfreq` | LOW |
321
+ | 20 | `fct_other` | MEDIUM |
322
+ | 21 | `fct_relabel` | LOW |
323
+ | 22 | `fct_expand` | LOW |
324
+ | 23 | `fct_explicit_na` | MEDIUM |
325
+ | 24 | `fct_drop` | MEDIUM |
326
+ | 25 | `fct_unify` | LOW |
327
+ | 26 | `fct_c` | MEDIUM |
328
+ | 27 | `fct_cross` | LOW |
329
+ | 28 | `fct_count` | MEDIUM |
330
+ | 29 | `fct_match` | LOW |
331
+ | 30 | `fct_unique` | MEDIUM |
332
+ | 31 | `lvls_reorder` | LOW |
333
+ | 32 | `lvls_revalue` | LOW |
334
+ | 33 | `lvls_expand` | LOW |
335
+ | 34 | `lvls_union` | LOW |
336
+
337
+ **Status: ⬜ ALL NOT STARTED** (0/34)
338
+
339
+ ### 1.6 misc API (2 functions)
340
+
341
+ | # | Function | Status |
342
+ |---|----------|--------|
343
+ | 1 | `lazy` | ✅ |
344
+ | 2 | `collect` | ✅ |
345
+
346
+ **misc subtotal: 2 done, 0 remaining**
347
+
348
+ ---
349
+
350
+ ## 2. Plugin Hook Status
351
+
352
+ | Hook | datar-numpy | datar-pandas | datar-polars |
353
+ |------|------------|-------------|-------------|
354
+ | `setup()` | ❌ | ✅ | ✅ |
355
+ | `get_versions()` | ✅ | ✅ | ✅ |
356
+ | `load_dataset(name, metadata)` | ❌ | ✅ | ✅ |
357
+ | `base_api()` | ✅ (default impls) | ✅ (pandas impls) | ⬜ (empty) |
358
+ | `dplyr_api()` | ❌ | ✅ | 🔶 (partial) |
359
+ | `tibble_api()` | ❌ | ✅ | ⬜ (empty) |
360
+ | `tidyr_api()` | ❌ | ✅ | ⬜ (empty) |
361
+ | `forcats_api()` | ❌ | ✅ | ⬜ (empty) |
362
+ | `misc_api()` | ❌ | ✅ | ✅ |
363
+ | `c_getitem(item)` | ✅ | ✅ | ✅ |
364
+ | `operate(op, x, y)` | ❌ | ✅ | ✅ |
365
+
366
+ ---
367
+
368
+ ## 3. Implementation by Backend Comparison
369
+
370
+ | Backend | dplyr | base | tibble | tidyr | forcats | misc | Total |
371
+ |---------|-------|------|--------|-------|---------|------|-------|
372
+ | datar-numpy (default) | 0 | 183 | 0 | 0 | 0 | 0 | 183 (~50%) |
373
+ | datar-pandas (ref) | ~110 | ~183 | ~14 | ~21 | ~34 | ~6 | ~368 (~100%) |
374
+ | datar-polars (current) | 22 | 0 | 0 | 0 | 0 | 2 | 24 (~6.5%) |
375
+
376
+ Note: datar-numpy provides default/base implementations for all 183 base API functions (the math, trig, string ops that work on plain numpy arrays). datar-pandas overrides ALL of these for pandas Series/DataFrame input plus adds dplyr/tidyr/forcats/tibble.
377
+
378
+ ---
379
+
380
+ ## 4. Prioritized Implementation Order
381
+
382
+ ### Phase 1: Complete dplyr (BLOCKING for real-world use)
383
+ Estimated: ~93 verbs, 15-20 files
384
+
385
+ **Priority A (core/data verbs - used in every pipeline):**
386
+
387
+ | Order | Group | Verbs | Why |
388
+ |-------|-------|-------|-----|
389
+ | 1 | Context helpers | `n`, `cur_data`, `cur_column`, `cur_group_id` | Required by summarise/mutate |
390
+ | 2 | Window functions | `row_number`, `min_rank`, `dense_rank`, `percent_rank`, `cume_dist`, `ntile` | Required by arrange/mutate |
391
+ | 3 | Lead/lag | `lead`, `lag` | Required by mutate for time-series |
392
+ | 4 | if_else/case | `if_else`, `case_when`, `case_match` | Required by mutate |
393
+ | 5 | Column selection helpers | `everything`, `starts_with`, `ends_with`, `contains`, `matches`, `all_of`, `any_of`, `num_range`, `where`, `last_col` | Required by select/relocate |
394
+ | 6 | across/pick | `across`, `pick`, `if_any`, `if_all`, `c_across` | Required by mutate/summarise |
395
+ | 7 | slice | `slice_`, `slice_head`, `slice_tail`, `slice_sample`, `slice_min`, `slice_max` | Row subsetting |
396
+ | 8 | relocate/rename | `relocate`, `rename`, `rename_with` | Column management |
397
+ | 9 | count/tally | `count`, `tally`, `add_count`, `add_tally`, `n_distinct` | Common workflow |
398
+ | 10 | pull | `pull` | Extract column as series |
399
+ | 11 | bind | `bind_rows`, `bind_cols` | Combine data |
400
+
401
+ **Priority B (group metadata, often needed):**
402
+
403
+ | 12 | Group info | `group_indices`, `group_keys`, `group_size`, `group_rows`, `group_cols`, `n_groups`, `group_data` |
404
+ | 13 | Group ops | `group_map`, `group_modify`, `group_split`, `with_groups` |
405
+ | 14 | Order helpers | `order_by`, `with_order` |
406
+
407
+ **Priority C (utility, less urgent):**
408
+
409
+ | 15 | rows_* | `rows_insert`, `rows_update`, `rows_patch`, `rows_upsert`, `rows_delete`, `rows_append` |
410
+ | 16 | recode | `recode`, `recode_factor` |
411
+ | 17 | Misc dplyr | `between`, `cummean`, `cumall`, `cumany`, `coalesce`, `consecutive_id`, `na_if`, `near`, `nth`, `first`, `last` |
412
+ | 18 | Low-priority dplyr | `symdiff`, `glimpse`, `group_trim`, `group_walk`, `union_all`, `cur_group_rows` |
413
+
414
+ ### Phase 2: base API (Essential Functions)
415
+ Estimated: ~50 critical, ~133 nice-to-have
416
+
417
+ **Priority A (needed by dplyr verbs in expressions):**
418
+
419
+ 1. **Arithmetic/Stats** (10): `mean`, `sum_`, `min_`, `max_`, `abs_`, `sqrt`, `var`, `sd`, `median`, `round_`
420
+ 2. **String functions** (10): `paste`, `paste0`, `toupper`, `tolower`, `nchar`, `grep`, `grepl`, `sub`, `gsub`, `trimws`
421
+ 3. **Type checks** (12): `is_na`, `is_finite`, `is_infinite`, `is_numeric`, `is_character`, `is_logical`, `is_factor`, `is_null`, `is_integer`, `any_na`
422
+ 4. **Type conversion** (8): `as_double`, `as_integer`, `as_character`, `as_factor`, `as_numeric`, `as_logical`
423
+
424
+ **Priority B (commonly used):**
425
+
426
+ 5. **Log/Exp** (5): `log`, `log2`, `log10`, `log1p`, `exp`
427
+ 6. **Cumulative** (4): `cumsum`, `cumprod`, `cummin`, `cummax`
428
+ 7. **Sequence** (3): `seq`, `seq_along`, `seq_len`
429
+ 8. **Set/Vector** (8): `c_`, `length`, `unique`, `intersect`, `union`, `setdiff`, `match`, `sort`
430
+ 9. **Trig** (4): `cos`, `sin`, `tan` (+ maybe arctan)
431
+
432
+ **Priority C (specialized, lower volume):**
433
+
434
+ 10. Remaining trig (12), special math (11), complex (5), bessel (4), random (8), factor ops (9), table (2), df inspection (12), other (7)
435
+
436
+ ### Phase 3: tibble API
437
+ Estimated: ~14 verbs, 2-3 files
438
+
439
+ **Note**: `as_tibble` and `tibble` constructors already exist in `datar_polars/tibble.py`. They just need to be registered as API functions. `enframe`, `deframe`, `add_row`, `add_column` are medium priority. Row names functions are low priority (polite doesn't really use row names).
440
+
441
+ ### Phase 4: tidyr API
442
+ Estimated: ~21 verbs, 10-12 files
443
+
444
+ **Priority A (highly used):**
445
+ `pivot_longer`, `pivot_wider`, `drop_na`, `fill`, `replace_na`, `separate`, `unnest`, `expand`, `complete`
446
+
447
+ **Priority B:**
448
+ `nest`, `unite`, `extract`, `separate_rows`, `uncount`, `nesting`, `crossing`
449
+
450
+ **Priority C:**
451
+ `chop`, `unchop`, `pack`, `unpack`, `full_seq`
452
+
453
+ ### Phase 5: forcats API
454
+ Estimated: ~34 verbs, 5-6 files
455
+
456
+ All medium/low priority. Only needed when users work with categoricals heavily.
457
+
458
+ ---
459
+
460
+ ## 5. Summary Counts
461
+
462
+ | API Group | Total | Done | Remaining | Phase Estimate |
463
+ |-----------|-------|------|-----------|----------------|
464
+ | dplyr | 115 | 22 | 93 | Phase 1 |
465
+ | base | 183 | 0 | 183 | Phase 2 |
466
+ | tibble | 14 | 0 | 14 | Phase 3 |
467
+ | tidyr | 21 | 0 | 21 | Phase 4 |
468
+ | forcats | 34 | 0 | 34 | Phase 5 |
469
+ | misc | 2 | 2 | 0 | Done |
470
+ | **TOTAL** | **369** | **24** | **345** | |
471
+
472
+ ---
473
+
474
+ ## 6. Implementation Strategy Notes
475
+
476
+ 1. **dplyr Phase 1A verbs (~30)** should be first. These are what users hit constantly: `n()`, ranking functions, `if_else`, `case_when`, `lead`/`lag`, tidyselect helpers, `across`, `slice_*`, `relocate`/`rename`.
477
+
478
+ 2. **base API Phase 2A verbs (~40)** are needed because dplyr verb expressions call base functions: `mean(x)`, `sum(x)`, `paste(x, y)`, `is_na(x)`, etc. Without these, mutate/summarise/filter expressions can't use basic math/string operations.
479
+
480
+ 3. Each backend module follows the same pattern: import the verb from `datar.dplyr` (or `datar.base`, etc.), register for Tibble with `@verb.register(Tibble, context=Context.PENDING, backend="polars")`, convert to polars expressions.
481
+
482
+ 4. For base API functions, polars has native equivalents: `pl.col("x").mean()` for mean, `pl.col("x").str.to_uppercase()` for toupper, etc. These are straightforward.
483
+
484
+ 5. The existing datar-numpy implementations can serve as algorithms for edge cases, but most functions have direct polars equivalents.
485
+
486
+ 6. Reference implementation: datar-pandas at `/root/workspace/datar-pandas/datar_pandas/api/` has working implementations for ALL of these verbs that can be ported.