Skip to content

Commit

Permalink
feat: change name sscsv to quiltercsv
Browse files Browse the repository at this point in the history
  • Loading branch information
sumeshi committed Nov 4, 2024
1 parent d3695ba commit b98a030
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 71 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish-binary-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
pip install uv
- name: Build and publish
run: |
poetry config pypi-token.pypi ${{secrets.PYPI_TOKEN}}
poetry publish --build
uv build
uv publish --token ${{secrets.PYPI_TOKEN}}
19 changes: 8 additions & 11 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,16 @@ jobs:

- name: Install dependencies
run: |
pip install poetry
poetry config virtualenvs.in-project true
poetry install
pip install uv
- name: build
run: |
pip install nuitka
poetry run python -m nuitka --standalone --onefile --follow-imports -o sscsv.exe --output-dir=dist --assume-yes-for-downloads src/sscsv/run.py
uv run python -m nuitka --standalone --onefile --follow-imports -o qsv.exe --output-dir=dist --assume-yes-for-downloads src/qsv/__init__.py
- name: verify
run: |
dist/sscsv.exe -h
dist/qsv.exe -h
- name: create tag
id: create_tag
Expand All @@ -53,7 +51,7 @@ jobs:
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.create_tag.outputs.version }}
files: dist/sscsv.exe
files: dist/qsv.exe
name: Release ${{ steps.create_tag.outputs.version }}
body: 'This release was automatically created by GitHub Actions.'
env:
Expand All @@ -77,22 +75,21 @@ jobs:
- name: Install dependencies
run: |
sudo apt install patchelf
pip install poetry
poetry install
pip install uv
- name: build
run: |
pip install nuitka
poetry run python -m nuitka --standalone --onefile --follow-imports -o sscsv --output-dir=dist --assume-yes-for-downloads src/sscsv/run.py
uv run python -m nuitka --standalone --onefile --follow-imports -o qsv --output-dir=dist --assume-yes-for-downloads src/qsv/__init__.py
- name: verify
run: |
dist/sscsv -h
dist/qsv -h
- name: upload asset to release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.build-windows.outputs.version }}
files: dist/sscsv
files: dist/qsv
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63 changes: 27 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# snip-snap-csv
# Quilter-CSV
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
[![PyPI version](https://badge.fury.io/py/sscsv.svg)](https://badge.fury.io/py/sscsv)
[![Python Versions](https://img.shields.io/pypi/pyversions/sscsv.svg)](https://pypi.org/project/sscsv/)
[![PyPI version](https://badge.fury.io/py/qsv.svg)](https://badge.fury.io/py/qsv)
[![Python Versions](https://img.shields.io/pypi/pyversions/qsv.svg)](https://pypi.org/project/qsv/)

A tool provides elastic and rapid filtering for efficient analysis of huge CSV files like eventlogs.

Expand All @@ -13,10 +13,10 @@ A tool provides elastic and rapid filtering for efficient analysis of huge CSV f
This tool processes csv(comma-separated values) file by connecting three processes: initializer, chainable functions, and finalizer.
For example, you can load a csv file in the initializer, use a chainable functions to filter, sort, and select columns, and then output the resulting csv file in the finalizer.

![](https://gist.githubusercontent.com/sumeshi/644af27c8960a9b6be6c7470fe4dca59/raw/5c989633b486f26705e6cb9d7a20e3af104d1896/sscsv2.svg)
![](https://gist.githubusercontent.com/sumeshi/644af27c8960a9b6be6c7470fe4dca59/raw/5c989633b486f26705e6cb9d7a20e3af104d1896/qsv2.svg)

```bash
$ sscsv {{INITIALIZER}} {{Arguments}} - {{CHAINABLE}} {{Arguments}} - {{FINALIZER}} {{Arguments}}
$ qsv {{INITIALIZER}} {{Arguments}} - {{CHAINABLE}} {{Arguments}} - {{FINALIZER}} {{Arguments}}
```
Each process must be explicitly separated by a “-”.

Expand All @@ -26,11 +26,7 @@ e.g.
Below is an example of reading a CSV file, extracting rows that contain 4624 in the EventID column, and displaying the top 3 rows them sorted by the Timestamp column.

```bash
$ sscsv load Security.csv - isin 'Event ID' 4624 - sort 'Date and Time' - head 3
2024-06-26T17:29:19+0000 [DEBUG] 1 files are loaded. Security.csv
2024-06-26T17:29:19+0000 [DEBUG] filter condition: 4624 in Event ID
2024-06-26T17:29:19+0000 [DEBUG] sort by Date and Time (asc).
2024-06-26T17:29:19+0000 [DEBUG] heading 3 lines.
$ qsv load Security.csv - isin 'Event ID' 4624 - sort 'Date and Time' - head 3
shape: (3, 5)
┌─────────────┬───────────────────────┬─────────────────────────────────┬──────────┬───────────────┐
│ Level ┆ Date and Time ┆ Source ┆ Event ID ┆ Task Category │
Expand All @@ -54,11 +50,11 @@ Arguments:

examples
```
$ sscsv load ./Security.csv
$ qsv load ./Security.csv
```

```
$ sscsv load ./logs/*.csv
$ qsv load ./logs/*.csv
```

### Chainable Functions
Expand All @@ -72,15 +68,15 @@ Arguments:

examples
```
$ sscsv load ./Security.csv - select 'Event ID'
$ qsv load ./Security.csv - select 'Event ID'
```

```
$ sscsv load ./Security.csv - select "Date and Time-Event ID"
$ qsv load ./Security.csv - select "Date and Time-Event ID"
```

```
$ sscsv load ./Security.csv - select "'Date and Time,Event ID'"
$ qsv load ./Security.csv - select "'Date and Time,Event ID'"
```

#### isin
Expand All @@ -94,7 +90,7 @@ Arguments:

examples
```
$ sscsv load ./Security.csv - isin 'Event ID' 4624,4634
$ qsv load ./Security.csv - isin 'Event ID' 4624,4634
```

#### contains
Expand All @@ -108,7 +104,7 @@ Arguments:

examples
```
$ sscsv load ./Security.csv - contains 'Date and Time' '10/6/2016'
$ qsv load ./Security.csv - contains 'Date and Time' '10/6/2016'
```

#### head
Expand All @@ -122,7 +118,7 @@ Options:
examples

```
$ sscsv load ./Security.csv - head 10
$ qsv load ./Security.csv - head 10
```

#### tail
Expand All @@ -136,7 +132,7 @@ Options:
examples

```
$ sscsv load ./Security.csv - tail 10
$ qsv load ./Security.csv - tail 10
```

#### sort
Expand All @@ -153,7 +149,7 @@ Options:
examples

```
$ sscsv load ./Security.csv - sort 'Date and Time'
$ qsv load ./Security.csv - sort 'Date and Time'
```

#### changetz
Expand All @@ -172,7 +168,7 @@ Options:
examples

```
$ sscsv load ./Security.csv - changetz 'Date and Time' --timezone_from=UTC --timezone_to=Asia/Tokyo --new_colname='Date and Time(JST)'
$ qsv load ./Security.csv - changetz 'Date and Time' --timezone_from=UTC --timezone_to=Asia/Tokyo --new_colname='Date and Time(JST)'
```

### Finalizer
Expand All @@ -187,8 +183,7 @@ Options:
examples

```
$ sscsv load ./Security.csv - headers
2024-06-30T13:17:53+0000 [DEBUG] 1 files are loaded. Security.csv
$ qsv load ./Security.csv - headers
┏━━━━┳━━━━━━━━━━━━━━━┓
┃ # ┃ Column Name ┃
┡━━━━╇━━━━━━━━━━━━━━━┩
Expand All @@ -206,8 +201,7 @@ Displays the statistical information of the data.
examples

```
$ sscsv load ./Security.csv - stats
2024-06-30T13:25:53+0000 [DEBUG] 1 files are loaded. Security.csv
$ qsv load ./Security.csv - stats
shape: (9, 6)
┌────────────┬─────────────┬───────────────────────┬─────────────────────────────────┬─────────────┬─────────────────────────┐
│ statistic ┆ Level ┆ Date and Time ┆ Source ┆ Event ID ┆ Task Category │
Expand All @@ -231,8 +225,7 @@ Displays the data processing query.

examples
```
sscsv load Security.csv - showquery
2024-06-30T13:26:54+0000 [DEBUG] 1 files are loaded. Security.csv
qsv load Security.csv - showquery
naive plan: (run LazyFrame.explain(optimized=True) to see the optimized plan)
Csv SCAN Security.csv
Expand All @@ -244,9 +237,7 @@ Outputs the processing results to the standard output.

examples
```
$ sscsv load Security.csv - show
2024-06-30T13:27:34+0000 [DEBUG] 1 files are loaded. Security.csv
2024-06-30T13:27:34+0000 [DEBUG] heading 5 lines.
$ qsv load Security.csv - show
Level,Date and Time,Source,Event ID,Task Category
Information,10/7/2016 06:38:24 PM,Microsoft-Windows-Security-Auditing,4658,File System
Information,10/7/2016 06:38:24 PM,Microsoft-Windows-Security-Auditing,4656,File System
Expand All @@ -265,7 +256,7 @@ Options:

examples
```
$ sscsv load Security.csv - dump ./Security-sscsv.csv
$ qsv load Security.csv - dump ./Security-qsv.csv
```

## Planned Features:
Expand All @@ -279,22 +270,22 @@ $ sscsv load Security.csv - dump ./Security-sscsv.csv
## Installation
### from PyPI
```
$ pip install sscsv
$ pip install qsv
```

### from GitHub Releases
The version compiled into a binary using Nuitka is also available for use.

#### Ubuntu
```
$ chmod +x ./sscsv
$ ./sscsv {{options...}}
$ chmod +x ./qsv
$ ./qsv {{options...}}
```

#### Windows
```
> sscsv.exe {{options...}}
> qsv.exe {{options...}}
```

## License
snip-snap-csv is released under the [MIT](https://github.com/sumeshi/snip-snap-csv/blob/master/LICENSE) License.
snip-snap-csv is released under the [MIT](https://github.com/sumeshi/quilter-csv/blob/master/LICENSE) License.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "sscsv"
version = "0.1.1"
name = "qsv"
version = "0.2.0"
description = "A tool designed for rapid CSV file processing and filtering, specifically designed for log analysis."
readme = "README.md"
authors = [
Expand All @@ -23,4 +23,4 @@ dev = [
]

[project.scripts]
sscsv = "sscsv:main"
qsv = "qsv:main"
2 changes: 1 addition & 1 deletion src/sscsv/__init__.py → src/qsv/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
import fire
from sscsv.controllers.DataFrameController import DataFrameController
from qsv.controllers.DataFrameController import DataFrameController

logging.basicConfig(
level=logging.DEBUG,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from datetime import datetime
from typing import Union

from sscsv.controllers.CsvController import CsvController
from sscsv.views.TableView import TableView
from qsv.controllers.CsvController import CsvController
from qsv.views.TableView import TableView

import polars as pl

Expand Down
File renamed without changes.
File renamed without changes.
30 changes: 15 additions & 15 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b98a030

Please sign in to comment.