Metadata-Version: 2.1
Name: django-num2fa
Version: 1.0.3
Summary: A Django app with filters to convert numbersinto Persian numbers or words.
Author: Emad Rad
Author-email: codewithemad@gmail.com
License: AGPLv3
Project-URL: Code, https://github.com/codewithemad/django-num2fa
Project-URL: Issue tracker, https://github.com/codewithemad/django-num2fa/issues
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Development Status :: 4 - Beta
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: Django
Requires-Dist: num2fa
Provides-Extra: dev
Requires-Dist: black==23.12.1; extra == "dev"
Requires-Dist: pylint==3.0.3; extra == "dev"
Requires-Dist: scriv==1.5.1; extra == "dev"
Requires-Dist: twine==4.0.2; extra == "dev"
Requires-Dist: pytest==7.4.4; extra == "dev"
Requires-Dist: pytest-django==4.7.0; extra == "dev"
Requires-Dist: tox==4.11.4; extra == "dev"

# Django Num2Fa

[![PyPI releases](https://img.shields.io/pypi/v/django-num2fa?logo=python&logoColor=white)](https://pypi.python.org/pypi/django-num2fa)
[![License](https://img.shields.io/github/license/codewithemad/django-num2fa.svg?style=flat-square)](https://opensource.org/license/agpl-v3/)

`django-num2fa` is a wrapper around [num2fa](https://github.com/codewithemad/num2fa) package which provides a set of filters to convert numbers to Persian numbers and words.

## Installation

```bash
pip install -U django-num2fa
```

That's it!

## Usage

First, add `django_num2fa` inside your `INSTALLED_APPS`:

```python
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django_num2fa',
    # other packages
]
```

load `num2fa` inside your template:

```jinja
{% load num2fa %}
```

then, wherever you have a number in your code template, pipe it with one of the `fa_numbers`, `fa_words`, and `fa_ordinal_words` template filters.

```jinja
{% load num2fa %}

{{ number | fa_numbers }}
{{ number | fa_words }}
{{ number | fa_ordinal_words }}
```

## Contributing

We welcome contributions! To learn how you can contribute, please check the [Contributing](https://github.com/codewithemad/django-num2fa/blob/master/docs/Contributing.md) document.

## License

This work is licensed under the terms of the [GNU Affero General Public License (AGPL)](https://github.com/codewithemad/django-num2fa/blob/master/LICENSE.txt).
