Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

A package containing local utilities for simplifying every day coding and scripting

Project description

The motils package includes the following functions:
  • file_to_string(file_name): converts a file to string and returns the string
  • remove_commas(file_name, new_file_name=None): removes commas from a file and replaces them with newlines
  • zip_files(file_list, output_path): zips a list of files and returns the path to the zip file
  • debug(debug_string, to_debug): prints timestamp + string only if the to_debug flag is True
  • create_folder_if_needed(path): creates a folder if it doesn’t already exist
  • file_len(file_name): returns the length of the file in lines
  • targz_folder(folder, archive_name=None): returns a path to tar.gz folder made out of folder
  • write_bash_script(command_line, write_folder, script_name=”run_script.sh”): writes a bash script and returns its path
  • merge_two_dicts(x, y): returns a merged dictionary
  • is_number(s): returns True if the string is a number

I have used several of these functions in my work on a daily basis, so why not publish them?

Written by Moran Neuhof, 2017

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
motils-0.1.1-py2.py3-none-any.whl (4.8 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Feb 8, 2017
motils-0.1.1.tar.gz (3.8 kB) Copy SHA256 hash SHA256 Source None Feb 8, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page