semvec/pypi-packages huggingface dataset:
flask-simplebook 0.6.1
flask app for SimpleBook

# flask-simplebook

This is the flask companion application to the SimpleBook MediaWiki extension.

It handles all the administration of pdf creation.  To that end, it is comprised of
two parts:

* A flask webserver to communicate with mediawiki
* A rq worker task to manage mw2pdf

# Installation

## Pre-requisistes

The API uses [redis](https://redis.io/) and expects you to have a redis server running on `localhost:6379`.
Install through whatever means is best for your organization, but on debian based systems, installing
via apt and starting as part of services is sufficient:

```
$ apt install redis
```

## Installing from pypi

From a directory where you want to host the project, install via pipenv:

```
$ pipenv install flask-simplebook
$ pipenv install gunicorn
```

## Configuring

Configuration is done via environment variables.  The following are available:

* `SIMPLE_BOOK_DATA_DIR` - The directory where created pdfs should be stored
* `SIMPLE_BOOK_FONT` - An optional font location on disk for the title page fonts. **Note:** Fonts for
  the wiki pages are handled by the css (and webfonts) configured in mediawiki.  This only handles
  fonts for the title page and headers of the pages.  SimpleBook ships with the free Roboto and SourceCodepro
  fonts, and so proprietary and other fonts need to be managed by the sysadmin
* `SIMPLE_BOOK_LOGO` - An optional logo for the title page of the books.  Should point to a place on
  disk that can be accessed by mw2pdf

## Running

Start the flask server:

```
$ pipenv run gunicorn --bind 127.0.0.1:3333 simplebook.wsgi:app
```

And also the rq worker:

```
$ pipenv run rq worker
```

# Developing

When running in development, install from the local Pipfile:

```
$ cd flask-simplebook
$ pipenv install
```

And then start as above in two terminals:

```
$ pipenv run gunicorn --bind 127.0.0.1:3333 simplebook.wsgi:app
$ pipenv run rq worker
```

You can also install via to another directory via `pipenv install -e`
imax 0.0.1b11
Image augmentation library for Jax
Requires Python: >=3.8

# imax
![tests](https://github.com/4rtemi5/imax/workflows/tests/badge.svg)
[![PyPI version](https://img.shields.io/pypi/v/imax.svg)](https://pypi.python.org/pypi/imax/)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/112GaTnKDi-54eUIoXCREOZ_GuPAKNish?usp=sharing)

Image augmentation library for Jax.

![sample_images](https://raw.githubusercontent.com/4rtemi5/imax/master/images/samples.png)

## Installation

```bash
pip install imax
```

## Usage

```python
from jax import random
import jax.numpy as jnp
from PIL import Image
from matplotlib import pyplot as plt
from mpl_toolkits.axes_grid1 import ImageGrid

from imax import transforms, color_transforms, randaugment

# Setup
random_key = random.PRNGKey(32)
random_key, split_key = random.split(random_key)
image = jnp.asarray(Image.open('./test.jpeg').convert('RGBA')).astype('uint8')

# Geometric transforms:
transform = transforms.rotate(rad=0.7)  # create transformation matrix
transformed_image = transforms.apply_transform(image,    # apply transformation
                                               transform,
                                               mask_value=jnp.array([0, 0, 0, 255]))

# multiple transformations can be combined through matrix multiplication
# this makes multiple sequential transforms much faster
multi_transform = transform @ transform @ transform
multi_transformed_image = transforms.apply_transform(image,
                                                     multi_transform,
                                                     mask_value=-1)

# Color transforms:
adjusted_image = color_transforms.posterize(image, bits=2)

# Randaugment:
randomized_image = randaugment.distort_image_with_randaugment(
    image,
    num_layers=3,   # number of random augmentations in sequence
    magnitude=10,   # magnitude of random augmentations
    random_key=split_key
)

# Show results:
results = [transformed_image, multi_transformed_image, adjusted_image, randomized_image]
fig = plt.figure(figsize=(10., 10.))
grid = ImageGrid(fig, 111,
                 nrows_ncols=(2, 2),
                 axes_pad=0.1)

for ax, im in zip(grid, results):
    ax.axis('off')
    ax.imshow(im)
plt.show()

```