Skip to content

dev branch for next release with several features #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: nok
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

<h1 align="center">pandas-render</h1>

<p align="center">Render <a href="https://github.com/pandas-dev/pandas" target="_pandas">pandas</a> or <a href="https://github.com/pola-rs/polars" target="_pandas">polars</a> DataFrames and Series as HTML tables with flexibility for formatting and styling.</p>
<p align="center">Render <a href="https://github.com/pandas-dev/pandas" target="_pandas">pandas</a> or <a href="https://github.com/pola-rs/polars" target="_polars">polars</a> DataFrames and Series as HTML tables with flexibility for formatting and styling.</p>

<div align="center">

![GitHub Repo stars](https://img.shields.io/github/stars/nok/pandas-render)
![PyPI - License](https://img.shields.io/pypi/l/pandas-render)
[![Ko-fi](https://img.shields.io/badge/Ko--fi-FF5E5B?logo=ko-fi&logoColor=white)](https://ko-fi.com/nok)
[![GitHub License](https://img.shields.io/github/license/nok/sklearn-porter)](LICENSE)

</div>

Expand Down
Empty file added pandas_render/cli/__init__.py
Empty file.
37 changes: 37 additions & 0 deletions pandas_render/cli/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from functools import partial
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path

import typer
from typing_extensions import Annotated

app = typer.Typer()


@app.command()
def render():
print("Render dataframe")


@app.command()
def serve(
host: str = "0.0.0.0",
port: int = 8080,
directory: Annotated[str, Path, typer.Argument()] = Path.cwd(),
):
if not directory:
directory = Path.cwd()

if not isinstance(directory, Path):
directory = Path(directory)

assert directory.exists() and directory.is_dir()

directory = str(directory.resolve().absolute())

handler = partial(SimpleHTTPRequestHandler, directory=directory)
server = ThreadingHTTPServer((host, port), handler)

print(f"Serving files at http://{host}:{port} ... (ctrl+c to stop)")

server.serve_forever()
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ requires-python = ">=3.9"
dependencies = [
"ipython>=7.11.1",
"jinja2>=3.0.0",
"typer>=0.15.2",
]
license = "BSD-3-Clause"
classifiers = [
Expand Down Expand Up @@ -42,6 +43,9 @@ dev = [
"pytest-xdist>=3.6.1",
]

[project.scripts]
pandas = "pandas_render.cli.__main__:app"

[tool.coverage.run]
source = ["pandas_render"]

Expand Down
52 changes: 52 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.