Skip to content

Commit

Permalink
Tweaked README; lowered version; included pypi test
Browse files Browse the repository at this point in the history
  • Loading branch information
miek770 committed Nov 16, 2024
1 parent b919dec commit 9ae0f75
Show file tree
Hide file tree
Showing 6 changed files with 649 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12
3.10
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ VERSION = $(shell grep '^version =' pyproject.toml | sed -E 's/version = "(.*)"/
info:
@echo $(NAME), version $(VERSION)

publish:
uv run twine upload -r pypi dist/*

tests:
uv run python -m pytest

.PHONY: info tests
.PHONY: info publish tests
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# eznbtemplater

Generate PDF and [Jupyter Notebook](https://jupyter.org/) files from a notebook template (`.ipynb` file).
As in ***easy notebook templater***.

I made this small and simple library to facilitate the creation of professionnal looking reports and calculation notes programatically, without having to learn extensive templating engines or mess with more [LaTeX](https://www.latex-project.org/) than desired. My previous attempts of accomplishing this goal involved using existing packages that did not yield satisfactory results for [pandas DataFrames](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html).
Generates PDF and [Jupyter Notebook](https://jupyter.org/) files from a notebook template (`.ipynb` file).

I made this small and simple library to facilitate the creation of professionnal looking reports and calculation notes programatically, without having to learn extensive templating engines or mess with more [LaTeX](https://www.latex-project.org/) than desired. My previous attempts of accomplishing this goal involved using existing packages that did not yield satisfactory results for [pandas DataFrames](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html). This one does!

## Installation

Install the package from [PyPI](https://pypi.org/) with `pip` using:
Install the package from [PyPI](https://pypi.org/) with [pip](https://pypi.org/project/pip/) using:

```
pip install eznbtemplater
Expand Down
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[project]
name = "eznbtemplater"
version = "0.1.0"
version = "0.1.1"
description = "Generate PDF and Jupyter Notebook files from a Notebook template"
readme = "README.md"
requires-python = ">=3.12"
requires-python = ">=3.10"
dependencies = [
"nbconvert>=7.16.4",
"nbformat>=5.10.4",
Expand All @@ -21,10 +21,15 @@ build-backend = "hatchling.build"
[tool.uv]
dev-dependencies = [
"black>=24.10.0",
"eznbtemplater",
"pandas-stubs>=2.2.3.241009",
"pandas>=2.2.3",
"pre-commit>=4.0.1",
"pytest>=8.3.3",
"tabulate>=0.9.0",
"twine>=5.1.1",
]
package = true

[tool.uv.sources]
eznbtemplater = { workspace = true }
19 changes: 19 additions & 0 deletions tests/test_from_pypi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pandas as pd
from pathlib import Path
from eznbtemplater import render_nb


def test_markdown_nb() -> None:
template_path: Path = Path("eznbtemplater/templates/calculation_note.ipynb")
assert template_path.exists()

output_path: Path = Path("tests/test_markdown_nb.ipynb")

introduction: str = "This is a ***test***, don't mind me."
render_nb(
template_path=template_path,
output_path=output_path,
introduction=introduction,
introduction_cell_type="markdown",
)
assert output_path.exists()
Loading

0 comments on commit 9ae0f75

Please sign in to comment.