Skip to main content

Update JSON file inside of the ZIP file

Project description


Extract ZIP file. Edit JSON to update with new value of the key. Compress all files to tne new ZIP file


.. image:: https://img.shields.io/codecov/c/github/codecov/example-python.svg

Python script to extract ZIP file utdate JOSN key/value and create new ZIP file.

  • zipper.py - Script contains four functions. read_zip_file, update_json_file, get_all_file_paths and prepareZipFile.
  • read_zip_file - This function prints content of ZIP file and extract in the same folder.
  • update_json_file - This function opens JSON file and edit defined key to the defined value.
  • get_all_file_paths - This function creates list of the all files from argument PATH.
  • prepareZipFile - This function will use get_all_file_paths function to get all files PATH and then archive them to the other file.

===== Usage

Requirements: Python3.4 with simplejson and argparse library installed:

Syntax:

.. code-block:: bash

# ./zipper.py
usage: zipper.py [-h] -zin ZIPINPUT -zout ZIPTOOUT -jsonf JSONFILE
zipper.py: error: the following arguments are required: -zin, -zout, -jsonf

..

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

editjsoninzip-0.1.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file editjsoninzip-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: editjsoninzip-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for editjsoninzip-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5b93ead4ba11efc3d4e1588f082dfc624d0be458670a5fd5e157b5a6d2970139
MD5 330b29615253d68bcb4abe58bcccc470
BLAKE2b-256 d39614d7e18ea7889699116dba77a0535ee13e9433d8c7a36577cbce4ed75400

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page