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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pudly-0.0.0.tar.gz.

File metadata

  • Download URL: pudly-0.0.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pudly-0.0.0.tar.gz
Algorithm Hash digest
SHA256 5ae83e2004cec038c1e124e8b778e37650a58f3749e1972207edf0ef230b9520
MD5 eba8213abfe9a7b5dff85713839dabbf
BLAKE2b-256 87937ef88b17429124fbfb2d8c2e11db71b83de9db7d050e42eb805b3bd5fa2d

See more details on using hashes here.

Provenance

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

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

Attestations:

File details

Details for the file pudly-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: pudly-0.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-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6e2f0ae8722b28ce17a2b1090021409e4d5a2b9ba65fd6ef97e4867429d20a7
MD5 85a0b2a01e4982828217f6705bc623b3
BLAKE2b-256 407d0fb062afab886771454e0f116aa2351e69719d96faed3ffef7ef4f5a781e

See more details on using hashes here.

Provenance

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

Publisher: publishing.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