Add your description here
Project description
P.U.D.L.y
Python Url Downloader Library 🤷
The goal of this library to create easy to use functions to download files in Python.
Examples
Downloading one file
The download
function can be used to download a file from an url. The function returns the downloaded file's path.
from pudly.pudly import download
url = "https://databank.worldbank.org/data/download/WDI_CSV.zip"
file = download(url)
assert file.exists()
It takes optional arguments to specify the download directory or any query parameters for the request.
from pudly.pudly import download
from pathlib import Path
url = "https://api.worldbank.org/v2/en/indicator/NY.GDP.MKTP.CD"
query_parameters = {"downloadformat": "csv"}
download_directory = Path("data")
file = download(url, download_dir=download_directory, query_parameters=query_parameters)
assert file.exists()
Downloading multiple files
The download_files_concurrently
function uses threading to download files in parallel. It returns the list of the
downloaded file's path.
from pathlib import Path
from pudly.pudly import download_files_concurrently
urls = [
"https://api.worldbank.org/v2/en/indicator/SP.POP.TOTL?downloadformat=csv",
"https://api.worldbank.org/v2/en/indicator/NY.GDP.MKTP.CD?downloadformat=csv",
"https://api.worldbank.org/v2/en/indicator/EN.POP.DNST?downloadformat=csv",
]
download_dictionary = Path("data")
files = download_files_concurrently(urls, download_dir=download_dictionary)
for file in files:
assert file.exists()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pudly-1.0.0.tar.gz
.
File metadata
- Download URL: pudly-1.0.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8950658eefa682d5b9eb53c26a96c800a92894006eb81a10708b88003a4d3ca |
|
MD5 | 8e6b08461b6b8655938c85f7390fb117 |
|
BLAKE2b-256 | 7b5df0300e4d7c85d5b67172c5f96ee9086e8ffbfd659b4591b83afbff901573 |
Provenance
The following attestation bundles were made for pudly-1.0.0.tar.gz
:
Publisher:
release.yaml
on 8-bit-hunters/pudly
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pudly-1.0.0.tar.gz
- Subject digest:
f8950658eefa682d5b9eb53c26a96c800a92894006eb81a10708b88003a4d3ca
- Sigstore transparency entry: 151037628
- Sigstore integration time:
- Predicate type:
File details
Details for the file pudly-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: pudly-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80da8bf70b1907bc4b0e4f8f13ef610c8126d745b796d87be2761eeefeb3be94 |
|
MD5 | 37c7840034e8ada10039ed8fe7bfe522 |
|
BLAKE2b-256 | 2191a9444b755788ca32421eb11f1cade1d8ac5bcd6ab4a47bc4df4497e4423f |
Provenance
The following attestation bundles were made for pudly-1.0.0-py3-none-any.whl
:
Publisher:
release.yaml
on 8-bit-hunters/pudly
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
pudly-1.0.0-py3-none-any.whl
- Subject digest:
80da8bf70b1907bc4b0e4f8f13ef610c8126d745b796d87be2761eeefeb3be94
- Sigstore transparency entry: 151037630
- Sigstore integration time:
- Predicate type: