semvec/pypi-packages huggingface dataset:
smilepngquant 1.1.0
That is a bridge of pngquant for python3
Requires Python: >=3.5

# SmilePngquant
That is a bridge of pngquant for python3

What's new 1.1.1
- add default pngquant sdk path in constructor
- verify pngquant sdk path

# Download
### Find package
- https://pkgs.org/download/pngquant
- Ex: https://ubuntu.pkgs.org/20.04/ubuntu-universe-amd64/pngquant_2.12.2-1_amd64.deb.html
- This document will cover

### Or build from github
```commandline
git clone --recursive git://github.com/kornelski/pngquant.git
cd pngquant
make
sudo make install
```

# Find
```commandline
which pngquant
```
$ /usr/local/bin/pngquant

# Check version
```commandline
pngquant --version
```
$ 2.17.0 (September 2021)

# Start to code
```
from smilepngquant.PNGQuant import PNGQuant

# initialize
smile    = PNGQuant()
or
smile    = PNGQuant('/usr/local/bin/pngquant')
```
*** by default the application located in /usr/local/bin/pngquant

*** it's able to set to another location via
```
smile.setPngQuant(path= '/home/winny/pngquant')
```


# test a filename
# quality value starts 20 to 100, and it's integer
```
smile.compress(
  filename  = '/home/thyda/Download/kara.png'
  , quality = 80
)
```

# verify before use
```
if smile.isError():
  print(f'Everything is okay, the file name is: {smile.getFilename()}')

else:
  print(f'{smile.getErrorMessage()}')
```

# Options
- dirname: can be None
set coy to a new directory for the new file

- newFilename: can be None
set a new copy name

Both can set any value, or None, or one of them.

Let check the example:

Ex 1
```
smile.compress(
  filename      = '/home/thyda/Download/kara.png'
  , quality     = 80
  # move to new directory
  , dirname     = '/home/thyda/Document/'
  , newFilename = 'jojo'
)
```

Ex 2
```
smile.compress(
  filename      = '/home/thyda/Download/kara.png'
  , quality     = 80
  # move to new directory
  , dirname     = '/home/thyda/Document/'
)
```

Ex 3
```
smile.compress(
  filename      = '/home/thyda/Download/kara.png'
  , quality     = 80
  # move to new directory
  , newFilename = 'jojo'
)
```


It is also available on https://pypi.org/project/smilepngquant \
To Support my work, please donate me via <a class="bmc-button" target="_blank" href="https://www.buymeacoffee.com/sitthykun"><img src="https://cdn.buymeacoffee.com/buttons/bmc-new-btn-logo.svg" alt="Buy me a Pizza"><span style="margin-left:5px;font-size:28px !important;">Buy me a Coffee</span></a>
bagmodels 0.1.5
BM25 NLP model
Requires Python: >=3.6

# BagModels
[![PyPI version](https://badge.fury.io/py/bagmodels.svg)](https://badge.fury.io/py/bagmodels)
[![Python tests](https://github.com/HimanshuMittal01/bagmodels/actions/workflows/python-app.yml/badge.svg)](https://github.com/HimanshuMittal01/bagmodels/actions/workflows/python-app.yml)

BagModels is a repository of various bag of words (BoW) algorithms in machine learning. Currently it includes OkapiBM25. More coming soon.

BM25 is a text retrieval function that can find similar documents or rank search in a set of documents based on the query terms appearing in each document irrespective of their proximity to each other. It is an improved and more generalised version of TF-IDF algorithm in NLP.

## Installation
It can be installed using pip:
```zsh
pip install bagmodels
```

## Getting started

### Basic usage
```py
import re
from bagmodels import BM25

# Load corpus
corpus = list({
    "Yo, I love NLP model",
    "I like algorithms",
    "I love ML!"
})

# Clean manually if needed or pass custom tokenizer to BM25
corpus = [re.sub(r",|!", " ", doc).strip() for doc in corpus]

# Initialize model
model = BM25(corpus=corpus)

# Similarity
model.similarity("I love NLP model", "I like NLP model") # 0.775
model.similarity("I love blah", "I love algorithms") # 0.446
```

### Save and reuse models
```py
# libaries imported and corpus already loaded before it
model = BM25(corpus=corpus)

# write to save path
model.save("output/bm25_v1.jbl")

# load again
model = BM25.load("output/bm25_v1.jbl")

# add documents if required
model.resume(corpus=additonal_corpus)

# predict / search / find / retrieve like
model.similarity(doc_a, doc_b)
```

## Coming soon
Please feel free to open an issue to request a feature or discuss any changes. Pull requests are most welcome.

I am trying to actively add the following:
- [X] OkapiBM25
- [ ] BM25 variations
- [ ] MultiThreading