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.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

net_dl-0.2.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: net_dl-0.2.1.tar.gz
  • Upload date:
  • Size: 11.9 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.1.tar.gz
Algorithm Hash digest
SHA256 e8475c5e0ad63beba69ef95af9d1dfcbb9764af06daf52c9cf66fd707f5ab55f
MD5 ea8b2c6a7494d2dfa26b28a489e945fe
BLAKE2b-256 60defc0a21deaf54064c741923b6469becf2c3aa2c716b88060b1f45b8c85ba0

See more details on using hashes here.

Provenance

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

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

Attestations:

File details

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

File metadata

  • Download URL: net_dl-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c811a40377fd9e567fd1204f3b625ca5fe22371c6abf40435aad08d9fa40e3c2
MD5 972367b81d4750569f0de7ca94cc21a0
BLAKE2b-256 6e8709f9fe9111c61fd25095ba39858d5a1e7d518f4c5880366b4054516f80f7

See more details on using hashes here.

Provenance

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

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

Attestations:

Supported by

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