semvec/pypi-packages huggingface dataset:
pycounts_akhras 0.1.0
Calculate word counts in a text file!
License: MIT
Requires Python: >=3.9

# pycounts_akhras

Calculate word counts in a text file!

## Installation

```bash
$ pip install pycounts_akhras
```

## Usage

`pycounts_akhras` can be used to count words in a text file and plot results as follows:

```python
from pycounts_akhras.pycounts_akhras import count_words
from pycounts_akhras.plotting import plot_words
import matplotlib.pyplot as plt

file_path = "test.txt"  # path to your file
counts = count_words(file_path)
fig = plot_words(counts, n=10)
plt.show()
```

## Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

## License

`pycounts_akhras` was created by Mohammad Alakhras. It is licensed under the terms of the MIT license.

## Credits

`pycounts_akhras` was created with [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/) and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter).
qcktypes 1.2
Python implementation of dyne's file extension list
License: MIT
Requires Python: >=3.3

# qcktypes
*Python implementation of [Dyne's file extension list](https://github.com/dyne/file-extension-list)*
## What is this
There I was, trying to get files out of a directory and categorize them based on their file extension. "This is probably already a module" I said. I was right, there it was, glorious [filetype](https://pypi.org/project/filetype/).

"Wait... what is a MIME bruh 😭"

### I don't want to validate files actually, just tell me what they are
The module [filetype](https://pypi.org/project/filetype/) validates files with their [magic numbers](https://en.wikipedia.org/wiki/Magic_number_(programming)) or whatever, but I didn't want that. I found [Dyne's file extension list](https://github.com/dyne/file-extension-list) and quickly wrote up this module since I couldn't find anything similar. I would write more features but I know literally nobody will ever use this so it's probably fine. 

Rather than validating files with their magic numbers this module simply checks the extension of an input file and compares it with a dictionary of extensions and returns its category.

## Installing
```
python3 -m pip install -U qcktypes
```
## Quick example
```python
import qcktypes

file =  'example.txt'
category = qcktypes.find_type(file)

print(f'{file} is in category: {category}!')
```
**output :**
```
$ python3 example.py
example.txt is in category: text!
```
WaterMarkTool 0.0.8
A little tool to add water mark on various pictures
License: MIT
Requires Python: >=3.6

# WaterMarkTool
A little tool to add water mark on various pictures


```python
def paste_image_on_another(
    top_left_pos,
    bg_img_path=None,
    bg_img=None,
    paste_img_path=None,
    paste_img=None,
    save_as=None,
    transparency = 255,
):
    bg_img = Image.open(bg_img_path) if bg_img_path != None else bg_img
    paste_img = Image.open(paste_img_path) if paste_img_path != None else paste_img
    
    if bg_img == None or paste_img == None:
        raise Exception("bg_img or paste_img not specified")
    
    bg_img = bg_img.convert('RGB')
    paste_img = paste_img.convert('RGBA')
    paste_img.putalpha(transparency)
    bg_img.paste(paste_img, top_left_pos, mask=paste_img)

    if save_as != None:
        bg_img.save(save_as)

    return bg_img
```