Skip to content

Commit

Permalink
rel 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
FredHappyface committed Mar 30, 2024
1 parent c28b0f5 commit 222911c
Show file tree
Hide file tree
Showing 8 changed files with 196 additions and 121 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/test-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Python Test and Lint

on:
push:
branches:
- '*'
pull_request:
branches:
- main

jobs:
test:
name: Python Test and Lint
runs-on: ubuntu-latest

strategy:
matrix:
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Install dependencies
run: poetry install

- name: Run pytest
run: poetry run pytest

- name: Run ruff
run: poetry run ruff check --output-format=github
continue-on-error: true
53 changes: 27 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
repos:
- repo: https://github.com/FHPythonUtils/Blackt
rev: '2022.0.3'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.3
hooks:
- id: blackt
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/pycqa/isort
rev: 5.12.0
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.354
hooks:
- id: isort
- id: pyright

- repo: https://github.com/pycqa/pylint
rev: v3.0.0a6
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.3.3
hooks:
- id: pylint
exclude: "tests/"
args: [--disable=import-error,--jobs=0]
- id: python-safety-dependencies-check
files: pyproject.toml

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: "tests/"
- id: end-of-file-fixer
exclude: "tests/"
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-yaml
- id: detect-private-key
- id: mixed-line-ending

- repo: https://github.com/asottile/pyupgrade
rev: v3.7.0
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/boidolr/pre-commit-images
rev: v1.2.1
rev: v1.5.2
hooks:
- id: optimize-avif
exclude: "tests/"
- id: optimize-jpg
exclude: "tests/"
- id: optimize-png
exclude: "tests/"
- id: optimize-svg
exclude: "tests/"
- id: optimize-webp
exclude: "tests/"

exclude: "tests/data|documentation/reference"
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
All major and minor version changes will be documented in this file. Details of
patch-level version changes can be found in [commit messages](../../commits/master).

## 2024 - 2024/03/30

- Update deps

## 2023 - 2023/01/08

- Add tox config
- Use `playwright` and `install_playwright` in-place of `pyppeteer`
- Use `playwright` and `install_playwright` in-place of `playwright`
- Seemingly minor perf improvements (~32s vs ~38s)

## 2022 - 2022/01/23
Expand Down
108 changes: 53 additions & 55 deletions documentation/reference/pylottie/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Pylottie

[Pylottie Index](../README.md#pylottie-index) /
Pylottie
[Pylottie Index](../README.md#pylottie-index) / Pylottie

> Auto-generated documentation for [pylottie](../../../pylottie/__init__.py) module.
Expand All @@ -24,189 +23,188 @@ Convert to gif and webp

#### Arguments

- `fileName` *str* - file path of the lottie file
- `newFileName` *str* - name of the file to write (omit file ext)
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
----
- `fileName` *str* - file path of the lottie file
- `newFileName` *str* - name of the file to write (omit file ext)
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.

#### Signature

```python
def convertLottie2ALL(fileName: str, newFileName: str, quality: int = 1):
...
def convertLottie2ALL(fileName: str, newFileName: str, quality: int = 1): ...
```



## convertLottie2GIF

[Show source in __init__.py:30](../../../pylottie/__init__.py#L30)
[Show source in __init__.py:32](../../../pylottie/__init__.py#L32)

Convert to gif

#### Arguments

- `fileName` *str* - file path of the lottie file
- `newFileName` *str* - name of the file to write
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
----
- `fileName` *str* - file path of the lottie file
- `newFileName` *str* - name of the file to write
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.

#### Signature

```python
def convertLottie2GIF(fileName: str, newFileName: str, quality: int = 1):
...
def convertLottie2GIF(fileName: str, newFileName: str, quality: int = 1): ...
```



## convertLottie2Webp

[Show source in __init__.py:41](../../../pylottie/__init__.py#L41)
[Show source in __init__.py:45](../../../pylottie/__init__.py#L45)

Convert to webp

#### Arguments

- `fileName` *str* - file path of the lottie file
- `newFileName` *str* - name of the file to write
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
----
- `fileName` *str* - file path of the lottie file
- `newFileName` *str* - name of the file to write
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.

#### Signature

```python
def convertLottie2Webp(fileName: str, newFileName: str, quality: int = 1):
...
def convertLottie2Webp(fileName: str, newFileName: str, quality: int = 1): ...
```



## convertLotties2PIL

[Show source in __init__.py:137](../../../pylottie/__init__.py#L137)
[Show source in __init__.py:149](../../../pylottie/__init__.py#L149)

Convert list of lottie files to a list of images with a duration.

#### Arguments

- `fileNames` *list[str]* - list of file paths of the lottie files
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
----
- `fileNames` *list[str]* - list of file paths of the lottie files
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.

#### Returns

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

#### Signature

```python
def convertLotties2PIL(
fileNames: list[str], quality: int = 1
) -> list[tuple[list[Image.Image], float]]:
...
) -> list[tuple[list[Image.Image], float]]: ...
```



## convertMultLottie2ALL

[Show source in __init__.py:52](../../../pylottie/__init__.py#L52)
[Show source in __init__.py:58](../../../pylottie/__init__.py#L58)

Convert to gif and webp

#### Arguments

- `fileNames` *list[str]* - list of file path to the lottie files
- `newFileNames` *list[str]* - name of the files to write (omit file ext)
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
----
- `fileNames` *list[str]* - list of file path to the lottie files
- `newFileNames` *list[str]* - name of the files to write (omit file ext)
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.

#### Signature

```python
def convertMultLottie2ALL(
fileNames: list[str], newFileNames: list[str], quality: int = 1
):
...
): ...
```



## convertMultLottie2GIF

[Show source in __init__.py:84](../../../pylottie/__init__.py#L84)
[Show source in __init__.py:92](../../../pylottie/__init__.py#L92)

Convert to gif

#### Arguments

- `fileNames` *list[str]* - list of file path to the lottie files
- `newFileNames` *list[str]* - name of the files to write
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
----
- `fileNames` *list[str]* - list of file path to the lottie files
- `newFileNames` *list[str]* - name of the files to write
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.

#### Signature

```python
def convertMultLottie2GIF(
fileNames: list[str], newFileNames: list[str], quality: int = 1
):
...
): ...
```



## convertMultLottie2Webp

[Show source in __init__.py:108](../../../pylottie/__init__.py#L108)
[Show source in __init__.py:118](../../../pylottie/__init__.py#L118)

Convert to webp

#### Arguments

- `fileNames` *list[str]* - list of file path to the lottie files
- `newFileNames` *list[str]* - name of the files to write
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.
----
- `fileNames` *list[str]* - list of file path to the lottie files
- `newFileNames` *list[str]* - name of the files to write
- `quality` *int, optional* - Quality of the returned sequence. Defaults to 1.

#### Signature

```python
def convertMultLottie2Webp(
fileNames: list[str], newFileNames: list[str], quality: int = 1
):
...
): ...
```



## recordLotties

[Show source in __init__.py:177](../../../pylottie/__init__.py#L177)
[Show source in __init__.py:192](../../../pylottie/__init__.py#L192)

Record the lottie data to a set of images

#### Arguments

- `lottieData` *str* - lottie data as string
- `quality` *int, optional* - Quality of the returned sequence.
----
- `lottieData` *str* - lottie data as string
- `quality` *int, optional* - Quality of the returned sequence.

#### Returns

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

#### Signature

```python
def recordLotties(lottieData: list[str], quality: int) -> list[list[int]]:
...
def recordLotties(lottieData: list[str], quality: int) -> list[list[int]]: ...
```



## recordSingleLottie

[Show source in __init__.py:206](../../../pylottie/__init__.py#L206)
[Show source in __init__.py:224](../../../pylottie/__init__.py#L224)

#### Signature

```python
def recordSingleLottie(browser, lottieDataInstance, quality, index) -> list[int]:
...
```


def recordSingleLottie(browser, lottieDataInstance, quality, index) -> list[int]: ...
```

0 comments on commit 222911c

Please sign in to comment.