semvec/pypi-packages huggingface dataset:
lyrntpy 1.0.0
A api wrapper for lyrnt`s api in python
Requires Python: >=3.8

# lyrntpy
 A api wrapper for lyrnt`s api in python

# How to make the .env file
In order to create a `.env` file you need 3 cookies:
- `_TOKEN_DO_NOT_SHARE`
- `temp-discord-token`
- `cf_clearance`

The `_TOKEN_DO_NOT_SHARE` cookie is required to authenticate with the lyrnt api.

The `temp-discord-token` cookie is only needed when creating an account (to my knowledge) so it can probaly left empty but i would stil set it.

The `cf_clearance` is used to authenticate with cloudflare and use the api and not be blocked. This cookie is known for expirering quickly, for now the 
solution is to manualy copy the cookie from a browser and paste it it (i am working on an automatic system).

Now that we know what each cookie does, how to actually get them? (please note the tutorial for getting the cookies is for firefox)

Firstly navigate to [lyrnt](https://lyrnt.com) and press `Control+S+I`, you should be meet with this
![devtools open](readme_images/devtools1.png)

Now navigate to the `Storage` tab
![devtools storage tab](readme_images/devtools2.png)

And click on `Cookies > https://lyntr.com`
![devtools cookies tab open](readme_images/devtools3.png)

Now copy the `_TOKEN_DO_NOT_SHARE` cookie to the file `.env` to a variable named `TOKEN`, the `temp-discord-token` cookie to `temp-discord-token` and the `cf_clearance` cookie to `cf_clearance`.

If you do all these steps correctly you should be able to start implementing the wrapper in your code.

Happy Codeing.

# ToDo
- [ ] Add photo support for lynting
- [ ] Add auto cloudflare cookies collector from browser to .env is not required
pymszip 1.0.1
Compress and Decompress MSZIP data
Requires Python: >=3.9.1

# pymszip

This library fills the very niche use-case where you have data compressed using [`CreateCompressor`](https://learn.microsoft.com/en-us/windows/win32/api/compressapi/nf-compressapi-createcompressor) / [`Compress`](https://learn.microsoft.com/en-us/windows/win32/api/compressapi/nf-compressapi-compress) with the MSZIP algorithm, and want to decompress it without the Windows API (e.g. under Linux), or the other way around and you want to create compressed data that can be decompressed by the Windows API.

## Installation

```bash
pip install pymszip
```

Alternatively, install directly from GitHub:

```bash
pip install git+https://github.com/frereit/pymszip
```

## Usage

```python
import pymszip

compressed = pymszip.compress(b"Hello, world!")
decompressed = pymszip.decompress(compressed)

print(decompressed)
```

## Goals and non-goals

This repo aims to provide full compatibility with the Windows API. This means that:

- Any data compressed using the Windows API can be decompressed by `pymszip`
- Any data compressed using `pymszip` can be decompressed by the Windows API

If you find data where either of this isn't the case, please file an issue if you can!

However, this library does not aim to produce identical results to the Windows compression. This means data compressed using `pymszip` may yield different results than if it was compressed with the Windows API. This is to be expected because of slightly differing zlib parameters, but not an issue, as long as compatibility is preserved.

## MSZIP format

The MSZIP compression format is a proprietary compression format developed by Microsoft, based on the `zlib` compression library.

Under the hood, MSZIP compressed data is prefixed with a 24 byte header, and an arbitrary number of compressed chunks following it.

The header consiss of 6 magic bytes (`0a51e5c01800`)[^magic], followed by 1 CRC byte, 1 byte to identify the algorithm (`MSZIP` / `02`), followed by 8 bytes little-endian integer to specify the decompressed size of the data, and another 8 bytes little-endian integer to specify the decompressed size of the first chunk.

Each chunk is prefixed with a 4 byte little-endian integer to specify its size, and 2 magic bytes ("CK"), after which a zlib-compressed stream follows. The "size" of the chunk includes the zlib stream, and the 2 magic bytes, but not the size header itself.

To decompress data, each zlib-compressed stream is decompressed individually, however each chunk must be given all previously decompressed data as the `zdict` used during decompression.

To compress data, a similar process is followed. Experimentially, I came to the conclusion that the `memLevel` must be set to 9`, or Windows will not be able to decompress the compressed data again in some cases.