Skip to main content

Simple package to download & unzip archives within notebooks.

Project description

Zipmigo

Zipmigo is intended to assist fledgling data analysts and scientists with the process of downloading a zip file via http and unzipping it into the working directory when working in a notebook environment, saving them time and energy wading through os, requests, and running shell commands to inspect the directory structure.

Story

This package was born of the author's hatred for recursive folders within zip files, as well as her need to use the same commands over and over again to download & unpack zip archives. Over the course of a project, she found herself constantly reusing code snippets - a sign that one should wrap it up into a script. However, she was working in google colab, which was designed for collaborative notebook workflows. It seemed that distributing a package on PyPi was the easiest way to import a script into colab for her audience, and thus zipmigo was born.

Installation

Zipmigo is available for commandline installation from PyPi via pip install zipmigo.

Google Colab

Run !pip install zipmigo

From Source

git clone https://github.com/kaszklar/zipmigo.git to your directory of choice. cd zipmigo and install with python setup.py install.

Examples

Importing

import zipmigo

Download a zip file

Download a file to the current working directory. The status of the connection and the progress of the download will be printed out.

zipmigo.download("https://geo.nyu.edu/download/file/harvard-ntadcd106-shapefile.zip", 'congressdistricts.zip')

Print out the contents of the current working directory & subdirectories

zipmigo.list_dir()

Unzip

Unpack zip file into current directory. If the archive has only directories in the root, those directories will be placed in the current working directory.

zipmigo.unzip("congressdistricts.zip")

Release History

[1.1.0] 2020.08.12
Refactor for namespace
Adjust download control flow

[1.0.1] 2020.05.05
Some error handling and type assertions
Correct readme instructions

[1.0.0] 2020.02.13
Initial Release 🎉

Future features?

  • Inspect zip archive prior to opening
  • Extract a single file from the archive

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

zipmigo-1.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

zipmigo-1.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file zipmigo-1.1.0.tar.gz.

File metadata

  • Download URL: zipmigo-1.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.3.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for zipmigo-1.1.0.tar.gz
Algorithm Hash digest
SHA256 22c4d966c2e22a1f324600699720df4810297f4d34b6093622f3d397d3a28233
MD5 2f037184b35653b9f569eb62166c4d3a
BLAKE2b-256 8f5af6c1a06d38d3414c20f1c8272b21e6d491e3e627311f6c0cac0fc570c929

See more details on using hashes here.

File details

Details for the file zipmigo-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: zipmigo-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.3.2 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for zipmigo-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f50bbf19eb554f53cc874ef54a0d33306bc5193b5a882facb396ea2d46b8e54
MD5 b4562f4c16aff63bf359a1dba74e1fdd
BLAKE2b-256 643de00e36f6c7fc63d7cbaf744460c6b5bc38eefd9a8cbe6f4e39e94b88f5ca

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