Skip to main content

Download web pages and files from the internet using CLI or as a Python module.

Project description

net-dl

Download web pages and files from the internet. Can be used as a standalone CLI command, or as a python module.

Usage & Documentation

Installation

End Users (with pipx)

python3 -m pip install pipx
pipx install net-dl

Dev Users (with pip)

python3 -m pip install net-dl

External progress bar example

demo/tkapp.py:

from net_dl import Download
from queue import Queue
from threading import Thread
from tkinter import IntVar
from tkinter import StringVar
from tkinter import Tk
from tkinter import ttk


class Win(ttk.Frame):
    def __init__(self, root):
        super().__init__(root)
        self.root = root
        self.root.title("net-dl demo")

        self.urlv = StringVar()
        self.urlw = ttk.Entry(self, textvariable=self.urlv)
        self.getw = ttk.Button(self, text="Get", command=self.get)
        self.progq = Queue()
        self.progv = IntVar()
        self.proge = '<<UpdateProgress>>'
        self.root.bind(self.proge, self.update_progress)
        self.progw = ttk.Progressbar(
            self,
            mode='determinate',
            variable=self.progv,
            )

        self.grid(column=0, row=0, sticky='nesw')
        self.urlw.grid(column=0, row=0, columnspan=4, sticky='we')
        self.getw.grid(column=4, row=0)
        self.progw.grid(column=0, row=1, columnspan=5, sticky='we')

    def get(self):
        dl = Download(
            self.urlv.get(),
            progress_queue=self.progq,
            callback=self.root.event_generate,
            callback_args=[self.proge],
            )
        self.get_thread = Thread(target=dl.get, daemon=True)
        self.get_thread.start()

    def update_progress(self, evt):
        self.progv.set(self.progq.get())


def run():
    root = Tk()
    Win(root)
    root.mainloop()

Run code:

demo$ python -c 'import tkapp; tkapp.run()'

https://github.com/user-attachments/assets/a33d7752-3167-4224-a7ce-4fb56f69fe5d

Releasing on PyPI

  • Create new tag in repo that matches package version; e.g. if version is "0.1.0", tag will be "v0.1.0".
  • CI will auto build and upload package to TestPyPI and PyPI.

Project details


Download files

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

Source Distribution

net_dl-0.2.3.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

net_dl-0.2.3-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file net_dl-0.2.3.tar.gz.

File metadata

  • Download URL: net_dl-0.2.3.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for net_dl-0.2.3.tar.gz
Algorithm Hash digest
SHA256 b975abeb5596ade4b3f619b6e28c5746f88e9cabb3ad74301e14114af4db565f
MD5 40e5caef85c1c3284f491ea8b15459f9
BLAKE2b-256 e973ebbd9c9f660902da4e22a4e805c3a06d20b3e35ae2c00013f6e1b7c165f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for net_dl-0.2.3.tar.gz:

Publisher: publish.yml on sil-car/net-dl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file net_dl-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: net_dl-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for net_dl-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8306d5e74f8f19578b63c3f20c796d7c38d5d4a4acc5ad1f19c89dff4bce0415
MD5 92c2c6a1b1fc5090b26c41b9d00caad2
BLAKE2b-256 7ff4d79061ec8b75c96174033874061e6159aa3bdb7bc2fe5076e71ec18cac15

See more details on using hashes here.

Provenance

The following attestation bundles were made for net_dl-0.2.3-py3-none-any.whl:

Publisher: publish.yml on sil-car/net-dl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page