Skip to main content

An script for saving json data and results locally on your machine

Project description

Project description

issues forks stars license

This is a utility project that helps you download files attached to an api response and save them locally. It also includes method for downloading network images to your local storage.

The api_server.api_downloader manages all downloads for images linked with any json response.

Supported Input Types

The api-clone supports both json and normal python dictionaries for scraping api response. For downloading urls from url, a string would be required

Installation

The installation is simple:

pip install api-clone

Usage

  1. To download a single image from a url
from api_clone.api_downloader import saveImage

saveImage(image_url='url_of_image', folder_name='name of folder to save the image')
  1. To save all images from a json response locally on your device
from api_clone.api_downloader import ApiDownloader

downloader = ApiDownloader(your_json_response_here)
downloader.downloadAllImages(folder_name='name of folder for saving images')
  1. Save all images under a specific key in the json file. This method saves images with values having the same key as you specified.
from api_clone.api_downloader import ApiDownloader

downloader = ApiDownloader('json_response')
downloader.downloadImagesAtKey(key_name='name of image key', folder_name='folder name')

Fields

field type Default description
map dict None json response
folder_name str images name of the folder where your images are saved
image_format ImageFormat ImageFormat.jpg format to save the image ie. png, jpg, jpeg

Features

  • Download all network images referenced from a json file
  • Rename image json with names of local images on the pc

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

api_clone-0.0.2.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

api_clone-0.0.2-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

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