Skip to main content

PyPI-Status PyPI-Versions LICENSE Tests Codecov Requirements Status Downloads

Fast, Extensible Progress Meter (tqdm) For Django.

Use tqdm in Django management commands seamlessly.
It provides simple universal commands for Django management command to output text using standard command functions and tqdm.
Only currently supported versions of Django and Python are supported.

Usage

from django_tqdm import BaseCommand
from time import sleep

class Command(BaseCommand):
    def handle(self, *args, **options):
        # Output directly
        self.error("Error")
        self.info("Info")

        # Output through tqdm
        t = self.tqdm(total=50)
        for x in range(50):
            sleep(0.03)
            t.update(1)

            if x == 10:
                t.info("X = 10")
            if x == 20:
                t.error("X = 20")

Advanced:

info(text, ending="\n", fatal=False)
error(text, ending="\n", fatal=False)
write(text, ending="\n", fatal=False, error=False)

If you set fatal to True it will terminate the command after printing the message.

For documentation on tqdm see tqdm.

Comparison

In django-tqdm:

self.info("info")
self.error("error")

In vanilla Django:

self.stdout.write("info")
self.stderr.write("error")

Demos

Demo 1 - Simple usage

self.info("info")
self.error("error")

Demo1

Demo 2 - tqdm usage

t = self.tqdm(total=50)
for x in range(50):
    sleep(0.02)
    t.update(1)
    if x == 10:
        t.info("info")
    if x == 40:
        t.error("error")

Demo2

Demo 3 - Vanilla tqdm with default settings for comparison

t = tqdm(total=50)
for x in range(50):
    sleep(0.02)
    t.update(1)
    if x == 25:
        t.write("info")
    if x == 40:
        t.write("error", file=sys.stderr)

Demo3

Developer documentation

Read developer documentation.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_tqdm-1.3.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file django_tqdm-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: django_tqdm-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for django_tqdm-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8cfdd5d81c79763df1f5f4abb75e27b5234144601af0efaeb680150019c8532
MD5 3f8cd0f2aa30101bde4983ee69b4a771
BLAKE2b-256 cd8722401d00b2cf049e10450294af43395d4b50a5e16c5ac889c1bebbff67be

See more details on using hashes here.

Release history Release notifications | RSS feed

1.3.1

1 file

This release

1.3.0 This release

1 file

1.2.0

1 file

1.1.0

1 file

1.0.0

2 files

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

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