Skip to content

Commit 1c1964c

Browse files
committed
release: 2023
1 parent c1277dd commit 1c1964c

20 files changed

+208
-144
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
rev: v3.3.1
2929
hooks:
3030
- id: pyupgrade
31-
args: [--py37-plus]
31+
args: [--py38-plus]
3232
- repo: https://github.com/boidolr/pre-commit-images
3333
rev: v1.1.0
3434
hooks:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All major and minor version changes will be documented in this file. Details of
44
patch-level version changes can be found in [commit messages](../../commits/master).
55

6+
## 2023 - 2023/01/08
7+
8+
- Add tox config
9+
- Use `playwright` and `install_playwright` in-place of `pyppeteer`
10+
- Seemingly minor perf improvements (~32s vs ~38s)
11+
612
## 2022 - 2022/01/23
713

814
- Improvements to saving gifs

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![PyPI Total Downloads](https://img.shields.io/badge/dynamic/json?style=for-the-badge&label=total%20downloads&query=%24.total_downloads&url=https%3A%2F%2Fapi.pepy.tech%2Fapi%2Fprojects%2Fpylottie)](https://pepy.tech/project/pylottie)
99
[![PyPI Version](https://img.shields.io/pypi/v/pylottie.svg?style=for-the-badge)](https://pypi.org/project/pylottie)
1010

11-
<!-- omit in TOC -->
11+
<!-- omit in toc -->
1212
# PyLottie
1313

1414
<img src="readme-assets/icons/name.png" alt="Project Icon" width="750">
@@ -51,6 +51,8 @@ Get it from:
5151
- [How to run](#how-to-run)
5252
- [Windows](#windows)
5353
- [Linux/ MacOS](#linux-macos)
54+
- [Building](#building)
55+
- [Testing](#testing)
5456
- [Download Project](#download-project)
5557
- [Clone](#clone)
5658
- [Using The Command Line](#using-the-command-line)
@@ -139,8 +141,8 @@ Head to https://pypi.org/project/pylottie/ for more info
139141

140142
### Built for
141143

142-
This program has been written for Python versions 3.7 - 3.10 and has been tested with both 3.7 and
143-
3.10
144+
This program has been written for Python versions 3.8 - 3.11 and has been tested with both 3.8 and
145+
3.11
144146

145147
## Install Python on Windows
146148

@@ -200,6 +202,36 @@ version.
200202
- File
201203
`python3.x [file]` or `./[file]`
202204

205+
## Building
206+
207+
This project uses https://github.com/FHPythonUtils/FHMake to automate most of the building. This
208+
command generates the documentation, updates the requirements.txt and builds the library artefacts
209+
210+
Note the functionality provided by fhmake can be approximated by the following
211+
212+
```sh
213+
handsdown --cleanup -o documentation/reference
214+
poetry export -f requirements.txt --output requirements.txt
215+
poetry export -f requirements.txt --with dev --output requirements_optional.txt
216+
poetry build
217+
```
218+
219+
`fhmake audit` can be run to perform additional checks
220+
221+
## Testing
222+
223+
For testing with the version of python used by poetry use
224+
225+
```sh
226+
poetry run pytest
227+
```
228+
229+
Alternatively use `tox` to run tests over python 3.8 - 3.11
230+
231+
```sh
232+
tox
233+
```
234+
203235
## Download Project
204236

205237
### Clone

documentation/reference/MODULES.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

documentation/reference/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# Pylottie Modules
1+
# Pylottie Index
22

3-
> Auto-generated documentation modules index.
3+
> Auto-generated documentation index.
44
5-
Full list of [Pylottie](README.md#pylottie-index) project modules.
5+
A full list of `Pylottie` project modules.
66

7-
- [Pylottie Index](README.md#pylottie-index)
87
- [Pylottie](pylottie/index.md#pylottie)
Lines changed: 99 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
# Pylottie
22

3-
> Auto-generated documentation for [pylottie](../../../pylottie/__init__.py) module.
3+
[Pylottie Index](../README.md#pylottie-index) /
4+
Pylottie
45

5-
Support for animated stickers
6+
> Auto-generated documentation for [pylottie](../../../pylottie/__init__.py) module.
67
7-
- [Pylottie](../README.md#pylottie-index) / [Modules](../MODULES.md#pylottie-modules) / Pylottie
8-
- [convertLottie2ALL](#convertlottie2all)
9-
- [convertLottie2GIF](#convertlottie2gif)
10-
- [convertLottie2Webp](#convertlottie2webp)
11-
- [convertLotties2PIL](#convertlotties2pil)
12-
- [convertMultLottie2ALL](#convertmultlottie2all)
13-
- [convertMultLottie2GIF](#convertmultlottie2gif)
14-
- [convertMultLottie2Webp](#convertmultlottie2webp)
15-
- [recordLotties](#recordlotties)
16-
- [recordSingleLottie](#recordsinglelottie)
8+
- [Pylottie](#pylottie)
9+
- [convertLottie2ALL](#convertlottie2all)
10+
- [convertLottie2GIF](#convertlottie2gif)
11+
- [convertLottie2Webp](#convertlottie2webp)
12+
- [convertLotties2PIL](#convertlotties2pil)
13+
- [convertMultLottie2ALL](#convertmultlottie2all)
14+
- [convertMultLottie2GIF](#convertmultlottie2gif)
15+
- [convertMultLottie2Webp](#convertmultlottie2webp)
16+
- [recordLotties](#recordlotties)
17+
- [recordSingleLottie](#recordsinglelottie)
1718

1819
## convertLottie2ALL
1920

20-
[[find in source code]](../../../pylottie/__init__.py#L19)
21-
22-
```python
23-
def convertLottie2ALL(fileName: str, newFileName: str, quality: int = 1):
24-
```
21+
[Show source in __init__.py:19](../../../pylottie/__init__.py#L19)
2522

2623
Convert to gif and webp
2724

@@ -31,14 +28,19 @@ Convert to gif and webp
3128
- `newFileName` *str* - name of the file to write (omit file ext)
3229
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
3330

34-
## convertLottie2GIF
35-
36-
[[find in source code]](../../../pylottie/__init__.py#L30)
31+
#### Signature
3732

3833
```python
39-
def convertLottie2GIF(fileName: str, newFileName: str, quality: int = 1):
34+
def convertLottie2ALL(fileName: str, newFileName: str, quality: int = 1):
35+
...
4036
```
4137

38+
39+
40+
## convertLottie2GIF
41+
42+
[Show source in __init__.py:30](../../../pylottie/__init__.py#L30)
43+
4244
Convert to gif
4345

4446
#### Arguments
@@ -47,14 +49,19 @@ Convert to gif
4749
- `newFileName` *str* - name of the file to write
4850
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
4951

50-
## convertLottie2Webp
51-
52-
[[find in source code]](../../../pylottie/__init__.py#L41)
52+
#### Signature
5353

5454
```python
55-
def convertLottie2Webp(fileName: str, newFileName: str, quality: int = 1):
55+
def convertLottie2GIF(fileName: str, newFileName: str, quality: int = 1):
56+
...
5657
```
5758

59+
60+
61+
## convertLottie2Webp
62+
63+
[Show source in __init__.py:41](../../../pylottie/__init__.py#L41)
64+
5865
Convert to webp
5966

6067
#### Arguments
@@ -63,17 +70,19 @@ Convert to webp
6370
- `newFileName` *str* - name of the file to write
6471
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
6572

66-
## convertLotties2PIL
67-
68-
[[find in source code]](../../../pylottie/__init__.py#L137)
73+
#### Signature
6974

7075
```python
71-
def convertLotties2PIL(
72-
fileNames: list[str],
73-
quality: int = 1,
74-
) -> list[tuple[list[Image.Image], float]]:
76+
def convertLottie2Webp(fileName: str, newFileName: str, quality: int = 1):
77+
...
7578
```
7679

80+
81+
82+
## convertLotties2PIL
83+
84+
[Show source in __init__.py:137](../../../pylottie/__init__.py#L137)
85+
7786
Convert list of lottie files to a list of images with a duration.
7887

7988
#### Arguments
@@ -85,18 +94,21 @@ Convert list of lottie files to a list of images with a duration.
8594

8695
- `list[tuple[list[Image],` *float]]* - pil images to write to gif/ webp and duration
8796

88-
## convertMultLottie2ALL
89-
90-
[[find in source code]](../../../pylottie/__init__.py#L52)
97+
#### Signature
9198

9299
```python
93-
def convertMultLottie2ALL(
94-
fileNames: list[str],
95-
newFileNames: list[str],
96-
quality: int = 1,
97-
):
100+
def convertLotties2PIL(
101+
fileNames: list[str], quality: int = 1
102+
) -> list[tuple[list[Image.Image], float]]:
103+
...
98104
```
99105

106+
107+
108+
## convertMultLottie2ALL
109+
110+
[Show source in __init__.py:52](../../../pylottie/__init__.py#L52)
111+
100112
Convert to gif and webp
101113

102114
#### Arguments
@@ -105,18 +117,21 @@ Convert to gif and webp
105117
- `newFileNames` *list[str]* - name of the files to write (omit file ext)
106118
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
107119

108-
## convertMultLottie2GIF
109-
110-
[[find in source code]](../../../pylottie/__init__.py#L84)
120+
#### Signature
111121

112122
```python
113-
def convertMultLottie2GIF(
114-
fileNames: list[str],
115-
newFileNames: list[str],
116-
quality: int = 1,
123+
def convertMultLottie2ALL(
124+
fileNames: list[str], newFileNames: list[str], quality: int = 1
117125
):
126+
...
118127
```
119128

129+
130+
131+
## convertMultLottie2GIF
132+
133+
[Show source in __init__.py:84](../../../pylottie/__init__.py#L84)
134+
120135
Convert to gif
121136

122137
#### Arguments
@@ -125,18 +140,21 @@ Convert to gif
125140
- `newFileNames` *list[str]* - name of the files to write
126141
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
127142

128-
## convertMultLottie2Webp
129-
130-
[[find in source code]](../../../pylottie/__init__.py#L108)
143+
#### Signature
131144

132145
```python
133-
def convertMultLottie2Webp(
134-
fileNames: list[str],
135-
newFileNames: list[str],
136-
quality: int = 1,
146+
def convertMultLottie2GIF(
147+
fileNames: list[str], newFileNames: list[str], quality: int = 1
137148
):
149+
...
138150
```
139151

152+
153+
154+
## convertMultLottie2Webp
155+
156+
[Show source in __init__.py:108](../../../pylottie/__init__.py#L108)
157+
140158
Convert to webp
141159

142160
#### Arguments
@@ -145,17 +163,21 @@ Convert to webp
145163
- `newFileNames` *list[str]* - name of the files to write
146164
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
147165

148-
## recordLotties
149-
150-
[[find in source code]](../../../pylottie/__init__.py#L178)
166+
#### Signature
151167

152168
```python
153-
async def recordLotties(
154-
lottieData: list[str],
155-
quality: int,
156-
) -> list[list[int]]:
169+
def convertMultLottie2Webp(
170+
fileNames: list[str], newFileNames: list[str], quality: int = 1
171+
):
172+
...
157173
```
158174

175+
176+
177+
## recordLotties
178+
179+
[Show source in __init__.py:177](../../../pylottie/__init__.py#L177)
180+
159181
Record the lottie data to a set of images
160182

161183
#### Arguments
@@ -167,15 +189,24 @@ Record the lottie data to a set of images
167189

168190
- `list[list[int]]` - duration and number of frames
169191

192+
#### Signature
193+
194+
```python
195+
def recordLotties(lottieData: list[str], quality: int) -> list[list[int]]:
196+
...
197+
```
198+
199+
200+
170201
## recordSingleLottie
171202

172-
[[find in source code]](../../../pylottie/__init__.py#L212)
203+
[Show source in __init__.py:206](../../../pylottie/__init__.py#L206)
204+
205+
#### Signature
173206

174207
```python
175-
async def recordSingleLottie(
176-
browser,
177-
lottieDataInstance,
178-
quality,
179-
index,
180-
) -> list[int]:
208+
def recordSingleLottie(browser, lottieDataInstance, quality, index) -> list[int]:
209+
...
181210
```
211+
212+

0 commit comments

Comments
 (0)