Package: csvcli
___           
                                         /\_ \    __    
      ___    ____  __  __             ___\//\ \  /\_\   
     /'___\ /',__\/\ \/\ \  _______  /'___\\ \ \ \/\ \  
    /\ \__//\__, `\ \ \_/ |/\______\/\ \__/ \_\ \_\ \ \ 
    \ \____\/\____/\ \___/ \/______/\ \____\/\____\\ \_\
     \/____/\/___/  \/__/            \/____/\/____/ \/_/DescriptionA light-weight command-line tool to browse and query CSV, Excel and Apache Parquet files, regardless of their size.
You can use it to:Explore your data:Navigate through the full contents of your tabular data fast and with a human-friendly format directly on the shellQuickly see which columns, data-types are in the file and how many null values or unique values are per columncsvcli can handle and manipulate extremely large tabular data. There are no long loading times, regardless of the size of your file.Filter and query:Select subsets of the tabular dataSort by a given columnNeed more? Ok then just run SQL queries on it!In all cases you can save the output to a new fileChange the format:You can convert from and to CSV, Excel and Apache Parquet in any combinationYou can also change the delimiter of your CSV fileWhy?Browsing and filtering large CSV files and Excel files in programs like Microsoft Excel or Pages can be slow and there are limitations to the amount of rows displayed.
Apache Parquet files cannot even be opened by these programs.
Additionally, working with the command-line can help you streamline your work and avoid distractions.
csvcli allows you to get insights from your data and run queries on them regardless of its size and format, directly from the command line.Python versionBuilt on and tested on python 3.7InstallationUsing Pip$pipinstallcsvcliManual$gitclonehttps://github.com/IgnacioMB/csvcli.git$cdcsvcli$pythonsetup.pyinstallGlobal parametersUsage: csvcli [OPTIONS] FILEPATH COMMAND [ARGS]...ArgumentsFILEPATHTEXT   Path to the file i.e. myfiles/data.csv. You might need to wrap it in "" if your filename contains parentheses and such.Options:-d, --delimiterTEXT  (optional) Only for CSV files. If you want to override the automatic guess. Must be a 1-character string.--helpShow this message and exit.Available commands___                          
                    /\_ \                         
   __   __  _  _____\//\ \     ___   _ __    __   
 /'__`\/\ \/'\/\ '__`\\ \ \   / __`\/\`'__\/'__`\ 
