semvec/pypi-packages huggingface dataset:
squircle 0.2.2
Stretch circles into squares and squish squares into circles
License: MIT
Requires Python: >=3.6

[`squircle.py`](https://pypi.org/project/squircle/) is a Python utility for
stretching circles into squares and squishing squares into circles. It requires
Python 3.6 or later.

## Installation

```sh
pip install squircle
```

## Usage:

```python
import numpy as np
from PIL import Image

from squircle import to_circle, to_square

square = np.asarray(Image.open('some-square-image.jpg'))
circle = to_circle(square)
and_back_to_square = to_square(circle)
```

there's 3 stretching methods you can choose from

```python
>>> from squircle import methods
>>> list(methods.keys())
['fgs', 'stretch', 'elliptical']
>>> circle = to_circle(square, method='elliptical')
```

### Stretching methods

#### Fernández-Guasti squircle (`fgs`)

The Fernández-Guasti squircle is used by default.

https://squircular.blogspot.com/2015/09/fernandez-guastis-squircle.html

http://mathworld.wolfram.com/Squircle.html

#### Simple Stretching (`stretch`)

This method "just linearly stretches each point radially so that the rim of the circle matches the rim of the square".

https://squircular.blogspot.com/2015/09/elliptical-arc-mapping.html

#### Elliptical grid mapping (`elliptical`)

"The way I went about this was to think of a line of constant x (as well as a line of constant y) getting mapped to an ellipse in the circle"

https://mathproofs.blogspot.com/2005/07/mapping-square-to-circle.html

https://squircular.blogspot.com/2015/09/mapping-circle-to-square.html

#### Schwarz-Christoffel conformal mapping

`raise NotImplementedError`. The math is difficult.

https://squircular.blogspot.com/2015/09/schwarz-christoffel-mapping.html

http://jcgt.org/published/0005/02/01/

## Development

After `pip install tox` you can run squircle's (limited) test set with

```sh
tox
```

On Ubuntu, you also need the following dependencies for numpy and matplotlib

```sh
sudo apt install python3-dev libjpeg-dev zlib1g-dev libfreetype6-dev
```

You can visually inspect the transformations by uncommenting the matplotlib code in `test_squircle.py` and then invoking the tests directly with `pytest` instead of tox

``` sh
pytest
```

but you'll need to install the dependencies of the tests manually, which you can do with `pip install pytest numpy matplotlib pillow`.

## TODOs

If you would like to help with this project, [the open issues on GitHub](https://github.com/verhovsky/squircle/issues) should list some ideas.

## Credits

This code is converted from the C++ sources on Chamberlain Fong's blog posts, which (I think) are based on his paper [Analytical Methods for Squaring the Disc (2014)](https://arxiv.org/ftp/arxiv/papers/1509/1509.06344.pdf).

The square image in `test_images/` is https://commons.wikimedia.org/wiki/File:Graph-paper.svg and the circle is taken from Chamberlain Fong's blog posts.
lilies 0.3.2
A tool for creating colorful, formatted command line output
License: MIT
Requires Python: >=3.5

# Lilies

[![Build Status](https://travis-ci.org/mrz1988/lilies.svg?branch=master)](https://travis-ci.org/mrz1988/lilies)
[![Code Coverage](https://codecov.io/gh/mrz1988/lilies/branch/master/graphs/badge.svg)](https://codecov.io/gh/mrz1988/lilies/branch/master)

Lilies is currently in beta. Parts of the API are subject to change.

Lilies is a cross-platform, CLI text formatting and coloring tool for python. It automatically adjusts support for any console, including old Windows support powered by [colorama](https://pypi.org/project/colorama/). Lilies will attempt to reproduce the original colors as close as possible, regardless of the current terminal's capabilities.

Lilies is supported on python 3.5, 3.6, 3.7, and 3.8.

![Console demo](https://raw.githubusercontent.com/mrz1988/lilies/master/static/demo.svg)

## Getting started
Install us via [pip](https://pypi.org/project/lilies/)!
```
pip install lilies
```

To test color support in your console:
```python
>>> import lilies
>>> lilies.print_test()
```

Here's what that looks like in true color terminals:

![Console demo true color](https://raw.githubusercontent.com/mrz1988/lilies/master/static/truecolor.svg)


And in 256 color terminals:

![Console demo 256 color](https://raw.githubusercontent.com/mrz1988/lilies/master/static/256color.svg)

## Alternatives

| Library | 256 Color Support | True Color Support | Windows Support | Platform-specific coloring | len() adjustments | Formatting tools |
|----|----|----|----|----|----|----|
|lilies|✅|✅|✅|✅|✅|✅|
|[colorful](https://github.com/timofurrer/colorful)|✅|✅|⚠️|✅|✅|❌|
|[colored](https://pypi.org/project/colored/)|✅|❌|❌|❌|❌|❌|
|[colorama](https://github.com/tartley/colorama)|❌|❌|✅|❌|❌|❌|
|[termcolor](https://pypi.org/project/termcolor/)|❌|❌|❌|❌|❌|❌|

⚠️: colorful has newer Windows 10 support, but no support for old versions.

## Contributing
You can find information about contributing [here](https://github.com/mrz1988/lilies/blob/master/docs/contributing.rst)

## License
[MIT](https://github.com/mrz1988/lilies/blob/master/LICENSE)