Skip to main content

Add your description here

Project description

P.U.D.L.y

Python Url Downloader Library 🤷

pre-commit.ci status pytest uv Ruff gitmoji

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


Download files

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

Source Distribution

pudly-1.0.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

pudly-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for pudly-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f8950658eefa682d5b9eb53c26a96c800a92894006eb81a10708b88003a4d3ca
MD5 8e6b08461b6b8655938c85f7390fb117
BLAKE2b-256 7b5df0300e4d7c85d5b67172c5f96ee9086e8ffbfd659b4591b83afbff901573

See more details on using hashes here.

Provenance

The following attestation bundles were made for pudly-1.0.0.tar.gz:

Publisher: release.yaml on 8-bit-hunters/pudly

Attestations:

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

Hashes for pudly-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80da8bf70b1907bc4b0e4f8f13ef610c8126d745b796d87be2761eeefeb3be94
MD5 37c7840034e8ada10039ed8fe7bfe522
BLAKE2b-256 2191a9444b755788ca32421eb11f1cade1d8ac5bcd6ab4a47bc4df4497e4423f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pudly-1.0.0-py3-none-any.whl:

Publisher: release.yaml on 8-bit-hunters/pudly

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