How to Create a Structured ZIP Archive in Python

pip install cloudmersive-convert-api-client
{
"FilesInZip": [
{
"FileName": "string",
"FileContents": "string"
}
],
"DirectoriesInZip": [
{
"DirectoryName": "string",
"DirectoriesInDirectory": [
null
],
"FilesInDirectory": [
{
"FileName": "string",
"FileContents": "string"
}
]
}
]
}
from __future__ import print_function
import time
import cloudmersive_convert_api_client
from cloudmersive_convert_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_convert_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# create an instance of the API class
api_instance = cloudmersive_convert_api_client.ZipArchiveApi(cloudmersive_convert_api_client.ApiClient(configuration))
request = cloudmersive_convert_api_client.CreateZipArchiveRequest() # CreateZipArchiveRequest | Input request
try:
# Compress files and folders to create a new zip archive with advanced options
api_response = api_instance.zip_archive_zip_create_advanced(request)
pprint(api_response)
except ApiException as e:
print("Exception when calling ZipArchiveApi->zip_archive_zip_create_advanced: %s\n" % e)

--

--

--

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to connect to a webserver via SSH

MetaPoo Shitty Stickers Drawing Contest

Flutter MVP: Wrapping your website in an app

Mission Bit & Futurama

Terraform for DDLs is a bad idea

Setup redis and sidekiq service

Vapor — Call an externe web service from your backend

ProGuard your Android App Code

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

Git Flow: Develop Code With Others using Git

Elegant Way to Manage Multiple Independent Python, MySQL, Node Versions

Getting started with Python ASYNCIO [Part-1]

eventloop

3 ways of working with configuration files in Python