semvec/pypi-packages huggingface dataset:
quickdemo 0.2.0
Tiny Python library for code demonstrations and small-scale testing

## quickdemo

_For when unit tests would be too much!_

`quickdemo` is a tiny Python library for code demonstrations and small-scale testing.
If your debugging tool of choice is printing to `stdout`, this might be the right library for you.

`quickdemo` allows you to decorate any module-level function with an _invocation_ or _testing_ directive:

    import quickdemo as qd

    @qd.expect([1, 2], [0, 1], 1)
    @qd.run([1, 2, 3], 5)
    def add_to_list(input_list, number):
        return [x + number for x in input_list]

The snippet above produces the following output:

    add_to_list([1, 2, 3], 5) -> [6, 7, 8]
    Passed: add_to_list([0, 1], 1)

Check out the `showcase*.py` files for more examples!

I developed `quickdemo` for two reasons:

Firstly, when presenting solutions to other people, I always wrote several `print` statements per function to demonstrate the correctness of the solution.
The `print` statements always added up quickly, making it difficult to discern which output corresponded to which function.
Also, changing any function name implied re-writing the invocation code.
This was especially tedious when working with Jupyter Notebooks, where you have to take great care to re-run a cell each time something changes.

Secondly, there is an educational programming language called [Pyret](https://www.pyret.org/), which allows writing short unit tests as part of a function definition.
I believe this to be a sensible choice when targeting beginners.
Unfortunately, Pyret code is neither readable nor particularly fast, so I decided to introduce this feature to Python as a part of `quickdemo`.
grascii-gui 0.2.0
A graphical interface for Grascii Search
Requires Python: >=3.7

# grascii-gui

[![PyPI - Version](https://img.shields.io/pypi/v/grascii-gui.svg)](https://pypi.org/project/grascii-gui)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/grascii-gui.svg)](https://pypi.org/project/grascii-gui)

-----

**Table of Contents**

- [About](#about)
- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

## About

`grascii-gui` is a graphical interface for Grascii Search provided by
[`grascii`](https://github.com/grascii/grascii).

## Installation

```console
pip install grascii-gui
```

## Usage

```console
grascii-gui
```

## License

`grascii-gui` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
homomorph 0.3.0
A numerically stable implementation of essential HMM algorithms with tutorials on training methods
Requires Python: >=3.8

# Homomorph
Homomorph is yet another implementation of essential HMM algorithms in Python. (Its name is a reference to its similarity to the countless other HMM packages available on PyPI.) What sets Homomorph apart is its focus on flexibility, numerical stability, and clarity of exposition. For example, though [hmmlearn](https://github.com/hmmlearn/hmmlearn) is popular, it only natively supports HMMs with normal, mixture normal, or categorical emission distributions. In contrast, Homomorph can directly model states parametrized by arbitrary distributions. Unlike hmmlearn, it does not provide built-in methods for fitting HMMs to data since they would necessarily rely on general-purpose optimization algorithms. Instead, training methods are discussed for specific examples in the [training tutorial](https://github.com/marcsingleton/homomorph/blob/main/tutorials/hmm_training.ipynb). It covers many scenarios and approaches, including categorical and normal emission distributions with labeled and unlabeled data. Although the HMM class is fully documented, the [HMM tutorial](https://github.com/marcsingleton/homomorph/blob/main/tutorials/hmm_intro.ipynb) is the recommended introduction to the Homomorph API.

## Dependencies
Homomorph is designed to be lightweight and only requires NumPy for array calculations and SciPy for its implementation of random variables. The minimum version for NumPy was set to the most recent at the time of initial release (1.17), but no functionality specific to this release is needed to my knowledge. SciPy, on the other hand, must be at least version 1.9. The reasons for this are highly technical, but the core issue was previous versions of SciPy did not strongly distinguish between discrete and continuous frozen random variables. As a result, reliably extracting the correct probability functions (the pmf and pdf, respectively) was extremely difficult. Although Homomorph does not directly use SciPy in its implementation, its practical use depends so strongly on it that this ambiguity effectively broke Homomorph. Fortunately, versions 1.9 and later have corrected this problem.

## Installation
To install Homomorph, run the following command:

```
pip install homomorph
```
myNer 0.0.6
package to execute some ner ops
Requires Python: >=3.7


# NER-API
Ce package permet le traitemnt du texte , l'extraction des entités(inclus code swift et code imo), ainsi que le highlighting des ces entités présente dans un fichier pdf




## Installation 
```batch
pip install myNer
```


## Usage/Exemples
### Preprocessing:

```python
from myner  import text_preprocessing
text_preprocessing.text_preprocessing(text,accented=True,stopw=True,punctuation=True,lowercase=True,lemmatize=True,spelling=True,expand_contraction=True,urls=True)
```
cette fonction permet de traiter le text en utilisant les filtres présents comme argument
```python
from myner  import text_preprocessing
text_preprocessing.spacy_preprocessing(text,lowercase=True,stopw=True,punctuation=True,alphabetic=True,lemmatize=True,)
```
Permet de faire du traitement du texte à l'aide de spacy 


Après le preprocessing tout les caractères sont en miniscule, les retour en ligne et les multiples espaces sont éliminés , seulement un seul espace est ajouté lorsqu'on reconstitue le texte, les caractères spéciaux sont supprimés ,meme les "-" et les "+" sont supprimés dans les codes et les references ce qui peut poser problème, toutefois les fonctions du preprocessing possèdent des filtres qu'on peut ajuster selon le cas
### Méthodes d'extraction des entités:
on a utilisé dans ce projet :

1)reconnaissance à l'aide d'expression régulière:
```python
ner.find_imo(text)
ner.find_swift(text)
```
2) reconnaissance à l'aide de composante ner du modèle linguistique de spacy:
```python
ner.ner_spacy(text)
```
3) reconnaissance à l'aide des dictionnaires et du fuzzy matching:
```python
ner.ner_dicts(text,db,table)
```
Après avoir créer une base de données postgresql pour les ports , banques et navires , on utilise cette db pour extraire les entités de ce type.
Sauf que cette méthode se montre dépendante des données présentes dans la base de données(par exemple si le nom compet d'une banque est présent dans la base, un nom courant de la banque ne sera pas reconnu )



### Pdf highlighting:

```python
from myner import highlight_pdf 
highlight_pdf.output(input_file,output_path)

```
cette fonction prend en argument le chemin vers un fichier pdf , et le chemin de l'output, extrait les entités,les highlight , et enregistre le pdf highlighté dans le dossier courant sous le nom "output.pdf"

Il existe aussi deux fonctions pour l'encodage du pdf en base64 et l'inverse,pour permettre l'interaction avec l'API
```python
highlight_pdf.pdf_to_base64(pdf)
highlight_pdf.base64_to_pdf(base64)
```
### batch preprocessing:
highlight_pdf.batch_ner(dir_path): prend le chemin vers un dossier contenant des pdf et execute du batch preprocessing sur ces derniers



## API Reference

#### get_entities(text)
Prend un texte(String) et retourne ses entités
#### highlight_pdf(pdf)
Prend le pdf encodé en base64 et retourne le pdf highlighté encodé en base64 ainsi que les entités détectées sous format :    # positions format: a dict containing entities as keys, and the values a list of tuples:(list of Rect positions,page number)