diff --git a/docs/api-reference/api-completeness.md b/docs/api-reference/api-completeness.md new file mode 100644 index 000000000..7a3c95dc3 --- /dev/null +++ b/docs/api-reference/api-completeness.md @@ -0,0 +1,205 @@ +# API Completeness + +Narwhals has two different level of support for libraries: "full" and "interchange". + +Libraries for which we have full support we intend to support the whole Narwhals API, however this is a work in progress. + +In the following table it is possible to check which method is implemented for which backend. + +!!! info + + - "pandas-like" means pandas, cuDF and Modin + - Polars supports all the methods (by design) + +| class | method | pandas-like | arrow | +|-------------------------|--------------------|--------------------|--------------------| +| DataFrame | clone | :white_check_mark: | :white_check_mark: | +| DataFrame | collect_schema | :white_check_mark: | :white_check_mark: | +| DataFrame | columns | :white_check_mark: | :white_check_mark: | +| DataFrame | drop | :white_check_mark: | :white_check_mark: | +| DataFrame | drop_nulls | :white_check_mark: | :white_check_mark: | +| DataFrame | filter | :white_check_mark: | :white_check_mark: | +| DataFrame | get_column | :white_check_mark: | :white_check_mark: | +| DataFrame | group_by | :white_check_mark: | :white_check_mark: | +| DataFrame | head | :white_check_mark: | :white_check_mark: | +| DataFrame | is_duplicated | :white_check_mark: | :x: | +| DataFrame | is_empty | :white_check_mark: | :white_check_mark: | +| DataFrame | is_unique | :white_check_mark: | :x: | +| DataFrame | item | :white_check_mark: | :white_check_mark: | +| DataFrame | iter_rows | :white_check_mark: | :x: | +| DataFrame | join | :white_check_mark: | :white_check_mark: | +| DataFrame | lazy | :white_check_mark: | :white_check_mark: | +| DataFrame | null_count | :white_check_mark: | :white_check_mark: | +| DataFrame | pipe | :x: | :x: | +| DataFrame | rename | :white_check_mark: | :white_check_mark: | +| DataFrame | rows | :white_check_mark: | :white_check_mark: | +| DataFrame | schema | :white_check_mark: | :white_check_mark: | +| DataFrame | select | :white_check_mark: | :white_check_mark: | +| DataFrame | shape | :white_check_mark: | :white_check_mark: | +| DataFrame | sort | :white_check_mark: | :white_check_mark: | +| DataFrame | tail | :white_check_mark: | :white_check_mark: | +| DataFrame | to_dict | :white_check_mark: | :white_check_mark: | +| DataFrame | to_numpy | :white_check_mark: | :white_check_mark: | +| DataFrame | to_pandas | :white_check_mark: | :white_check_mark: | +| DataFrame | unique | :white_check_mark: | :x: | +| DataFrame | with_columns | :white_check_mark: | :white_check_mark: | +| DataFrame | with_row_index | :white_check_mark: | :white_check_mark: | +| DataFrame | write_parquet | :white_check_mark: | :white_check_mark: | +| Expr | abs | :white_check_mark: | :white_check_mark: | +| Expr | alias | :white_check_mark: | :white_check_mark: | +| Expr | all | :white_check_mark: | :white_check_mark: | +| Expr | any | :white_check_mark: | :white_check_mark: | +| Expr | cast | :white_check_mark: | :white_check_mark: | +| Expr | cat | :white_check_mark: | :x: | +| Expr | count | :white_check_mark: | :white_check_mark: | +| Expr | cum_sum | :white_check_mark: | :white_check_mark: | +| Expr | diff | :white_check_mark: | :white_check_mark: | +| Expr | drop_nulls | :white_check_mark: | :x: | +| Expr | dt | :white_check_mark: | :white_check_mark: | +| Expr | fill_null | :white_check_mark: | :x: | +| Expr | filter | :white_check_mark: | :white_check_mark: | +| Expr | head | :white_check_mark: | :white_check_mark: | +| Expr | is_between | :white_check_mark: | :x: | +| Expr | is_duplicated | :white_check_mark: | :x: | +| Expr | is_first_distinct | :white_check_mark: | :x: | +| Expr | is_in | :white_check_mark: | :x: | +| Expr | is_last_distinct | :white_check_mark: | :x: | +| Expr | is_null | :white_check_mark: | :x: | +| Expr | is_unique | :white_check_mark: | :x: | +| Expr | len | :white_check_mark: | :x: | +| Expr | max | :white_check_mark: | :white_check_mark: | +| Expr | mean | :white_check_mark: | :white_check_mark: | +| Expr | min | :white_check_mark: | :white_check_mark: | +| Expr | n_unique | :white_check_mark: | :x: | +| Expr | null_count | :white_check_mark: | :white_check_mark: | +| Expr | over | :white_check_mark: | :x: | +| Expr | quantile | :white_check_mark: | :x: | +| Expr | round | :white_check_mark: | :x: | +| Expr | sample | :white_check_mark: | :x: | +| Expr | shift | :white_check_mark: | :x: | +| Expr | sort | :white_check_mark: | :x: | +| Expr | std | :white_check_mark: | :white_check_mark: | +| Expr | str | :white_check_mark: | :white_check_mark: | +| Expr | sum | :white_check_mark: | :white_check_mark: | +| Expr | tail | :white_check_mark: | :white_check_mark: | +| Expr | unique | :white_check_mark: | :x: | +| ExprCatNamespace | get_categories | :white_check_mark: | :x: | +| ExprDateTimeNamespace | day | :white_check_mark: | :x: | +| ExprDateTimeNamespace | hour | :white_check_mark: | :x: | +| ExprDateTimeNamespace | microsecond | :white_check_mark: | :x: | +| ExprDateTimeNamespace | millisecond | :white_check_mark: | :x: | +| ExprDateTimeNamespace | minute | :white_check_mark: | :x: | +| ExprDateTimeNamespace | month | :white_check_mark: | :x: | +| ExprDateTimeNamespace | nanosecond | :white_check_mark: | :x: | +| ExprDateTimeNamespace | ordinal_day | :white_check_mark: | :x: | +| ExprDateTimeNamespace | second | :white_check_mark: | :x: | +| ExprDateTimeNamespace | to_string | :white_check_mark: | :white_check_mark: | +| ExprDateTimeNamespace | total_microseconds | :white_check_mark: | :x: | +| ExprDateTimeNamespace | total_milliseconds | :white_check_mark: | :x: | +| ExprDateTimeNamespace | total_minutes | :white_check_mark: | :x: | +| ExprDateTimeNamespace | total_nanoseconds | :white_check_mark: | :x: | +| ExprDateTimeNamespace | total_seconds | :white_check_mark: | :x: | +| ExprDateTimeNamespace | year | :white_check_mark: | :x: | +| ExprStringNamespace | contains | :white_check_mark: | :x: | +| ExprStringNamespace | ends_with | :white_check_mark: | :x: | +| ExprStringNamespace | head | :x: | :x: | +| ExprStringNamespace | slice | :white_check_mark: | :x: | +| ExprStringNamespace | starts_with | :white_check_mark: | :x: | +| ExprStringNamespace | tail | :x: | :x: | +| ExprStringNamespace | to_datetime | :white_check_mark: | :x: | +| ExprStringNamespace | to_lowercase | :white_check_mark: | :white_check_mark: | +| ExprStringNamespace | to_uppercase | :white_check_mark: | :white_check_mark: | +| LazyFrame | clone | :white_check_mark: | :white_check_mark: | +| LazyFrame | collect | :white_check_mark: | :white_check_mark: | +| LazyFrame | collect_schema | :white_check_mark: | :white_check_mark: | +| LazyFrame | columns | :white_check_mark: | :white_check_mark: | +| LazyFrame | drop | :white_check_mark: | :white_check_mark: | +| LazyFrame | drop_nulls | :white_check_mark: | :white_check_mark: | +| LazyFrame | filter | :white_check_mark: | :white_check_mark: | +| LazyFrame | group_by | :white_check_mark: | :white_check_mark: | +| LazyFrame | head | :white_check_mark: | :white_check_mark: | +| LazyFrame | join | :white_check_mark: | :white_check_mark: | +| LazyFrame | lazy | :white_check_mark: | :white_check_mark: | +| LazyFrame | pipe | :x: | :x: | +| LazyFrame | rename | :white_check_mark: | :white_check_mark: | +| LazyFrame | schema | :white_check_mark: | :white_check_mark: | +| LazyFrame | select | :white_check_mark: | :white_check_mark: | +| LazyFrame | sort | :white_check_mark: | :white_check_mark: | +| LazyFrame | tail | :white_check_mark: | :white_check_mark: | +| LazyFrame | unique | :white_check_mark: | :x: | +| LazyFrame | with_columns | :white_check_mark: | :white_check_mark: | +| LazyFrame | with_row_index | :white_check_mark: | :white_check_mark: | +| Series | abs | :white_check_mark: | :white_check_mark: | +| Series | alias | :white_check_mark: | :white_check_mark: | +| Series | all | :white_check_mark: | :white_check_mark: | +| Series | any | :white_check_mark: | :white_check_mark: | +| Series | cast | :white_check_mark: | :white_check_mark: | +| Series | cat | :white_check_mark: | :white_check_mark: | +| Series | count | :white_check_mark: | :white_check_mark: | +| Series | cum_sum | :white_check_mark: | :white_check_mark: | +| Series | diff | :white_check_mark: | :white_check_mark: | +| Series | drop_nulls | :white_check_mark: | :x: | +| Series | dt | :white_check_mark: | :white_check_mark: | +| Series | dtype | :white_check_mark: | :white_check_mark: | +| Series | fill_null | :white_check_mark: | :x: | +| Series | filter | :white_check_mark: | :white_check_mark: | +| Series | head | :white_check_mark: | :white_check_mark: | +| Series | is_between | :white_check_mark: | :x: | +| Series | is_duplicated | :white_check_mark: | :x: | +| Series | is_empty | :white_check_mark: | :white_check_mark: | +| Series | is_first_distinct | :white_check_mark: | :x: | +| Series | is_in | :white_check_mark: | :x: | +| Series | is_last_distinct | :white_check_mark: | :x: | +| Series | is_null | :white_check_mark: | :x: | +| Series | is_sorted | :white_check_mark: | :x: | +| Series | is_unique | :white_check_mark: | :x: | +| Series | item | :white_check_mark: | :white_check_mark: | +| Series | len | :white_check_mark: | :x: | +| Series | max | :white_check_mark: | :white_check_mark: | +| Series | mean | :white_check_mark: | :white_check_mark: | +| Series | min | :white_check_mark: | :white_check_mark: | +| Series | n_unique | :white_check_mark: | :x: | +| Series | name | :white_check_mark: | :white_check_mark: | +| Series | null_count | :white_check_mark: | :white_check_mark: | +| Series | quantile | :white_check_mark: | :x: | +| Series | round | :white_check_mark: | :x: | +| Series | sample | :white_check_mark: | :x: | +| Series | shape | :white_check_mark: | :white_check_mark: | +| Series | shift | :white_check_mark: | :x: | +| Series | sort | :white_check_mark: | :x: | +| Series | std | :white_check_mark: | :white_check_mark: | +| Series | str | :white_check_mark: | :white_check_mark: | +| Series | sum | :white_check_mark: | :white_check_mark: | +| Series | tail | :white_check_mark: | :white_check_mark: | +| Series | to_frame | :white_check_mark: | :x: | +| Series | to_list | :white_check_mark: | :white_check_mark: | +| Series | to_numpy | :white_check_mark: | :white_check_mark: | +| Series | to_pandas | :white_check_mark: | :x: | +| Series | unique | :white_check_mark: | :x: | +| Series | value_counts | :white_check_mark: | :x: | +| Series | zip_with | :white_check_mark: | :x: | +| SeriesCatNamespace | get_categories | :white_check_mark: | :white_check_mark: | +| SeriesDateTimeNamespace | day | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | hour | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | microsecond | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | millisecond | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | minute | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | month | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | nanosecond | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | ordinal_day | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | second | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | to_string | :white_check_mark: | :white_check_mark: | +| SeriesDateTimeNamespace | total_microseconds | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | total_milliseconds | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | total_minutes | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | total_nanoseconds | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | total_seconds | :white_check_mark: | :x: | +| SeriesDateTimeNamespace | year | :white_check_mark: | :x: | +| SeriesStringNamespace | contains | :white_check_mark: | :x: | +| SeriesStringNamespace | ends_with | :white_check_mark: | :x: | +| SeriesStringNamespace | head | :x: | :x: | +| SeriesStringNamespace | slice | :white_check_mark: | :x: | +| SeriesStringNamespace | starts_with | :white_check_mark: | :x: | +| SeriesStringNamespace | tail | :x: | :x: | +| SeriesStringNamespace | to_lowercase | :white_check_mark: | :white_check_mark: | +| SeriesStringNamespace | to_uppercase | :white_check_mark: | :white_check_mark: | \ No newline at end of file diff --git a/docs/extending.md b/docs/extending.md index 3c57aed16..fd303f33e 100644 --- a/docs/extending.md +++ b/docs/extending.md @@ -6,11 +6,15 @@ Currently, Narwhals supports the following libraries as inputs: - Polars - cuDF - Modin +- PyArrow (partial support) If you want your own library to be recognised too, you're welcome open a PR (with tests)! Alternatively, if you can't do that (for example, if you library is closed-source), see the next section for what else you can do. +To check which methods are supported for which backend in depth, please refer to the +[API completeness page](api-reference/api-completeness.md). + ## Extending Narwhals We love open source, but we're not "open source absolutists". If you're unable to open diff --git a/docs/levels.md b/docs/levels.md index d632baa6d..bfa580f1a 100644 --- a/docs/levels.md +++ b/docs/levels.md @@ -28,6 +28,8 @@ level of support. If a library implements the a call such as ```python exec="1" source="above" +from typing import Any + import narwhals as nw from narwhals.schema import Schema diff --git a/mkdocs.yml b/mkdocs.yml index 891e96ed6..9908a029a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -39,6 +39,7 @@ nav: - api-reference/index.md - api-reference/selectors.md - api-reference/typing.md + - api-reference/api-completeness.md theme: name: material font: false @@ -67,6 +68,7 @@ theme: toggle: icon: material/brightness-4 name: Switch to system preference + plugins: - search - mkdocstrings: @@ -76,8 +78,11 @@ plugins: - https://installer.readthedocs.io/en/stable/objects.inv rendering: show_signature_annotations: true + markdown_extensions: +- admonition - md_in_html +- pymdownx.details - pymdownx.tabbed: alternate_style: true - pymdownx.superfences: @@ -86,3 +91,6 @@ markdown_extensions: class: python validator: !!python/name:markdown_exec.validator format: !!python/name:markdown_exec.formatter +- pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg