Skip to content

Commit

Permalink
rel 2022.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
FredHappyface committed Jun 25, 2023
1 parent 92040f0 commit feb196d
Show file tree
Hide file tree
Showing 12 changed files with 192 additions and 108 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
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).

## 2022.1.1 - 2022/06/25

- Fix: use `os.makedirs` instead of `os.mkdir`
- Update pre-commit

## 2022.1 - 2022/04/11

- Tests and code improvements
Expand Down
38 changes: 35 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![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%2Fsigstickers)](https://pepy.tech/project/sigstickers)
[![PyPI Version](https://img.shields.io/pypi/v/sigstickers.svg?style=for-the-badge)](https://pypi.org/project/sigstickers)

<!-- omit in TOC -->
<!-- omit in toc -->
# SigStickers - Signal Sticker Downloader

<img src="readme-assets/icons/name.png" alt="Project Icon" width="750">
Expand All @@ -34,6 +34,8 @@ Download sticker packs from Signal
- [How to run](#how-to-run)
- [Windows](#windows)
- [Linux/ MacOS](#linux-macos)
- [Building](#building)
- [Testing](#testing)
- [Download Project](#download-project)
- [Clone](#clone)
- [Using The Command Line](#using-the-command-line)
Expand Down Expand Up @@ -108,8 +110,8 @@ Head to https://pypi.org/project/sigstickers/ for more info
### Built for
This program has been written for Python versions 3.7 - 3.10 and has been tested with both 3.7 and
3.10
This program has been written for Python versions 3.8 - 3.11 and has been tested with both 3.8 and
3.11
## Install Python on Windows
Expand Down Expand Up @@ -169,6 +171,36 @@ version.
- File
`python3.x [file]` or `./[file]`
## Building
This project uses https://github.com/FHPythonUtils/FHMake to automate most of the building. This
command generates the documentation, updates the requirements.txt and builds the library artefacts
Note the functionality provided by fhmake can be approximated by the following
```sh
handsdown --cleanup -o documentation/reference
poetry export -f requirements.txt --output requirements.txt
poetry export -f requirements.txt --with dev --output requirements_optional.txt
poetry build
```
`fhmake audit` can be run to perform additional checks
## Testing
For testing with the version of python used by poetry use
```sh
poetry run pytest
```
Alternatively use `tox` to run tests over python 3.8 - 3.11
```sh
tox
```
## Download Project
### Clone
Expand Down
11 changes: 0 additions & 11 deletions documentation/reference/MODULES.md

This file was deleted.

7 changes: 3 additions & 4 deletions documentation/reference/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Sigstickers Modules
# Sigstickers Index

> Auto-generated documentation modules index.
> Auto-generated documentation index.
Full list of [Sigstickers](README.md#sigstickers-index) project modules.
A full list of `Sigstickers` project modules.

- [Sigstickers Index](README.md#sigstickers-index)
- [Sigstickers](sigstickers/index.md#sigstickers)
- [Module](sigstickers/module.md#module)
- [Caching](sigstickers/caching.md#caching)
Expand Down
40 changes: 26 additions & 14 deletions documentation/reference/sigstickers/caching.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# Caching

> Auto-generated documentation for [sigstickers.caching](../../../sigstickers/caching.py) module.
[Sigstickers Index](../README.md#sigstickers-index) /
[Sigstickers](./index.md#sigstickers) /
Caching

Sticker caching functionality used by the downloader.
> Auto-generated documentation for [sigstickers.caching](../../../sigstickers/caching.py) module.
- [Sigstickers](../README.md#sigstickers-index) / [Modules](../MODULES.md#sigstickers-modules) / [Sigstickers](index.md#sigstickers) / Caching
- [createConverted](#createconverted)
- [verifyConverted](#verifyconverted)
- [Caching](#caching)
- [createConverted](#createconverted)
- [verifyConverted](#verifyconverted)

## createConverted

[[find in source code]](../../../sigstickers/caching.py#L52)

```python
def createConverted(packName: str, data: dict):
```
[Show source in caching.py:52](../../../sigstickers/caching.py#L52)

Write cache data to a file identified by packName

Expand All @@ -23,14 +21,19 @@ Write cache data to a file identified by packName
- `packName` *str* - name of the sticker pack eg. "DonutTheDog"
- `data` *dict* - packName cache data to write to cache

## verifyConverted

[[find in source code]](../../../sigstickers/caching.py#L14)
#### Signature

```python
def verifyConverted(packName: str) -> bool:
def createConverted(packName: str, data: dict):
...
```



## verifyConverted

[Show source in caching.py:14](../../../sigstickers/caching.py#L14)

Verify the cache for a packName eg. "DonutTheDog". Uses the cache "version"
to call the verify function for that version

Expand All @@ -41,3 +44,12 @@ to call the verify function for that version
#### Returns

- `bool` - if the converted cache has been verified

#### Signature

```python
def verifyConverted(packName: str) -> bool:
...
```


91 changes: 58 additions & 33 deletions documentation/reference/sigstickers/downloader.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
# Downloader

> Auto-generated documentation for [sigstickers.downloader](../../../sigstickers/downloader.py) module.
[Sigstickers Index](../README.md#sigstickers-index) /
[Sigstickers](./index.md#sigstickers) /
Downloader

Sticker download and convert functions used by the module entry point.
> Auto-generated documentation for [sigstickers.downloader](../../../sigstickers/downloader.py) module.
- [Sigstickers](../README.md#sigstickers-index) / [Modules](../MODULES.md#sigstickers-modules) / [Sigstickers](index.md#sigstickers) / Downloader
- [assureDirExists](#assuredirexists)
- [convertPack](#convertpack)
- [convertWithPIL](#convertwithpil)
- [downloadPack](#downloadpack)
- [saveSticker](#savesticker)
- [Downloader](#downloader)
- [assureDirExists](#assuredirexists)
- [convertPack](#convertpack)
- [convertWithPIL](#convertwithpil)
- [downloadPack](#downloadpack)
- [saveSticker](#savesticker)

## assureDirExists

[[find in source code]](../../../sigstickers/downloader.py#L19)

```python
def assureDirExists(directory: str, root: str) -> str:
```
[Show source in downloader.py:19](../../../sigstickers/downloader.py#L19)

Make the dir if not exists

Expand All @@ -30,14 +28,19 @@ Make the dir if not exists

- `str` - the full path

## convertPack

[[find in source code]](../../../sigstickers/downloader.py#L115)
#### Signature

```python
async def convertPack(swd: str, packName: str, noCache=False):
def assureDirExists(directory: str, root: str) -> str:
...
```



## convertPack

[Show source in downloader.py:112](../../../sigstickers/downloader.py#L112)

Convert the webp images into png and gif images

#### Arguments
Expand All @@ -46,14 +49,19 @@ Convert the webp images into png and gif images
- `packName` *str* - name of the sticker pack (for cache + logging)
- `noCache` *bool, optional* - set to true to disable cache. Defaults to False.

## convertWithPIL

[[find in source code]](../../../sigstickers/downloader.py#L94)
#### Signature

```python
def convertWithPIL(inputFile: str) -> str:
async def convertPack(swd: str, packName: str, noCache=False):
...
```



## convertWithPIL

[Show source in downloader.py:91](../../../sigstickers/downloader.py#L91)

Convert the webp file to png

#### Arguments
Expand All @@ -64,18 +72,19 @@ Convert the webp file to png

- `str` - path to input file

## downloadPack

[[find in source code]](../../../sigstickers/downloader.py#L57)
#### Signature

```python
async def downloadPack(
packId: str,
packKey: str,
cwd: str = os.getcwd(),
) -> tuple[str, str]:
def convertWithPIL(inputFile: str) -> str:
...
```



## downloadPack

[Show source in downloader.py:54](../../../sigstickers/downloader.py#L54)

Download a sticker pack.

#### Arguments
Expand All @@ -89,14 +98,21 @@ c957a57000626a2dc3cb69bf0e79c91c6b196b74d4d6ca1cbb830d3ad0ad4e36

- `tuple[str,` *str]* - sticker working directory and pack title

## saveSticker

[[find in source code]](../../../sigstickers/downloader.py#L38)
#### Signature

```python
def saveSticker(sticker: Sticker, path: str) -> str:
async def downloadPack(
packId: str, packKey: str, cwd: str = os.getcwd()
) -> tuple[str, str]:
...
```



## saveSticker

[Show source in downloader.py:35](../../../sigstickers/downloader.py#L35)

Save a sticker

#### Arguments
Expand All @@ -107,3 +123,12 @@ Save a sticker
#### Returns

- `str` - the filepath the file was written to

#### Signature

```python
def saveSticker(sticker: Sticker, path: str) -> str:
...
```


29 changes: 19 additions & 10 deletions documentation/reference/sigstickers/index.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
# Sigstickers

> Auto-generated documentation for [sigstickers](../../../sigstickers/__init__.py) module.
[Sigstickers Index](../README.md#sigstickers-index) /
Sigstickers

Download sticker packs from Signal
> Auto-generated documentation for [sigstickers](../../../sigstickers/__init__.py) module.
- [Sigstickers](../README.md#sigstickers-index) / [Modules](../MODULES.md#sigstickers-modules) / Sigstickers
- [cli](#cli)
- Modules
- [Module](module.md#module)
- [Caching](caching.md#caching)
- [Downloader](downloader.md#downloader)
- [Sigstickers](#sigstickers)
- [cli](#cli)
- [Modules](#modules)

## cli

[[find in source code]](../../../sigstickers/__init__.py#L13)
[Show source in __init__.py:13](../../../sigstickers/__init__.py#L13)

cli entry point

#### Signature

```python
def cli():
...
```

cli entry point


## Modules

- [Module](./module.md)
- [Caching](./caching.md)
- [Downloader](./downloader.md)
8 changes: 5 additions & 3 deletions documentation/reference/sigstickers/module.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Module

> Auto-generated documentation for [sigstickers.__main__](../../../sigstickers/__main__.py) module.
[Sigstickers Index](../README.md#sigstickers-index) /
[Sigstickers](./index.md#sigstickers) /
Module

entry point for python -m sigstickers
> Auto-generated documentation for [sigstickers.__main__](../../../sigstickers/__main__.py) module.
- [Sigstickers](../README.md#sigstickers-index) / [Modules](../MODULES.md#sigstickers-modules) / [Sigstickers](index.md#sigstickers) / Module
- [Module](#module)
Loading

0 comments on commit feb196d

Please sign in to comment.