semvec/pypi-packages huggingface dataset:
django-model-event-actions 1.0.4
A replacement for Django Signals for a cleaner design
License: MIT
Requires Python: >=3.6
Keywords: django model signals event handler

django-model-event-actions |latest-version|
===========================================
|python-support| |django-support| |pypi| |license|

.. start docs include

This package is a replacement for the builtin Django_ Signals which you can define all of the
events and actions in the model itself and add conditions to determine when they are triggered.
With the help of this package you can track the changed field previous and current values and
determine when an action should trigger by creating an event with the decorators in the model.

A simple example will be:

.. code-block:: python

    class User(EventActionModel):
        is_active = models.BooleanField()

        @PostSaveEvent(field='is_active', prev=False, now=True)
        def user_deactivated(self):
            # logic

        @PostCreateEvent()
        def post_create(self):
            # logic

.. end docs include



.. |latest-version| image:: https://img.shields.io/badge/version-1.1-green
   :alt: Latest version on PyPI
   :target: https://pypi.org/project/django-model-event-actions/
.. |python-support| image:: https://img.shields.io/badge/python-%2B3.6-blue
   :target: https://pypi.org/project/django-model-event-actions/
   :alt: Python version
.. |django-support| image:: https://img.shields.io/badge/django-%2B2.1-blue
   :target: https://pypi.org/project/django-model-event-actions/
   :alt: Django versions
.. |pypi| image:: https://img.shields.io/badge/pypi-1.1-blue
   :target: https://pypi.org/project/django-model-event-actions/
   :alt: Pypi link
.. |license| image:: https://img.shields.io/badge/license-MIT-green
   :alt: Software license
   :target: https://github.com/aryabartar/django-model-event-actions/blob/master/LICENSE
.. _`Django`: http://www.djangoproject.com/



Installation
++++++++++++

.. start installation include

Get the package from pypi::

    $ pip install django-model-event-actions

Subclass the models:

.. code-block:: python

    from django_model_event_actions.models import EventActionModel

    class MyClass(EventActionModel):
        ...


Add the event decorator:

.. code-block:: python

    from django_model_event_actions.models import EventActionModel

    class MyClass(EventActionModel):
        name = models.CharField()

        @PostCreateEvent(field='name'):
        def my_handler(self):
            # logic

.. end installation include


Tutorial
++++++++

To start using the package take a look at the documentation_ in readthedocs.

.. _`documentation`: http://www.djangoproject.com/
nlp-text-corrector 0.0.3
IAMAI ASR Post Process Library
License: MIT

nlp-text-corrector
==================

``nlp-text-corrector`` is a python package that helps post process the raw ASR output

- Parsing of numbers expressed as words in English and convert them to integer values.
- Detection of ordinal, cardinal and decimal numbers in a stream of Englishwords and get their decimal digit representations. 
- Detection of email/website addresses as words in English and convert them to proper email/website format.
- Detection of times expressed as raw text in English to proper time format.

Compatibility
-------------

Tested on python 3.7. Requires Python >= 3.6.

License
-------

This sofware is distributed under the MIT license of which you should have received a copy (see LICENSE file in this repository).

Installation
------------

``nlp-text-corrector`` does not depend on any other third party package.

To install nlp-text-corrector in your (virtual) environment::

    pip install nlp-text-corrector

That's all folks!

Usage examples
--------------

Parse and convert
~~~~~~~~~~~~~~~~~


Examples:

.. code-block:: python

    >>> from nlp_text_corrector import asr_post_process

    >>> asr_post_process.convert("Book twenty first century marvel movie for my two kids of age nine and thirteen at eight twenty two pm tonight")
    Book 21st century marvel movie for my 2 kids of age 9 and 13 at 8:22 pm tonight

    >>> asr_post_process.convert("fifty-one million five hundred seventy-eight thousand three hundred two")
    51578302

    >>> asr_post_process.convert("eighty-one")
    81

    >>> asr_post_process.convert("On May twenty-third , I bought twenty-five cows, twelve chickens and one hundred twenty five point four zero kg of potatoes.")
    On May 23rd, I bought 25 cows, 12 chickens and 125.40 kg of potatoes.

Contribute
----------

Join us on https://github.com/iAmPlus/nlp-text-corrector
hashdigits 0.0.4
Matching and parsing file or string patterns like img_####.jpg
License: MIT
Requires Python: >=3.7
Keywords: text,string,pattern,regex,parsing,integer,glob,hash,digit,number

# [hashdigits](https://github.com/rtmigo/hashdigits_py#readme)

Python library for matching file or string patterns like `img-####.jpg`,
where the hash sign `#` denotes a single digit.

Such patterns are used, for example, for the file names of individual video
frames in  [ffmpeg](https://www.ffmpeg.org/)
and [Blender](https://www.blender.org/).

# Install

```
pip3 install hashdigits
```

<details>
<summary>other options</summary>

#### Install pre-release from GitHub:
```
pip3 install git+https://github.com/rtmigo/hashdigits_py@staging#egg=hashdigits
```

</details>

# Use

## Matching with glob

```python
import glob
import hashdigits

file_mask = hashdigits.pattern_to_glob('/path/to/img####.jpg')

print(glob.glob(file_mask))

# prints all files matching /path/to/img####.jpg
```

## Matching with regular expressions

```python
import re
import hashdigits

regex = hashdigits.pattern_to_regex('img####.jpg')

a = re.match(regex, 'img0023.jpg')
print(a.group(0))  # img0023.jpg
print(a.group(1))  # 0023

b = re.match(regex, 'anything.txt')
print(b)  # None
```

## Extracting integers

```python
import hashdigits

x: int = hashdigits.extract_number("img####.jpg", "img0023.jpg")

print(x)  # 23

try:
    y = hashdigits.extract_number("img####.jpg", "thumbs.db")
except hashdigits.PatternMismatchError:
    print("Oops!")
```