{"id":13393564,"url":"https://github.com/mithrandie/csvq","last_synced_at":"2025-05-14T04:07:32.997Z","repository":{"id":37509181,"uuid":"91995431","full_name":"mithrandie/csvq","owner":"mithrandie","description":"SQL-like query language for csv","archived":false,"fork":false,"pushed_at":"2024-07-25T10:25:08.000Z","size":6905,"stargazers_count":1564,"open_issues_count":23,"forks_count":68,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-05-11T13:15:27.822Z","etag":null,"topics":["command-line-tool","csv","golang","sql"],"latest_commit_sha":null,"homepage":"https://mithrandie.github.io/csvq","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mithrandie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-22T00:04:51.000Z","updated_at":"2025-05-08T15:49:29.000Z","dependencies_parsed_at":"2024-06-18T12:30:37.202Z","dependency_job_id":"bbdd5fc2-6b13-439f-8488-dcfb5a2254f6","html_url":"https://github.com/mithrandie/csvq","commit_stats":{"total_commits":994,"total_committers":10,"mean_commits":99.4,"dds":"0.017102615694164935","last_synced_commit":"a76c52e1ee576566abfd93a39b04eb33ad163410"},"previous_names":[],"tags_count":186,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithrandie%2Fcsvq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithrandie%2Fcsvq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithrandie%2Fcsvq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithrandie%2Fcsvq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mithrandie","download_url":"https://codeload.github.com/mithrandie/csvq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069216,"owners_count":22009511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","csv","golang","sql"],"created_at":"2024-07-30T17:00:56.053Z","updated_at":"2025-05-14T04:07:32.947Z","avatar_url":"https://github.com/mithrandie.png","language":"Go","readme":"# csvq\n\nSQL-like query language for csv\n\n[![Test](https://github.com/mithrandie/csvq/actions/workflows/test.yml/badge.svg)](https://github.com/mithrandie/csvq/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/mithrandie/csvq/branch/master/graph/badge.svg)](https://codecov.io/gh/mithrandie/csvq)\n[![License: MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg)](https://opensource.org/licenses/MIT)\n\nCsvq is a command line tool to operate CSV files. \nYou can read, update, delete CSV records with SQL-like query.\n\nYou can also execute multiple operations sequentially in managed transactions by passing a procedure or using the interactive shell.\nIn the multiple operations, you can use variables, cursors, temporary tables, and other features. \n\n## Latest Release\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/mithrandie/csvq?color=%2320b2aa\u0026label=GitHub%20Release\u0026sort=semver)](https://github.com/mithrandie/csvq/releases/latest)\n[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/qittu/csvq-deb?color=%2320b2aa\u0026label=Launchpad%20PPA)](https://launchpad.net/~mithrandie/+archive/ubuntu/csvq)\n\n## Intended Use\nCsvq is intended for one-time queries and routine processing described in source files on the amount of data that can be handled by spreadsheet applications.\n\nIt is not suitable for handling very large data since all data is kept on memory when queries are executed.\nThere is no indexing, calculation order optimization, etc., and the execution speed is not fast due to the inclusion of mechanisms for updating data and handling various other features.\n\nHowever, it can be run with a single executable binary, and you don't have to worry about troublesome dependencies during installation.\nYou can not only write and run your own queries, but also share source files with co-workers on multiple platforms.\n\nThis tool may be useful for those who want to handle data easily and roughly, without having to think about troublesome matters.\n\n## Features\n\n* CSV File Operation\n  * Select Query\n  * Insert Query\n  * Update Query\n  * Replace Query\n  * Delete Query\n  * Create Table Query\n  * Alter Table Query\n* Cursor\n* Temporary Table\n* Transaction Management\n* Support loading data from Standard Input\n* Support following file formats\n  * [CSV](https://datatracker.ietf.org/doc/html/rfc4180)\n  * TSV\n  * [LTSV](http://ltsv.org)\n  * Fixed-Length Format\n  * [JSON](https://datatracker.ietf.org/doc/html/rfc8259)\n  * [JSON Lines](https://jsonlines.org)\n* Support following file encodings\n  * UTF-8\n  * UTF-16\n  * Shift_JIS\n\n  \u003e JSON and JSON Lines formats support only UTF-8.\n\n## Reference Manual\n\n[Reference Manual - csvq](https://mithrandie.github.io/csvq/reference)\n\n## Installation\n\n### Install executable binary\n\n1. Download an archive file from [release page](https://github.com/mithrandie/csvq/releases).\n2. Extract the downloaded archive and add a binary file in it to your path.\n\n### Build from source\n\n#### Requirements\n\nGo 1.18 or later (cf. [Getting Started - The Go Programming Language](https://golang.org/doc/install))\n\n#### Build command\n\n```$ go install github.com/mithrandie/csvq```\n\n### Install using package manager\n\nInstalling using a package manager does not ensure that you always get the latest version, but it may make installation and updating easier.\n\n#### Ubuntu\n\n1. ```$ sudo add-apt-repository ppa:mithrandie/csvq```\n2. ```$ sudo apt update```\n3. ```$ sudo apt install csvq```\n\n#### Arch Linux (unofficial)\n\nInstall the [csvq-git](https://aur.archlinux.org/packages/csvq-git) or [csvq-bin](https://aur.archlinux.org/packages/csvq-bin) from the [Arch User Repository](https://wiki.archlinux.org/title/Arch_User_Repository) (e.g. `yay -S csvq-git`)\n\n#### macOS (unofficial)\n\n1. Install homebrew (cf. [The missing package manager for macOS (or Linux) — Homebrew](https://brew.sh))\n2. ```$ brew install csvq```\n\n## Usage\n\n```shell\n# Simple query\ncsvq 'select id, name from `user.csv`'\ncsvq 'select id, name from user'\n\n# Specify data delimiter as tab character\ncsvq -d '\\t' 'select count(*) from `user.csv`'\n\n# Load no-header-csv\ncsvq --no-header 'select c1, c2 from user'\n\n# Load from redirection or pipe\ncsvq 'select * from stdin' \u003c user.csv\ncat user.csv | csvq 'select *'\n\n# Load from Fixed-Length Format\ncat /var/log/syslog | csvq -n -i fixed -m '[15, 24, 124]' 'select *'\n\n# Split lines with spaces automatically\nps | csvq -i fixed -m spaces 'select * from stdin'\n\n# Output in JSON format\ncsvq -f json 'select integer(id) as id, name from user'\n\n# Output to a file\ncsvq -o new_user.csv 'select id, name from user'\n\n# Load statements from file\n$ cat statements.sql\nVAR @id := 0;\nSELECT @id := @id + 1 AS id,\n       name\n  FROM user;\n\n$ csvq -s statements.sql\n\n# Execute statements in the interactive shell\n$ csvq\ncsvq \u003e UPDATE users SET name = 'Mildred' WHERE id = 2;\n1 record updated on \"/home/mithrandie/docs/csv/users.csv\".\ncsvq \u003e COMMIT;\nCommit: file \"/home/mithrandie/docs/csv/users.csv\" is updated.\ncsvq \u003e EXIT;\n\n# Show help\ncsvq -h\n```\n\nMore details \u003e\u003e [https://mithrandie.github.io/csvq](https://mithrandie.github.io/csvq)\n\n## Execute csvq statements in Go\n\n[csvq-driver](https://github.com/mithrandie/csvq-driver)\n\n## Example of cooperation with other applications\n\n- [csvq emacs extension](https://github.com/mithrandie/csvq-emacs-extension)\n","funding_links":[],"categories":["HarmonyOS","Go","SQL","\u003ca name=\"data-management-tabular\"\u003e\u003c/a\u003eData management - Tabular data","CSV","Other"],"sub_categories":["Windows Manager","Über SQL","Open USP Tsukubai"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmithrandie%2Fcsvq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmithrandie%2Fcsvq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmithrandie%2Fcsvq/lists"}