Skip to content

[docs] add Python client documentation#2461

Merged
leekeiabstraction merged 7 commits intoapache:mainfrom
Prajwal-banakar:docs-python-client
Mar 22, 2026
Merged

[docs] add Python client documentation#2461
leekeiabstraction merged 7 commits intoapache:mainfrom
Prajwal-banakar:docs-python-client

Conversation

@Prajwal-banakar
Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #2447

The purpose of this change is to add comprehensive documentation for the Fluss Python Client. This ensures that Python users have a dedicated guide that mirrors the structure of the existing Java Client documentation while highlighting Python-specific features like PyArrow and Pandas integration.

Brief change log

This pull request introduces the following changes:

New Documentation File: Created website/docs/apis/python-client.md which includes sections for Installation, Initialization, Admin API, and Table API.

Code Examples: Added asynchronous Python code snippets demonstrating how to connect to a cluster, manage databases/tables, and perform high-performance data writing and scanning.

Ecosystem Integration: Documented the native support for PyArrow Tables and Pandas DataFrames, providing users with idiomatic ways to handle data in Python.

Sidebar Alignment: Set the sidebar_position to 2 to ensure the Python Client appears immediately after the Java Client in the API documentation hierarchy.

Build Consistency: Updated website/package-lock.json to reflect the environment-specific dependency tree used during local verification of the documentation site.

Tests

Manual Verification: The documentation was built and verified locally using the Docusaurus development server (npm run start).
Visual Check: Confirmed that all code blocks render correctly, syntax highlighting is active, and the sidebar navigation is correctly ordered.
Before
Screenshot 2026-01-23 224516

After changes
Screenshot 2026-01-23 224437

API and Format

This change does not affect any existing public Java APIs or storage formats; it is strictly a documentation addition for the Python Client.

Documentation

This PR introduces a new documentation page for the Fluss Python Client.

@Prajwal-banakar
Copy link
Copy Markdown
Contributor Author

Hi @polyzos , the build failed due to a NotLeaderOrFollowerException in FlussTableITCase, which seems unrelated to my documentation changes. Could you please review this PR and trigger a re-run?

Copy link
Copy Markdown
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TY for the PR. Added some comments/questions. PTAL!


# Create configuration
conf = Configuration()
conf.set_string("bootstrap.servers", "localhost:9123")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment here to adjust according to where Fluss is running

To use the Fluss Python client, you need to install the `fluss-python` package.

