httpie /
http-prompt
An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie
Loading repository data…
alenton / repository
An python command line tool for tabulating works
This is PYSQL. No, it is not exactly SQL but gives almost Excel experience.
The help menu is not perfectly useful, We advise you to read this README.md Manuel for better instructions.
PYSQL, is a ascii based tabulator and editor. PYSQL is completely based 2D lists.
2D lists represents row and column, and it also most compatible with tabulate.
This tool uses some modules for its perfection. They are;
Or just install with single command: pip install tabulate xlwt cryptography unit_converter
The others are already installed one which comes with python
PYSQL do not have restriction over the extensions of the file. But .txt is recommendable.
There are several arguments for Pysql. We will get through one by one. Here is an complete guide: But first, Here's a sample.
> python3 PYSQL.py -m -f SAMPLE.txt --table
╒══╤══╕
│ │ │
╘══╧══╛
Note: The
-margument creates the file if it's new. If it's already exist, it will give you a warning that the file already exist.
Note:
-fargument selects the file for action
Note:
--tableargument shows the data as a table.
python3 pysql.py -f/--file <file-name>
You can create a new file with this command
python3 pysql.py -m/--make -f/--file <file-name>
Note:
-margument stands for--make, which obviously create an file.
For printing the currently saved table, we use --table argument.
Ex:
python3 pysql.py -f <file-name> -t/--table
To save the file for saving the changes, we use --post argument.
Note: This argument needs to be used on the command in which the change occurs. i.e., for every change
--postargument needs to be parsed if you want to save the change.
Note: Also, using without
--postargument, acts like a preview before you save it. i.e., if you are not sure about the result, run it without the--postargument using--table. The result will be shown with the changes you have parsed. If you have verified the result, run the same command with--postto save it.
Row targeting is essential for some arguments. You can also target a range of rows using - symbol.
Syntax:
For single row:
python3 pysql.py -f <file-name> -r <row-index>
For ranged rows:
python3 pysql.py -f <file-name> -r <from>-<to>
It is similar to targeting a row. Targeting a column is used with -cargument.
Syntax:
python3 pysql.py -f <file-name> -c <column-index>
For ranged:
python3 pysql.py -f <file-name> -c <from>-<to>
To add a row, we should use --add-row argument.
It is followed by the number of columns to be added.
That is:
python3 pysql.py -f <file-name> --add-row 1
This would add 1 row to the file.
In action:
python3 PYSQL.py -m SAMPLE.txt -f SAMPLE.txt --table
╒══╤══╕
│ │ │
╘══╧══╛
python3 PYSQL.py -f SAMPLE.txt --add-row 1 --table
╒══╤══╕
│ │ │
├──┼──┤
│ │ │
╘══╧══╛
Similar to--add-row argument,--add-column argument is same.
No context
Unlike --add-row or --add-column. The --remove-row cannot take any parameters. It is a Boolean argument.
The row that needs to be removed will specified by -r argument.
For ranged removing, You still can use -r with '-' as mentioned earlier.
In action:
python3 PYSQL.py -f SAMPLE.txt --table
╒═══╕
│ 1 │
├───┤
│ 2 │
├───┤
│ 3 │
├───┤
│ 4 │
├───┤
│ 5 │
╘═══╛
python3 PYSQL.py -f SAMPLE.txt -r 2-4 --remove-row --table --post
╒═══╕
│ 1 │
├───┤
│ 5 │
╘═══╛
It is as same as --remove-row argument.
You should use -c with --remove-column for to work.
No Other Context
To Inserting a row in between two rows, we use --insert-row argument.
This argument is followed by the number of the rows to be added.
The index of the row at which the row has to be inserted is specified by -r argument.
That is,
python3 PYSQL.py -f <file-name> -r <index> --insert-row <no.of rows>
In action,
python3 PYSQL.py -f SAMPLE.txt --table
╒═══╕
│ 1 │
├───┤
│ 5 │
╘═══╛
python3 PYSQL.py -f SAMPLE.txt -r 2 --insert-row 1 --table --post
╒═══╕
│ 1 │
├───┤
│ │
├───┤
│ 5 │
╘═══╛
We insert 1 row at the second position. That is, the position is defined by -r, while number of row have to be inserted defined by --insert-row.
Inserting a column is same as the inserting a row.
For positioning, -c argument is used, and to control number of columns to be added, --insert-column argument should be used.
To add a data to the table, three peace of information is needed,
-r-c--add-dataIn Skeleton,
python3 PYSQL.py --file <file-name> -r <index> -c <index> --add-data <data>
For example:
python3 PYSQL.py -f SAMPLE.txt --table
╒═══╕
│ 1 │
├───┤
│ │
├───┤
│ 5 │
╘═══╛
python3 PYSQL.py -f SAMPLE.txt -r 2 -c 1 --add-data 9 --table
╒════╕
│ 1 │
├────┤
│ 9 │
├────┤
│ 5 │
╘════╛
So, -r represents the row of the cell, and -c represents the column of the cell.
Appending
If you want to change the data by adding something to it, you can use --append argument.
Usage:
python3 PYSQL.py --file <file-name> -r <index> -c <index> --add-data <data to be added> --append
Note: To use append, the previous data should be saved.
Annotations
Sometimes when you enter a number or a float, it gets converted into a string in the data.
To avoid this, --annotation is used.
This argument is followed by 'str', 'int', or 'float'.
Which denotes the type of the character.
In action:
> python3 PYSQL.py --file sample3.txt --table
╒══╤══╤══╕
│ │ │ │
╘══╧══╧══╛
> python3 PYSQL.py --file sample3.txt --add-data 5 -r 1 -c 1 --post --table
╒═══╤══╤══╕
│ 5 │ │ │
╘═══╧══╧══╛
> cat sample3.txt
[['5', '', '']]
> python3 PYSQL.py --file sample3.txt --add-data 5 -r 1 -c 2 --post --table --annotation int
╒═══╤═══╤══╕
│ 5 │ 5 │ │
╘═══╧═══╧══╛
> cat sample3.txt
[['5', 5, '']]
> python3 PYSQL.py --file sample3.txt --add-data 5 -r 1 -c 3 --post --table --annotation float
╒═══╤═══╤═══╕
│ 5 │ 5 │ 5 │
╘═══╧═══╧═══╛
> cat sample3.txt
[['5', 5, 5.0]]
So the output might not vary, but inside the file you can see the type changed.
When the --add-data is called without --annotation, the data will be stored as str.
With --annotation you can convert it to either int or float
Index
If you in case working with a large set of table, finding the index of the row or column would be difficult,
so, --index argument will number every row and column, for easy navigation.
In action:
python3 PYSQL.py --table -f SAMPLE.TXT
╒══╤══╕
│ │ │
╘══╧══╛
python3 PYSQL.py --table -f SAMPLE.TXT --index
╒═════╤═════╤═════╕
│ 0 │ 1 │ 2 │
╞═════╪═════╪═════╡
│ 1 │ │ │
╘═════╧═════╧═════╛
Note: The number of row or columns don't change when using the
--indexargument.
Headers
Headers are the same just like they sound.
This can be used with --header argument.
In any case, using this option will make the first row as the header.
In action:
python3 PYSQL.py --table -f SAMPLE.txt
╒══╤══╕
│ │ │
├──┼──┤
│ │ │
├──┼──┤
│ │ │
╘══╧══╛
python3 PYSQL.py --table -f SAMPLE.txt --header
╒════╤════╕
│ │ │
╞════╪════╡
│ │ │
├────┼────┤
│ │ │
╘════╧════╛
See those double lines at the bottom of the first row, it defines it's the header.
Note: Using
--indexand--headerat the same time will lead to canceling the header effect. Since the Index of each column is placed as a header when using--index.
Style
The style of the grid is set to fancy_grid by default.
Of course, Style is an option provided by the tabulate module.
You are free to change the style of the grid by, --style argument, followed by the style you prefer.
The available styles are,
There are three arguments for customizing your data.
Font style Font style consists of 4 style,
To use these fonts,
python3 PYSQL.py --file <filename> -r <index> -c <index> --add-data <data> --font-style <style>
Color You can color your data. The available colors are.
To use these color,
python3 PYSQL.py --file <filename> -r <index> -c <index> --add-data <data> --fg <color>
Note: The fonts and colors are case-sensitive
Unicode
Unicode sometimes cannot be added into data just by using --add-data, such that
--unicode argument is followed by the code of the Unicode you have to use along with the data.
For example:
python3 PYSQL.py --file <filename> -r <index> -c <index> --add-data <data> --unicode <code>
In action:
python3 PYSQL.py --file SAMPLE.TXT --table
╒══╤══╕
│ │ │
├──┼──┤
│ │ │
├──┼──┤
│ │ │
╘══╧══╛
python3 PYSQL.py --file SAMPLE.TXT -r 1 -c 1 --add-data 'Heart sign - ' --unicode 2665 --table
╒════════════════╤══╕
│ Heart sign - ♥ │ │
├────────────────┼──┤
│ │ │
├────────────────┼──┤
│ │ │
╘════════════════╧══╛
You still can use --append to add other data after it to it.
Let's say you have two or more files to work with merging them manually is hard,
so, the argument --merge can be used to merge multiple documents.
There are two ways you can merge files, vertically or horizontally.
Vertically
Usage:
python3 PYSQL.py --file <file1> --merge <file2> <file3> ... --vertical-merge
In action:
python3 PYSQL.py --file sample1.txt --table
╒════╤════╕
│ f1 │ f1 │
╘════╧════╛
python3 PYSQL.py --file sample2.txt --table
╒════╤════╕
│ f2 │ f2 │
╘════╧════╛
python3 PYSQL.py --file sample3.txt --table
╒════╤════╕
│ f3 │ f3 │
╘════╧════╛
python3 PYSQL.py --file sample4.txt --table
╒════╤════╕
│ f4 │ f4 │
╘════╧════╛
python3 PYSQL.py --file sample1.txt --merge sample2.txt sample3.txt sample4.txt --table
Selected from shared topics, language and repository description—not editorial ratings.
httpie /
An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie
donnemartin /
A supercharged Git/GitHub command line interface (CLI). An official integration for GitHub and GitHub Enterprise: https://github.com/works-with/category/desktop-tools
lavie /
Given an existing docker container, prints the command line necessary to run a copy of it.
Prayag2 /
A command line program written in Python to let you backup your dotfiles and switch to other ones in an instant. Works out-of-the box on KDE Plasma!
t3l3machus /
An XSS exploitation command-line interface and payload generator.
ZupIT /
Horusec is an open source tool that improves identification of vulnerabilities in your project with just one command.