semvec/pypi-packages huggingface dataset:
spark-board 1.0.0
Interactive visualization of Spark jobs
Requires Python: >3.6

# `spark-board`: interactive PySpark dataframes visualization

`spark-board` provides an interactive way to analize PySpark data frame execution plans as a static website displaying the transformations DAG.

Check out the [examples](https://alijdens.github.io/spark-board/) for a quick overview of the features (and the corresponding examples source code [here](https://github.com/alijdens/spark-board/tree/v1.0.0/tests/examples/)).

If you intend to develop `spark-board` or run from source, check out the [documentation](https://github.com/alijdens/spark-board/tree/v1.0.0/docs).

## Usage

`spark-board` takes a PySpark data frame and inspects the operations to build the DAG. This usually is the final step of a PySpark script, right before writing it to disk.

### Install `spark-board`

```shell
pip install spark-board
```

### Run `spark-board`

```python
from spark_board.html import dump_dataframe, DefaultSettings

# get the PySpark data frame that will be displayed
df = ...

dump_dataframe(
    df=df,
    output_dir="./spark_board_output",
    overwrite=True,  # overwrite output_dir if it already exists
    default_settings=DefaultSettings(),  # override default settings if desired
)
```

and that's it! `spark-board` will generate a static website in the defined `output_dir` folder. You can now serve the website using any web server and inspect the operations.

You can check out the available default settings [here](https://github.com/alijdens/spark-board/blob/main/spark_board/default_settings.py).

### Serving

`spark-board` is intended to be a live documentation of PySpark scripts. Because of this, it's advisable to run it every time the source code is updated. For example, `spark-board` can be run as part of a CI pipeline and the generated website uploaded to a static website hosting service, like Github or Gitlab pages (we actually do this to [update and serve the examples](https://github.com/alijdens/spark-board/tree/v1.0.0/.github/workflows/deploy-examples.yml) in this repository).
templatex 0.0.2
A jinja2 dialect for latex templating in python.
Requires Python: >=3.8

# TempLatex

[![codecov](https://codecov.io/gh/dataset-sh/templatex/graph/badge.svg?token=dCKh5dbR8W)](https://codecov.io/gh/dataset-sh/templatex)

A jinja2 dialect for latex templating in python.

## Quick Start

```shell
pip install templatex
```

```python
from templatex import Environment
from jinja2 import FileSystemLoader

env = Environment(loader=FileSystemLoader('./template_folder'))
template = env.get_template("chapter.latex")
print(template.render(the="variables", go="here"))
```

## Why not the default jinja2?

jinja2's default escape works great for HTML but is not user-friendly for latex because latex heavily uses curly
brackets {} .

For example, if you want to produce the following latex code:

`x = \frac{b}{c}`

Where b and c will be replaced by an actual number, for example: `{"b": 42, "c": 3}`.

The jinja2 version will be:

```python
from jinja2 import Template

template = """
x = \\frac{{{ b }}}{{"{"}}{{ c }}{{"}"}}
"""
# {{"}"}} will render to }

data = {
    'a': 13,
    'b': 42,
    'c': 3
}

j2_template = Template(template)
print(j2_template.render(data))
```

You will notice that because both latex and jinja2 heavily rely on `{}`, the template string will be populated
with `{}`, make it hard to read and modify.

In `templatex`, we can write the following code:

```python
from templatex import Template

template = """
x = \\frac{@= b =@}{@= c =@}
"""

data = {
    'a': 13,
    'b': 42,
    'c': 3
}

j2_template = Template(template)
print(j2_template.render(data))
```

## What this package changes

### Changed Default Jinja2 configuration.

Template changes jinja2's default configuration to the following:

```python
Enviroment(
    loader,
    trim_blocks=True,
    block_start_string='@@',
    block_end_string='@@',
    variable_start_string='@=',
    variable_end_string='=@',
    autoescape=False,
    comment_start_string='\#{',
    comment_end_string='}',
    line_statement_prefix='%%',
    line_comment_prefix='%#',
)
```

As a result, you only need to adopt the following syntax:

* variable render: `@= var_name =@`
* block logic: `@@ for my_item in my_collection @@`
* comment: `\#{ your comment }`

### Add a latex escape filter

Jinja2, by default, will perform auto HTML escaping on rendered variables, but I couldn't figure out how to change its
default escape filter implementation.
As a result, we disabled this feature and provided a latex escape filter so template authors can manually escape string
variables as needed.

For example:

When rendering `@= my_var =@`, and if `my_var="$5.0"`, the resulting latex code cannot be compiled due to the
unescaped `$` character.
You can use `@= my_var | escape_latex =@`, where the `escape_latex` filter will escape `$` character to valid
latex: `\$`.

### Other features

Since this is still the same jinja2 engine at its core, users should refer to
the [jinja2 site](https://jinja.palletsprojects.com/en/3.0.x/) for documentation on other features.

### Inspiration

I adopted the solution from [this answer on stackoverflow](https://stackoverflow.com/a/55715605), and added some
modifications.
arikedb-tools 1.0.2
Arikedb Python Tools

# Arikedb Python Tools


[![pipeline status](https://gitlab.com/arikedb1/languages-library-support/tools/arikedb-python-tools/badges/main/pipeline.svg)](https://gitlab.com/arikedb1/languages-library-support/tools/arikedb-python-tools/-/commits/main)
[![coverage report](https://gitlab.com/arikedb1/languages-library-support/tools/arikedb-python-tools/badges/main/coverage.svg)](https://gitlab.com/arikedb1/languages-library-support/tools/arikedb-python-tools/-/commits/main)
[![Latest Release](https://gitlab.com/arikedb1/languages-library-support/tools/arikedb-python-tools/-/badges/release.svg)](https://gitlab.com/arikedb1/languages-library-support/tools/arikedb-python-tools/-/releases)