Skip to main content

Dataframe paginator for Streamlit

Project description

📄 Streamlit DataFrame Paginator

A lightweight Streamlit component that displays a paginated table for large DataFrames.
This helps keep your Streamlit apps responsive by showing the data in manageable pages.


✨ Features

  • 🔢 Pagination: Displays data with page navigation, improving usability for large DataFrames.

  • 🌍 Multilingual Support: You can fully customize all pagination labels to any language, including Japanese. For example:

    # Japanese
    labels = {
        "first": "最初",
        "prev": "前へ",
        "next": "次へ",
        "last": "最後",
        "displayed_record": "表示行数:"
    }
    # English
    labels={
        "first": "First",
        "prev": "Previous",
        "next": "Next",
        "last": "Last",
    }
    
  • 📊 Column Sorting: Users can click on any column header to sort the table by that column, toggling between ascending and descending order.

  • ↔️ Horizontal Scrolling: If the DataFrame contains many columns, horizontal scrolling is enabled, so you can easily view all data without layout issues.


Installation

pip install streamlit_dataframe_paginator

Usage

import streamlit as st
from streamlit_dataframe_paginator import st_dataframe_paginator
import pandas as pd

# Example DataFrame
df = pd.DataFrame({
    "Name": ["Alice", "Bob", "Charlie", "David", "Eve", "Frank", "Grace", "Hank"],
    "Score": [85, 92, 88, 70, 95, 60, 75, 90]
})

# Use the paginator
st_dataframe_paginator(
    df,
    page_size=3,
    page_size_options=[3, 5, 10],
    labels={
        "first": "⏮️ First",
        "prev": "◀️ Previous",
        "next": "Next ▶️",
        "last": "Last ⏭️",
    }
)

Parameters

Parameter Type Default Description
data DataFrame Required The DataFrame to paginate
page_size int 10 Number of rows per page
page_size_options list[int] [10, 20, 50] Dropdown options for page size
labels dict Optional Custom labels for navigation buttons

Screenshot

sample

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

st_dataframe_paginator-0.0.3.tar.gz (125.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

st_dataframe_paginator-0.0.3-py3-none-any.whl (125.7 kB view details)

Uploaded Python 3

File details

Details for the file st_dataframe_paginator-0.0.3.tar.gz.

File metadata

  • Download URL: st_dataframe_paginator-0.0.3.tar.gz
  • Upload date:
  • Size: 125.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for st_dataframe_paginator-0.0.3.tar.gz
Algorithm Hash digest
SHA256 109e14c97feb37a1c3533a37d4866bfd3d2c139390ce1d5483ec2e57a5fb5905
MD5 f555b97c767cab6225161fc327291e0f
BLAKE2b-256 6513251649c9d990a48e277ab3ba34c91144fbeeb40c197c74b4d933e820263d

See more details on using hashes here.

File details

Details for the file st_dataframe_paginator-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for st_dataframe_paginator-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 edc64204dacc1124f23aae6dcee0cad0748a9542b8a9526574f4a5a44e99daf4
MD5 601c5c74bf7b29ec234a7f7aede2a56b
BLAKE2b-256 beb452fc3f9a5342a1ad3fe6ddff2d3a2b0963c8d34e3d76f84ef5cce87d4bcd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page