Skip to main content

PyPI-Status PyPI-Versions LICENSE Travis Codecov Requirements Status RequiDownloads

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.
Currently supported versions of Django 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

Metadata

Release files for django-tqdm 1.1.0

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

Built distribution (wheel)

Table of built distributions (wheels) for django-tqdm 1.1.0
File Interpreter ABI Platform
django_tqdm-1.1.0-py3-none-any.whl Python 3 none any Details

Release files / django_tqdm-1.1.0-py3-none-any.whl

Download URL django_tqdm-1.1.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
251b01cfbbf2665703a019ffe8e05893b0385f7ecefcb303cce2147c4c5bbb65
BLAKE2b-256 checksum
How to use checksums
d3687a3534f4765d63eada1fdf399b07899c6027b2a3d60b4821087e27f4e523
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

Release history Release notifications | RSS feed

1.3.1

1 release file

1.3.0

1 release file

1.2.0

1 release file

This release

1.1.0 This release

1 release file

1.0.0

2 release files

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release 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