Easy compression and extraction for any compression or archival format.

Related tags

General Utilitiestzar
Overview

Tzar: Tar, Zip, Anything Really

Easy compression and extraction for any compression or archival format.

Demo GIF

Usage/Examples

tzar compress large-dir compressed.tar.gz
tzar extract compressed.tar.gz large-dir
tzar list compressed.tar.gz

It's always tzar []

Installation

The package is published in PyPi under tzar. You can install it with the following methods

Pipx (recommended)

pipx install tzar

Pip

pip3 install tzar

Dev

git clone [email protected]:DanielVZ96/tzar
cd tzar
poetry install
export TZAR_CONFIG=$PWD/config

Configuration

Configuration is read from the standard directories for each OS (~/.config/tzar/*.toml). You can add any number of toml files to that directory and they will all be read by tzar at runtime.

The configuration file has the following format:

[command or format]
extract = "command extract ${verbose} ${filename} ${directory}" 
compress = "command compress ${verbose} ${directory} ${filename}" 
show = "command list ${verbose} ${filename}" 
extensions = [".ext1",".ext2"]
verbose = "-v" 

[another command or format]
extract = "another x${verbose} ${filename} ${directory}" 
compress = "another c${verbose} ${directory} ${filename}" 
show = "another list ${verbose} ${filename}" 
extensions = [".anoth"]
verbose = "v" 

All commands should have the extract, compress, show, extensions and verbose values defined. They are all self explanatory; they define templates for the commands to run, the extensions for these commands, and how you can ask for a verbose output.

They can all contain the following template variables that will be replaced at runtime:

-verbose: Defines how and where to ask for a verbose output (defined in the verbose = variable definition).

-filename: The name of the compressed file. Corresponds to in the extract and list subcommands, and to in the compress subcommand

-directory: The target directory. Corresponds to in the extract and list subcommands, and to in the compress subcommand

Why?

  1. Because I think it's simpler

You may think that this should be doable with aliases, but I tried and I couldn't. Maybe you can use the fuck app or tldr but I still feel it could be simpler to extract files (wtf does xvzf even mean?).

  1. Because I wanted to try the idea of Code as Configuration

Maybe this sounds crazy, but I started this project by exploring the idea of storing the main behaviour of code in configuration files (in this case TOML), in order to ease extensibility, reduce posible errors, and keep things simple. In my dayjob we tried this idea with my colleagues and the result is that changes that previously spawned several files or lines of code, are now reduced into 2 or 3 hard-to-fuck-up yaml lines. If this project gains traction I may write a blog post about this.

TODO

  • [-] Add a ton of new file formats
  • Document code
  • Interactive prompt
  • Tests (Don't judge, I'm coding this in the spare time I have during my lunch breaks.)

Authors

Owner
DanielVZ
History Major turned Software Engineer.
DanielVZ
Color getter (including method to get random color or complementary color) made out of Python

python-color-getter Color getter (including method to get random color or complementary color) made out of Python Setup pip3 install git+https://githu

Jung Gyu Yoon 2 Sep 17, 2022
Here, I find the Fibonacci Series using python

Fibonacci-Series-using-python Here, I find the Fibonacci Series using python Requirements No Special Requirements Contribution I have strong belief on

Sachin Vinayak Dabhade 4 Sep 24, 2021
Script to generate a massive volume of data in sql, csv, json or xml format

DataGenerator Made with Python Open for pull requests 1. Dependencies To install required dependencies run pip install -r requirements.txt 2. Executi

icrescenti 3 Sep 20, 2022
More routines for operating on iterables, beyond itertools

More Itertools Python's itertools library is a gem - you can compose elegant solutions for a variety of problems with the functions it provides. In mo

2.9k Jan 06, 2023
Kanye West Lyrics Generator

aikanye Kanye West Lyrics Generator Python script for generating Kanye West lyrics Put kanye.txt in the same folder as the python script and run "pyth

4 Jan 21, 2022
Automatic generator of readmes for git repositories (Includes file' listing)

Readme Generator We are bored of write the same things once and once again. We trust in the comments made inside of our files, and we decided to autom

Natalia Vera Duran 6 Jul 20, 2021
Writing Alfred copy/paste scripts in Python

Writing Alfred copy/paste scripts in Python This repository shows how to create Alfred scripts in Python. It assumes that you using pyenv for Python v

Will Fitzgerald 2 Oct 26, 2021
SH-PUBLIC is a python based cloning script. You can clone unlimited UID facebook accounts by using this tool.

SH-PUBLIC is a python based cloning script. You can clone unlimited UID facebook accounts by using this tool. This tool works on any Android devices without root.

(Md. Tanvir Ahmed) 5 Mar 09, 2022
Password generator

Password generator technologies used What is? It is Password generator How to Download? Download on releases Clone repo git clone https://github.com/m

Miek 1 Nov 02, 2021
A way to write regex with objects instead of strings.

Py Idiomatic Regex (AKA iregex) Documentation Available Here An easier way to write regex in Python using OOP instead of strings. Makes the code much

Ryan Peach 18 Nov 15, 2021
A Python utility belt containing simple tools, a stdlib like feel, and extra batteries. Hashing, Caching, Timing, Progress, and more made easy!

Ubelt is a small library of robust, tested, documented, and simple functions that extend the Python standard library. It has a flat API that all behav

Jon Crall 638 Dec 13, 2022
Random Name and Slug Generator

Random Name and Slug Generator

Alexander Lukanin 104 Nov 30, 2022
Simple script to export contacts from telegram into vCard file

Telegram Contacts Exporter Simple script to export contacts from telegram into vCard file Getting Started Prerequisites You must to put your Telegram

Pere Antoni 1 Oct 17, 2021
Format Norminette Output!

Format Norminette Output!

7 Apr 19, 2022
Nmap script to guess* a GitLab version.

gitlab-version-nse Nmap script to guess* a GitLab version. Usage https://github.com/righel/gitlab-version-nse cd gitlab-version-nse nmap target --s

Luciano Righetti 120 Dec 05, 2022
A functional standard library for Python.

Toolz A set of utility functions for iterators, functions, and dictionaries. See the PyToolz documentation at https://toolz.readthedocs.io LICENSE New

4.1k Dec 30, 2022
A workflow management tool for numerical models on the NCI computing systems

Payu Payu is a climate model workflow management tool for supercomputing environments. Payu is currently only configured for use on computing clusters

The Payu Organization 11 Aug 25, 2022
Simple tool for creating changelogs

Description Simple utility for quickly generating changelogs, assuming your commits are ordered as they should be. This tool will simply log all lates

2 Jan 05, 2022
aws ec2.py companion script to generate sshconfigs with auto bastion host discovery

ec2-bastion-sshconfig This script will interate over instances found by ec2.py and if those instances are not publically accessible it will search the

Steve Melo 1 Sep 11, 2022
Create password - Generate Random Password with Passphrase

Generate Random Password with Passphrase This is a python code to generate stron

1 Jan 18, 2022