Skip to main content

Added as_task() method:

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:

from mycode import my_task

my_task.delay()

Metadata

Release files for celery-task-class 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for celery-task-class 0.1.0
File Size Uploaded Provenance Actions
celery_task_class-0.1.0.tar.gz 1.8 kB Without provenance Details for celery_task_class-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for celery-task-class 0.1.0
File Interpreter ABI Platform Actions
celery_task_class-0.1.0-py3-none-any.whl Python 3 none any Details for celery_task_class-0.1.0-py3-none-any.whl

Total release size: 4.4 kB

Release files / celery_task_class-0.1.0.tar.gz

Download URL celery_task_class-0.1.0.tar.gz
Size 1.8 kB
Tags Source
SHA-256 checksum
How to use checksums
32d77fdd8fd1c99cde28f1188411b8a226e54b5a0ab98f855da9133bb519d0c7
BLAKE2b-256 checksum
How to use checksums
13b5ad9fc0e1efbe82edfeee04cebcb5a629342fa5b1b96120661655f88308d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.10.14 Darwin/24.6.0

Release files / celery_task_class-0.1.0-py3-none-any.whl

Download URL celery_task_class-0.1.0-py3-none-any.whl
Size 2.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a4c1e88e3ae3f3603cca3cf7c5b2d671141e679594524561a6308cd245437c2
BLAKE2b-256 checksum
How to use checksums
63657510997a6183ff7eab322637cf4457f28e0b4f5ffedec1d45af79cf83626
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.10.14 Darwin/24.6.0

Security for celery-task-class 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page