/\  __/\/>  </\ \ \L\ \\_\ \_/\ \L\ \ \ \//\  __/ 
\ \____\/\_/\_\\ \ ,__//\____\ \____/\ \_\\ \____\
 \/____/\//\/_/ \ \ \/ \/____/\/___/  \/_/ \/____/
                 \ \_\                            
                  \/_/                            


               __  __    ___   __  __  _ __  
              /\ \/\ \  / __`\/\ \/\ \/\`'__\
              \ \ \_\ \/\ \L\ \ \ \_\ \ \ \/ 
               \/`____ \ \____/\ \____/\ \_\ 
                `/___/> \/___/  \/___/  \/_/ 
                   /\___/                    
                   \/__/    


                          __            __               
                         /\ \          /\ \__            
                         \_\ \     __  \ \ ,_\    __     
                         /'_` \  /'__`\ \ \ \/  /'__`\   
                        /\ \L\ \/\ \L\.\_\ \ \_/\ \L\.\_ 
                        \ \___,_\ \__/.\_\\ \__\ \__/.\_\
                         \/__,_ /\/__/\/_/ \/__/\/__/\/_/These commands allow you to quickly get a sense of what the contents of the file look like.show: Displays the full contents of the CSV, Excel or Apache Parquet file.Navigation:Use the arrow keys to scroll through the rows or columnsPress 'z' to go to the end of the filePress 'a' to go the beginning of the filePress 'q' to quitExample showing the contents of a CSV file.csvcli myfiles/data.csv showWhile working with CSV files, csvcli will try to guess the delimiter of your CSV files for you.
If you are not happy with the guess, you can always specify the delimiter using the-doption:csvcli -d '|' myfiles/csv_with_pipes.csv showhead: Displays only the first rows of the fileIf you do not indicate any number, it returns the first 5 rows of the file:csvcli myfiles/data.csv headYou can also specify a custom number of rows to show:csvcli myfiles/data.csv head 100columns: Displays the column names and data typescsvcli myfiles/data.csv columnsdescribe: Displays a table with summary statistics of the numerical columnscsvcli myfiles/data.csv describenull-counts: Displays the counts of null values per columncsvcli myfiles/data.csv null-countsvalue-counts: Displays the unique values in a column with their respective counts.
You must indicate a column using the-coptionOptions:-c, --columnTEXT  Name of column to count the unique values forExamplecsvcli myfiles/data.csv value-counts -c "Region"___      ___    __                   
 /'___\ __ /\_ \  /\ \__                
/\ \__//\_\\//\ \ \ \ ,_\    __   _ __  
\ \ ,__\/\ \ \ \ \ \ \ \/  /'__`\/\`'__\
 \ \ \_/\ \ \ \_\ \_\ \ \_/\  __/\ \ \/ 
  \ \_\  \ \_\/\____\\ \__\ \____\\ \_\ 
   \/_/   \/_/\/____/ \/__/\/____/ \/_/ 


                          ____      
                        /|  _ \     
                        |/\   |     
                         \// __`\/\ 
                         /|  \L>  <_
                         | \_____/\/
                          \/____/\/ 


                         __   __  __     __   _ __   __  __    
                       /'__`\/\ \/\ \  /'__`\/\`'__\/\ \/\ \   
                      /\ \L\ \ \ \_\ \/\  __/\ \ \/ \ \ \_\ \  
                      \ \___, \ \____/\ \____\\ \_\  \/`____ \ 
                       \/___/\ \/___/  \/____/ \/_/   `/___/> \
                            \ \_\                        /\___/
                             \/_/                        \/__/select: Allows you to display only a subset of columns.
Also supports sorting by a given column.Arguments:ASCTEXT  For ascending sortingDESCTEXT  For descending sortingOptions:-c, --columnsTEXT         Names of selected columns to show separated by commas-s, --sort-byTEXT         Name of column to sort by-save, --save-toTEXT      Path to the destination file i.e.
'myfiles/data.csv'. The file extension determines
output formatExample selecting columns from a CSV file:csvcli myfiles/data.csv select -c "url, clicks, impressions"Example selecting columns and sorting by one using the-soption.
You can addASCfor ascending order orDESCfor descending order.
The default is ascending:csvcli myfiles/data.csv select -c "url, clicks, impressions" -s "clicks" DESCExample saving a selection result into an output file using the option-save:csvcli myfiles/data.csv select -c "region, count" -save subset.csvquery: If you need more advanced filters and functions, the query command allows you to query the CSV, Excel or Apache Parquet file using SQL queries as you would any regular SQL table.
You specify the query using the-qoption and use the keywordfileto refer to your file as a source table. UsesSQLitesyntax.Options:-q, --queryTEXT  SQL query you want to run against the file i.e.SELECT * FROM file;-save, --save-toTEXT      Path to the destination file i.e.
'myfiles/data.csv'. The file extension determines
output formatExample running a query on a CSV file:csvcli myfiles/data.csv query -q "SELECT Region,SUM(Units) FROM file GROUP BY Region;"Example saving a query result into an output file using the option-save:csvcli myfiles/data.csv query -q "SELECT Region,Units FROM file;" -save "query.csv"__                                         
     /\ \                                        
  ___\ \ \___      __      ___      __      __   
 /'___\ \  _ `\  /'__`\  /' _ `\  /'_ `\  /'__`\ 
/\ \__/\ \ \ \ \/\ \L\.\_/\ \/\ \/\ \L\ \/\  __/ 
\ \____\\ \_\ \_\ \__/.\_\ \_\ \_\ \____ \ \____\
 \/____/ \/_/\/_/\/__/\/_/\/_/\/_/\/___L\ \/____/
                                    /\____/      
                                    \_/__/       


                   __    __                
                  /\ \__/\ \               
                  \ \ ,_\ \ \___      __   
                   \ \ \/\ \  _ `\  /'__`\ 
                    \ \ \_\ \ \ \ \/\  __/ 
                     \ \__\\ \_\ \_\ \____\
                      \/__/ \/_/\/_/\/____/


               ___                                   __      
             /'___\                                 /\ \__   
            /\ \__/  ___   _ __    ___ ___      __  \ \ ,_\  
            \ \ ,__\/ __`\/\`'__\/' __` __`\  /'__`\ \ \ \/  
             \ \ \_/\ \L\ \ \ \/ /\ \/\ \/\ \/\ \L\.\_\ \ \_ 
              \ \_\\ \____/\ \_\ \ \_\ \_\ \_\ \__/.\_\\ \__\
               \/_/ \/___/  \/_/  \/_/\/_/\/_/\/__/\/_/ \/__/convert: Allows you to convert from and to CSV, Excel and Apache Parquet in any combination.
Your original file will be overwritten.Options:-to, --formatTEXT    Output format. Options:'csv', 'excel' or 'parquet'-D, --delimiterTEXT  (optional) Only for CSV files. Delimiter if other than
comma i.e. ';'. Must be a 1-character string.Example converting a parquet file to CSV:csvcli myfiles/data.parquet convert -to csvExample converting an Excel file to CSV with|as delimiter. using the-Doption:csvcli myfiles/data.xlsx convert -to "csv" -D "|"change-delimiter: Changes the delimiter of a CSV file.
Your original file will be overwritten.Options:-to, --new-delimiterTEXT  Output CSV delimiter i.e. ';'. Must be a
1-character string.Example changing the delimiter of a CSV file from ';' to '|':csvcli -d ";" data.csv change-delimiter -to "|"Note about the authorIgnacio Marin is a Data Analyst based in Munich, Germany.More info onhttps://www.linkedin.com/in/ignaciomarinb/