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-2.0.0.tar.gz
.
File metadata
- Download URL: pudly-2.0.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a30be04f6a27bda2b87371bd6d781d0dbeff7026b6febcffd6976fddd3a911c3 |
|
MD5 | c1e19ed6502c29fe55b29598ff35f3b2 |
|
BLAKE2b-256 | e3a749ff2d1093b6bf0d44f2781e0fe8af1e8f641e459cc171f921b021ed1bf4 |
Provenance
The following attestation bundles were made for pudly-2.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-2.0.0.tar.gz
- Subject digest:
a30be04f6a27bda2b87371bd6d781d0dbeff7026b6febcffd6976fddd3a911c3
- Sigstore transparency entry: 152261448
- Sigstore integration time:
- Predicate type:
File details
Details for the file pudly-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: pudly-2.0.0-py3-none-any.whl
- Upload date:
- Size: 5.2 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 | 8cc5c84ba82c973efab99072ca4e81c8ddca3c94f867b27d99fa8dc7068db177 |
|
MD5 | d81748067d32cd9fc3efb9bb743b3656 |
|
BLAKE2b-256 | 67b7f550c799c3ee71f35fae0ac32cf988c47d226b0e6e53ed18acf429307517 |
Provenance
The following attestation bundles were made for pudly-2.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-2.0.0-py3-none-any.whl
- Subject digest:
8cc5c84ba82c973efab99072ca4e81c8ddca3c94f867b27d99fa8dc7068db177
- Sigstore transparency entry: 152261449
- Sigstore integration time:
- Predicate type: