Skip to content

Commit

Permalink
Merge pull request #43 from pydiverse/api-doku
Browse files Browse the repository at this point in the history
API documentation
  • Loading branch information
finn-rudolph authored Dec 18, 2024
2 parents 58eb515 + 366aa9a commit 62965ba
Show file tree
Hide file tree
Showing 38 changed files with 11,165 additions and 14,581 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# documentation files that are generated on build

docs/**/pydiverse.transform.*.rst

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ repos:
entry: pixi run check-merge-conflict --assume-in-merge
language: system
types: [text]
exclude: ".rst$"
# typos
- id: typos
name: typos
Expand Down
6 changes: 6 additions & 0 deletions docs/source/_templates/autosummary/accessor_method.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ '.'.join(objname.split('.')[-2:]) }}
{{ underline }}

.. currentmodule:: {{ '.'.join(module.split('.')[:2]) }}

.. autoaccessormethod:: {{ (module.split('.')[2:] + [objname]) | join('.') }}
5 changes: 5 additions & 0 deletions docs/source/_templates/autosummary/short_title.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ name | escape | underline}}

.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}
8 changes: 7 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import sphinx.util
from sphinx.ext.napoleon import GoogleDocstring
import sphinx_autosummary_accessors


sys.path.insert(0, os.path.abspath("../../src"))
Expand Down Expand Up @@ -38,8 +39,11 @@
"sphinx.ext.intersphinx",
# "sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx_autosummary_accessors"
]

maximum_signature_line_length = 100

myst_enable_extensions = [
"fieldlist",
"deflist",
Expand All @@ -53,6 +57,8 @@

autosectionlabel_prefix_document = True

toc_object_entries_show_parents = "all"

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"sa": ("https://docs.sqlalchemy.org/en/stable", None),
Expand All @@ -64,7 +70,7 @@
"Config File",
]

templates_path = ["_templates"]
templates_path = ["_templates", sphinx_autosummary_accessors.templates_path]
exclude_patterns = []


Expand Down
54 changes: 11 additions & 43 deletions docs/source/reference/api.rst
Original file line number Diff line number Diff line change
@@ -1,49 +1,17 @@
===
API
===

Core
----

.. automodule:: pydiverse.transform
:members:
:undoc-members:

.. autodata:: pydiverse.transform.λ


Builtin Verbs
-------------

.. automodule:: pydiverse.transform.core.verbs
:members:
:undoc-members:


Operators
---------

.. automodule:: pydiverse.transform.core.ops.aggregate
:members:
.. automodule:: pydiverse.transform.core.ops.logical
:members:
.. automodule:: pydiverse.transform.core.ops.numeric
:members:
.. automodule:: pydiverse.transform.core.ops.string
:members:
.. automodule:: pydiverse.transform.core.ops.window
:members:


Functions
---------

.. automodule:: pydiverse.transform.core.functions
:members:
:undoc-members:
.. toctree::
:maxdepth: 1

verbs
operators/index
targets

Table Implementations
---------------------
Table
-----

.. autoclass:: pydiverse.transform.eager.PandasTableImpl
.. autoclass:: pydiverse.transform.lazy.SQLTableImpl
.. currentmodule:: pydiverse.transform
.. autoclass:: Table
:noindex:
17 changes: 17 additions & 0 deletions docs/source/reference/operators/aggregation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
===========
Aggregation
===========

.. currentmodule:: pydiverse.transform.ColExpr
.. autosummary::
:toctree: _generated/
:nosignatures:
:template: autosummary/short_title.rst

count
all
any
max
mean
min
sum
17 changes: 17 additions & 0 deletions docs/source/reference/operators/arithmetic.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
==========
Arithmetic
==========

.. currentmodule:: pydiverse.transform.ColExpr
.. autosummary::
:toctree: _generated/
:nosignatures:
:template: autosummary/short_title.rst

__add__
__floordiv__
__mul__
__neg__
__pos__
__sub__
__truediv__
22 changes: 22 additions & 0 deletions docs/source/reference/operators/comparison.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
==========
Comparison
==========

.. currentmodule:: pydiverse.transform.ColExpr
.. autosummary::
:toctree: _generated/
:nosignatures:
:template: autosummary/short_title.rst

