Name | net-dl JSON |
Version |
0.2.3
JSON |
| download |
home_page | None |
Summary | Download web pages and files from the internet using CLI or as a Python module. |
upload_time | 2024-11-30 05:13:06 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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](https://sil-car.github.io/net-dl/)
## 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`:
```python
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "net-dl",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Nate Marti <nate_marti@sil.org>",
"download_url": "https://files.pythonhosted.org/packages/e9/73/ebbd9c9f660902da4e22a4e805c3a06d20b3e35ae2c00013f6e1b7c165f1/net_dl-0.2.3.tar.gz",
"platform": null,
"description": "# net-dl\n\nDownload web pages and files from the internet. Can be used as a standalone\nCLI command, or as a python module.\n\n[Usage & Documentation](https://sil-car.github.io/net-dl/)\n\n## Installation\n\n**End Users (with pipx)**\n```\npython3 -m pip install pipx\npipx install net-dl\n```\n\n**Dev Users (with pip)**\n```\npython3 -m pip install net-dl\n```\n\n## External progress bar example\n`demo/tkapp.py`:\n```python\nfrom net_dl import Download\nfrom queue import Queue\nfrom threading import Thread\nfrom tkinter import IntVar\nfrom tkinter import StringVar\nfrom tkinter import Tk\nfrom tkinter import ttk\n\n\nclass Win(ttk.Frame):\n def __init__(self, root):\n super().__init__(root)\n self.root = root\n self.root.title(\"net-dl demo\")\n\n self.urlv = StringVar()\n self.urlw = ttk.Entry(self, textvariable=self.urlv)\n self.getw = ttk.Button(self, text=\"Get\", command=self.get)\n self.progq = Queue()\n self.progv = IntVar()\n self.proge = '<<UpdateProgress>>'\n self.root.bind(self.proge, self.update_progress)\n self.progw = ttk.Progressbar(\n self,\n mode='determinate',\n variable=self.progv,\n )\n\n self.grid(column=0, row=0, sticky='nesw')\n self.urlw.grid(column=0, row=0, columnspan=4, sticky='we')\n self.getw.grid(column=4, row=0)\n self.progw.grid(column=0, row=1, columnspan=5, sticky='we')\n\n def get(self):\n dl = Download(\n self.urlv.get(),\n progress_queue=self.progq,\n callback=self.root.event_generate,\n callback_args=[self.proge],\n )\n self.get_thread = Thread(target=dl.get, daemon=True)\n self.get_thread.start()\n\n def update_progress(self, evt):\n self.progv.set(self.progq.get())\n\n\ndef run():\n root = Tk()\n Win(root)\n root.mainloop()\n```\nRun code:\n```\ndemo$ python -c 'import tkapp; tkapp.run()'\n```\n\nhttps://github.com/user-attachments/assets/a33d7752-3167-4224-a7ce-4fb56f69fe5d\n\n## Releasing on PyPI\n\n- Create new tag in repo that matches package version; e.g. if version is \"0.1.0\", tag will be \"v0.1.0\".\n- CI will auto build and upload package to TestPyPI and PyPI.\n",
"bugtrack_url": null,
"license": null,
"summary": "Download web pages and files from the internet using CLI or as a Python module.",
"version": "0.2.3",
"project_urls": {
"Homepage": "https://sil-car.github.io/net-dl/",
"Issues": "https://github.com/sil-car/net-dl/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7ff4d79061ec8b75c96174033874061e6159aa3bdb7bc2fe5076e71ec18cac15",
"md5": "92c2c6a1b1fc5090b26c41b9d00caad2",
"sha256": "8306d5e74f8f19578b63c3f20c796d7c38d5d4a4acc5ad1f19c89dff4bce0415"
},
"downloads": -1,
"filename": "net_dl-0.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "92c2c6a1b1fc5090b26c41b9d00caad2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 11156,
"upload_time": "2024-11-30T05:13:00",
"upload_time_iso_8601": "2024-11-30T05:13:00.685840Z",
"url": "https://files.pythonhosted.org/packages/7f/f4/d79061ec8b75c96174033874061e6159aa3bdb7bc2fe5076e71ec18cac15/net_dl-0.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e973ebbd9c9f660902da4e22a4e805c3a06d20b3e35ae2c00013f6e1b7c165f1",
"md5": "40e5caef85c1c3284f491ea8b15459f9",
"sha256": "b975abeb5596ade4b3f619b6e28c5746f88e9cabb3ad74301e14114af4db565f"
},
"downloads": -1,
"filename": "net_dl-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "40e5caef85c1c3284f491ea8b15459f9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 12033,
"upload_time": "2024-11-30T05:13:06",
"upload_time_iso_8601": "2024-11-30T05:13:06.006946Z",
"url": "https://files.pythonhosted.org/packages/e9/73/ebbd9c9f660902da4e22a4e805c3a06d20b3e35ae2c00013f6e1b7c165f1/net_dl-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-30 05:13:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sil-car",
"github_project": "net-dl",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "net-dl"
}