Skip to main content

celery-bittensor

Bittensor's Schedule for Celery

Installation

pip install celery-bittensor

Requires Python 3.10+.

Example

import celery
import celery_bittensor

app = celery.Celery()
app.conf.beat_scheduler = "celery_bittensor.PersistentScheduler"
app.conf.beat_schedule = {
    "add-every-finalized-block": {
        "task": "tasks.test",
        "schedule": celery_bittensor.schedule(
            run_every=1,
        ),
        "args": ("New Block",),
    },
    "add-every-10-finalized-blocks-relative-to-0": {
        "task": "tasks.test",
        "schedule": celery_bittensor.schedule(
            run_every=1,
            relative=True,
        ),
        "args": ("Every 10 Blocks",),
    },
    "add-every-block-on-testnet": {
        "task": "tasks.test",
        "schedule": celery_bittensor.schedule(
            run_every=1,
            network="test",
            finalized=False,
        ),
        "args": ("New Test Block",),
    },
    "add-first-10-epoch": {
        "task": "tasks.test",
        "schedule": celery_bittensor.epoch(
            block="0-9",
            netuid=1,
        ),
        "args": ("First 10 Blocks of Subnet 1 Epoch",),
    },
    "add-50-and-75-epoch": {
        "task": "tasks.test_block",
        "schedule": celery_bittensor.epoch(
            block="49,74",
            netuid=1,
        ),
        "args": ("50th and 75th Block of Subnet #1 Epoch",),
        "kwargs": {
            "block": celery_bittensor.LazyBlockNumber(),
        },
    },
}



@app.task
def test(arg):
    print(arg)


@app.task
def test_block(arg, block):
    print(f"Block {block}: {arg}")

Bittensor tasks may be rescheduled (awaiting connection, etc.). Please run Beat with celery_bittensor.PersistentScheduler:

celery -A tasks beat --scheduler celery_bittensor.PersistentScheduler

License

BSD 3-Clause License, see LICENSE.

Metadata

Release files for celery-bittensor 0.6.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-bittensor 0.6.0
File Size Uploaded Provenance Actions
celery_bittensor-0.6.0.tar.gz 10.3 kB With provenance Details for celery_bittensor-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for celery-bittensor 0.6.0
File Interpreter ABI Platform Actions
celery_bittensor-0.6.0-py3-none-any.whl Python 3 none any Details for celery_bittensor-0.6.0-py3-none-any.whl

Total release size: 19.2 kB

Release files / celery_bittensor-0.6.0.tar.gz

Download URL celery_bittensor-0.6.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
23bee2c5e9a7b1a9954095a4e79d8d983a09a6ed5dd2bcd5adf2a7316d5e8eb1
BLAKE2b-256 checksum
How to use checksums
4b55004b6c7ea51792bb960bf73783259c7bf50a9d8d2472ae907ab674f7bc1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / celery_bittensor-0.6.0-py3-none-any.whl

Download URL celery_bittensor-0.6.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c903f2fd8ff3b63831ae50d0239deb85be7ab2846f74cc3c7d0c7331edd6d87
BLAKE2b-256 checksum
How to use checksums
a8a76a51e7395010da5a44ffce8de222cc78385df017e6d169fb770f0d74e112
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for celery-bittensor 0.6.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for celery_bittensor-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

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.

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