Metadata-Version: 2.3
Name: celery-task-class
Version: 0.1.0
Summary: Write Celery task as a class
License: MIT
Author: Enrico Barzetti
Author-email: 7615875+enricobarzetti@users.noreply.github.com
Requires-Python: >=3.9
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: celery (>=5.6.2,<6.0.0)
Description-Content-Type: text/markdown

Added `as_task()` method:

```python
from celery import Celery
from celery import shared_task

from celery_task_class import Task

app = Celery(
    broker="redis://localhost:6379/0",
    backend="redis://localhost:6379/0",
)


class MyTask(Task):
    def run(self, *args, **kwargs):
        print('MyTask.run()')


@shared_task(base=MyTask, bind=True)
def run(self, *args, **kwargs):
    print('run() function task')
    super(self.__class__, self).run(*args, **kwargs)


class MyTask2(MyTask):
    def run(self, *args, **kwargs):
        print('MyTask2.run()')
        super().run(*args, **kwargs)


my_task = MyTask.as_task()
my_task2 = MyTask2.as_task()
```

Caller:

```python
from mycode import my_task

my_task.delay()
```