```bash
pip install fluss-python
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a frequent python user, but is fluss-python available publicly?

https://pypi.org/search/?q=fluss-python

python-workspace % pip install fluss-python
ERROR: Could not find a version that satisfies the requirement fluss-python (from versions: none)
ERROR: No matching distribution found for fluss-python         

Comment on lines +43 to +44
table = connection.get_table("my_db.my_table")
print(table.get_table_info())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this follows the Java API flow, should we consider a flow that does not cause error as user follow it? If the server is a fresh one, would an Error occur here?

Comment on lines +53 to +56
conf.set_string("client.security.protocol", "sasl")
conf.set_string("client.security.sasl.mechanism", "PLAIN")
conf.set_string("client.security.sasl.username", "alice")
conf.set_string("client.security.sasl.password", "alice-secret")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm if these are currently honoured?

@Prajwal-banakar
Copy link
Copy Markdown
Contributor Author

Hi @leekeiabstraction, I have addressed all your feedback:

Updated the Installation section to point to the bindings/python directory in the fluss-rust repository.

Reordered the documentation so the Admin API (resource creation) comes before the Table API (usage) to ensure a smooth flow for fresh clusters.

Added the requested code comments to the initialization examples.

Verified the SASL configuration keys against the standard client setup.

PTAL when you have a chance. Thanks!"

Copy link
Copy Markdown
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Prajwal for the update. Left further comments. PTAL!

@@ -0,0 +1,213 @@
---
title: "Python Client"
sidebar_position: 2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sidebar position 2 clashes with current position for Client Support Matrix. Update Client Support Matrix's to be larger.

* **Table API**: For reading from and writing to Fluss tables.

## Installation
The Fluss Python client is provided as bindings within the Rust client repository. To install it from source:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might change soon if we decide to release artefacts for 0.1.0.

nit: The Fluss Python client is currently...

The `Connection` object is the entry point for interacting with Fluss. It is created using `Connection.create()` and requires a configuration dictionary.

```python
from fluss.client import Connection
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a Python expert, but I run into the following error when importing the client package in python interpreter. (I'm on Mac). Am I missing something?

keithlee@--- python % pip install .
Processing /Users/keithlee/IdeaProjects/f/fluss-rust/bindings/python
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pandas>=2.3.1 (from fluss==0.1.0)
  Downloading pandas-3.0.0-cp314-cp314-macosx_11_0_arm64.whl.metadata (79 kB)
Collecting pyarrow>=10.0.0 (from fluss==0.1.0)
  Downloading pyarrow-23.0.0-cp314-cp314-macosx_12_0_arm64.whl.metadata (3.0 kB)
Collecting numpy>=2.3.3 (from pandas>=2.3.1->fluss==0.1.0)
  Downloading numpy-2.4.1-cp314-cp314-macosx_14_0_arm64.whl.metadata (6.6 kB)
Collecting python-dateutil>=2.8.2 (from pandas>=2.3.1->fluss==0.1.0)
  Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting six>=1.5 (from python-dateutil>=2.8.2->pandas>=2.3.1->fluss==0.1.0)
  Downloading six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
Downloading pandas-3.0.0-cp314-cp314-macosx_11_0_arm64.whl (9.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.9/9.9 MB 29.6 MB/s  0:00:00
Downloading numpy-2.4.1-cp314-cp314-macosx_14_0_arm64.whl (5.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.2/5.2 MB 45.2 MB/s  0:00:00
Downloading pyarrow-23.0.0-cp314-cp314-macosx_12_0_arm64.whl (34.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 34.2/34.2 MB 54.9 MB/s  0:00:00
Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Downloading six-1.17.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: fluss
  Building wheel for fluss (pyproject.toml) ... done
  Created wheel for fluss: filename=fluss-0.1.0-cp314-cp314-macosx_11_0_arm64.whl size=4188845 sha256=bd436c60504f8b6e3e90775706d3f70227814149c080e85a836f5ff4387a11a8
  Stored in directory: /private/var/folders/47/2p97sbt51xgdsqym52gn7cj80000gn/T/pip-ephem-wheel-cache-wg1s_vkk/wheels/d9/8f/5e/70d4bdfc4b18344a136d84aaa1fbc6c805c6b9ae074c3169c6
Successfully built fluss
Installing collected packages: six, pyarrow, numpy, python-dateutil, pandas, fluss
Successfully installed fluss-0.1.0 numpy-2.4.1 pandas-3.0.0 pyarrow-23.0.0 python-dateutil-2.9.0.post0 six-1.17.0

[notice] A new release of pip is available: 25.3 -> 26.0
[notice] To update, run: pip install --upgrade pip
keithlee@--- python % python
Python 3.14.2 (main, Dec 17 2025, 20:54:49) [Clang 21.1.4 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from fluss.client import Connection
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    from fluss.client import Connection
  File "/Users/keithlee/IdeaProjects/f/fluss-rust/bindings/python/fluss/__init__.py", line 18, in <module>
    from ._fluss import *
ModuleNotFoundError: No module named 'fluss._fluss'

@Prajwal-banakar
Copy link
Copy Markdown
Contributor Author

Hi @leekeiabstraction I've updated the sidebar position to 3 and adjusted the installation text as suggested. I also added a note block explaining the ModuleNotFoundError. It happens because running the interpreter inside the bindings/python directory makes Python prioritize the local folder over the installed binary. Moving out of the directory fixes it. PTAL!

@leekeiabstraction
Copy link
Copy Markdown
Contributor

Thank you Prajwal for updating the PR!

There has been newer changes on the python API side, can you update accordingly?

Reference: apache/fluss-rust#291

Note that your PR's current structure should be left as is, but also provide a link to the more comprehensive doc on rust client repo

@Prajwal-banakar
Copy link
Copy Markdown
Contributor Author

Hi @leekeiabstraction , I have completed a full sync of the Python Client documentation with the recently merged changes in apache/fluss-rust#291 Looking forward to your feedback!

Copy link
Copy Markdown
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Prajwal-banakar for working on this. I'm thinking that we should do the following:

  1. Move the content of this PR to fluss-rust
  2. Change this pr to point to fluss-rust website.

This approach will ensure that rust/cpp/python docs stay near to client source and is discoverable from main site.

@Prajwal-banakar
Copy link
Copy Markdown
Contributor Author

Hi @leekeiabstraction, I've slimmed down this PR to a lightweight intro page that links to https://clients.fluss.apache.org/user-guide/python/installation for the full reference. The link is currently broken since the fluss-rust site hasn't been deployed yet, but it will resolve once the site goes live. The detailed content is already present in the fluss-rust repo so no separate PR is needed from my side. PTAL!

@leekeiabstraction
Copy link
Copy Markdown
Contributor

TY for the PR Prajwal, I've re-ordered the sections, added more links on the page and removed package-lock.json.

@leekeiabstraction leekeiabstraction merged commit c59c0f1 into apache:main Mar 22, 2026
2 checks passed
@Prajwal-banakar Prajwal-banakar deleted the docs-python-client branch March 23, 2026 08:04
@Prajwal-banakar
Copy link
Copy Markdown
Contributor Author

Thank you for the improvements and merging both PRs! I noticed the C++ Client page is also missing. can i work on it following the same pattern?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] Add documentation for Python Client

2 participants