__eq__
__ge__
__gt__
__le__
__lt__
__ne__
is_inf
is_nan
is_not_inf
is_not_nan
is_not_null
is_null
26 changes: 26 additions & 0 deletions docs/source/reference/operators/datetime.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
===================
Datetime / Duration
===================

.. currentmodule:: pydiverse.transform.ColExpr
.. autosummary::
:toctree: _generated/
:nosignatures:
:template: autosummary/accessor_method.rst

dt.day
dt.day_of_week
dt.day_of_year
dt.hour
dt.microsecond
dt.millisecond
dt.minute
dt.month
dt.second
dt.year
dur.days
dur.hours
dur.microseconds
dur.milliseconds
dur.minutes
dur.seconds
17 changes: 17 additions & 0 deletions docs/source/reference/operators/horizontal_aggregation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
======================
Horizontal Aggregation
======================

.. currentmodule:: pydiverse.transform
.. autosummary::
:toctree: _generated/
:nosignatures:
:template: autosummary/short_title.rst

coalesce
count
all
any
max
min
sum
41 changes: 41 additions & 0 deletions docs/source/reference/operators/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
=================
Column Operations
=================

.. toctree::
:maxdepth: 1
:hidden:

arithmetic
logical
comparison
numerical
string
datetime
aggregation
window
sorting_markers
horizontal_aggregation


.. currentmodule:: pydiverse.transform

.. autoclass:: ColExpr
:no-index:
:members: dtype

.. autosummary::
:toctree: _generated/
:template: autosummary/short_title.rst
:nosignatures:

lit
when

.. autosummary::
:toctree: _generated/
:template: autosummary/short_title.rst
:nosignatures:

ColExpr.cast
ColExpr.map
21 changes: 21 additions & 0 deletions docs/source/reference/operators/logical.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
=======
Logical
=======

.. currentmodule:: pydiverse.transform.ColExpr
.. autosummary::
:toctree: _generated/
:nosignatures:
:template: autosummary/short_title.rst

__and__
__invert__
__or__
__xor__
any
all
is_in
is_not_null
is_null
fill_null
map
21 changes: 21 additions & 0 deletions docs/source/reference/operators/numerical.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
=========
Numerical
=========

.. currentmodule:: pydiverse.transform.ColExpr
.. autosummary::
:toctree: _generated/
:nosignatures:
:template: autosummary/short_title.rst

__pow__
abs
ceil
exp
floor
is_inf
is_nan
is_not_inf
is_not_nan
log
round
14 changes: 14 additions & 0 deletions docs/source/reference/operators/sorting_markers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
===============
Sorting Markers
===============

.. currentmodule:: pydiverse.transform.ColExpr
.. autosummary::
:toctree: _generated/
:nosignatures:
:template: autosummary/short_title.rst

ascending
descending
nulls_first
nulls_last
21 changes: 21 additions & 0 deletions docs/source/reference/operators/string.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
======
String
======

.. currentmodule:: pydiverse.transform.ColExpr
.. autosummary::
:toctree: _generated/
:nosignatures:
:template: autosummary/accessor_method.rst

str.contains
str.ends_with
str.len
str.lower
str.replace_all
str.slice
str.starts_with
str.strip
str.to_date
str.to_datetime
str.upper
21 changes: 21 additions & 0 deletions docs/source/reference/operators/window.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
======
Window
======

.. currentmodule:: pydiverse.transform.ColExpr
.. autosummary::
:toctree: _generated/
:nosignatures:
:template: autosummary/short_title.rst

shift

.. currentmodule:: pydiverse.transform
.. autosummary::
:toctree: _generated/
:nosignatures:
:template: autosummary/short_title.rst

dense_rank
rank
row_number
14 changes: 14 additions & 0 deletions docs/source/reference/targets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
=========================
Backends / Export Targets
=========================

.. currentmodule:: pydiverse.transform
.. autosummary::
:toctree: _generated/
:nosignatures:
:template: autosummary/short_title.rst

DuckDb
Pandas
Polars
SqlAlchemy
Loading

0 comments on commit 62965ba

Please sign in to comment.