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 "
-
WHERE: Filter and display the DataFrame.
csvbro WHERE "
- 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:
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for csvbro 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| csvbro-0.0.5.tar.gz | 13.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| csvbro-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.7 kB
Release files / csvbro-0.0.5.tar.gz
| Download URL | csvbro-0.0.5.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31ee3298972c0580d72534aa52c335d309e231eee385d39fb0bf39b3c152d7ec
|
|
BLAKE2b-256 checksum How to use checksums |
cffc60f9ccfa43bb340f750b766062f8ad02e9b5c4f7369826f68ac51923ebda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / csvbro-0.0.5-py3-none-any.whl
| Download URL | csvbro-0.0.5-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
94e612baea02a841f7aacb19eccf48b2b07047982ad4123b7e34db2d88b446c3
|
|
BLAKE2b-256 checksum How to use checksums |
c7ea6c07e590022e85c2350f1b0db6d05bbc13ab82453ef9be22fc134ce7108b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|