A tool for browsing and manipulating CSV files
Project description
CSVBro
CSVBro is a command-line tool for viewing and analyzing CSV files using pandas DataFrames. It provides functionality to display specific columns, create pivot tables, output data in JSON format, sort, limit, and filter results.
- Author: Ryan Gerard Wilson
- Website: ryangerardwilson.com
1. Installation
To install csvbro, use pip:
pip install csvbro
This installs datasling and its dependencies.
2. Get Latest Version
To upgrade to the latest version of csvbro:
pip install --upgrade csvbro
3. Usage
Run the tool from the command line using:
csvbro <filename> [<command> [args]]
If no command is provided, the entire CSV is displayed as a DataFrame (with pandas' default truncation) unless ORDER_BY, LIMIT, or WHERE is specified.
The following commands are available:
-
SHOW: Display specified columns of the CSV.
csvbro SHOW [ ...] [ORDER_BY <sort_column> [ASC|DESC]] [LIMIT ] [WHERE ""]
-
PIVOT: Create a pivot table with specified row, value, and aggregation function.
csvbro PIVOT [] [ORDER_BY <sort_column> [ASC|DESC]] [LIMIT ] [WHERE ""]
- Aggregation functions:
SUM,COUNT,COUNT_UNIQUE,MEAN,MEDIAN - Note:
SUM,MEAN, andMEDIANrequire numeric values.
- Aggregation functions:
-
PIVOT with DECILES: Create a decile analysis of a column with 10 equal-width bins (D1 to D10).
csvbro PIVOT DECILES([,IGNORE_OUTLIERS]) [<pivot_column>] [ORDER_BY <sort_column> [ASC|DESC]] [LIMIT ] [WHERE ""]
-
PIVOT with PERCENTILES: Create a percentile analysis of a column with 10 equal-count bins (P0, P10, ..., P90).
csvbro PIVOT PERCENTILES([,IGNORE_OUTLIERS]) [<pivot_column>] [ORDER_BY <sort_column> [ASC|DESC]] [LIMIT ] [WHERE ""]
-
JSON: Output the DataFrame in JSON format.
csvbro JSON [ORDER_BY <sort_column> [ASC|DESC]] [LIMIT ] [WHERE ""]
-
ORDER_BY: Sort the entire DataFrame by a column.
csvbro ORDER_BY <sort_column> <ASC|DESC> [LIMIT ] [WHERE ""]
-
LIMIT: Limit the DataFrame to a specified number of rows.
csvbro [WHERE ""] LIMIT
-
WHERE: Filter and display the DataFrame.
csvbro WHERE "" [ORDER_BY <sort_column> [ASC|DESC]] [LIMIT ]
- Condition syntax:
column <operator> value [AND|OR condition](e.g.,"column1 > 0.3","Col1 > 0.3 AND (Col2 > 0.5 OR Col9 > 1.2)") - Operators:
=,>,<,>=,<=,!=,LIKE(for string containment) - Note: Numeric comparisons use float parsing;
LIKErequires string columns and matches substrings (case-insensitive). Conditions must be enclosed in double quotes in the shell command.
- Condition syntax:
-
License
This project is licensed under the MIT License. See the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file csvbro-0.0.5.tar.gz.
File metadata
- Download URL: csvbro-0.0.5.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31ee3298972c0580d72534aa52c335d309e231eee385d39fb0bf39b3c152d7ec
|
|
| MD5 |
b1e82480ee34a353c13afe3fd7b49edc
|
|
| BLAKE2b-256 |
cffc60f9ccfa43bb340f750b766062f8ad02e9b5c4f7369826f68ac51923ebda
|
File details
Details for the file csvbro-0.0.5-py3-none-any.whl.
File metadata
- Download URL: csvbro-0.0.5-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94e612baea02a841f7aacb19eccf48b2b07047982ad4123b7e34db2d88b446c3
|
|
| MD5 |
28f4f2b51ec668edafd58d17ac9ce564
|
|
| BLAKE2b-256 |
c7ea6c07e590022e85c2350f1b0db6d05bbc13ab82453ef9be22fc134ce7108b
|