{"id":18619983,"url":"https://github.com/qunv/eql","last_synced_at":"2025-07-16T23:34:23.644Z","repository":{"id":161512820,"uuid":"633391810","full_name":"qunv/eql","owner":"qunv","description":"Sheet functions in Go inspired by Google sheet functions","archived":false,"fork":false,"pushed_at":"2023-07-18T05:01:34.000Z","size":203,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-28T22:42:02.475Z","etag":null,"topics":["functions","libs","sheet"],"latest_commit_sha":null,"homepage":"","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/qunv.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2023-04-27T11:56:29.000Z","updated_at":"2023-05-29T12:34:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"3fc1e0fd-b144-4cf9-8c5c-1e5e579a6705","html_url":"https://github.com/qunv/eql","commit_stats":{"total_commits":39,"total_committers":4,"mean_commits":9.75,"dds":0.3846153846153846,"last_synced_commit":"58ee2e94f145fbca2dbeb226a769fec2df978fa1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qunv/eql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qunv%2Feql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qunv%2Feql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qunv%2Feql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qunv%2Feql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qunv","download_url":"https://codeload.github.com/qunv/eql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qunv%2Feql/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265550378,"owners_count":23786556,"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":["functions","libs","sheet"],"created_at":"2024-11-07T04:04:24.044Z","updated_at":"2025-07-16T23:34:23.623Z","avatar_url":"https://github.com/qunv.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eql\n\n[![From Vietnam with \u003c3](https://raw.githubusercontent.com/webuild-community/badge/master/svg/love.svg)](https://webuild.community)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/qunv/eql)\n![Build Status](https://github.com/qunv/eql/actions/workflows/test.yml/badge.svg?branch=main)\n\nSheet functions in [Go](http://www.golang.org) inspired by [Google sheet functions]()\n\n[eql](https://github.com/qunv/eql) is designed to execute functions in sheet file in Go application.\n\n# Install\n\n```shell\ngo get github.com/qunv/eql\n```\n\n# Usage\n\n```go\nimport (\n\t\"github.com/qunv/eql\"\n)\n\n\nfunc initData() [][]string {\n    // open file\n    f, err := os.Open(\"test.csv\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    \n    defer f.Close()\n    records, _ := csv.NewReader(f).ReadAll()\n    return records\n}\n\nfunc main() {\n\tinput := initData()\n\tparser := eql.NewEqlParser(input)\n\teql := \"SUM(A1:B2; 1; AVG(A1:B2; C2); ADD(D3; 4))\"\n\tresult, err := parser.Exec(eql)\n\tif err != nil {\n\t\t// handle err\n    }\n\t//hande result\n}\n```\n\n# Functions\n\nList of functions are supported currently, happy to contribute.\n\n\u003cdetails\u003e\u003csummary\u003eMath\u003c/summary\u003e\n\n\u003cblockquote\u003e\n\n[*        SUM           *]: \u003c\u003e ()\n\u003cdetails\u003e\u003csummary\u003e SUM \u003c/summary\u003e\u003cblockquote\u003e\n\nReturns the sum of a series of numbers and/or cells\n\n#### Sample usage\n\n```shell\nSUM(A2:A100)\n\nSUM(1,2,3,4,5)\n\nSUM(1,2,A2:A50)\n\nSUM(1,SUM(A1:A3, 1), 2+A3)\n```\n\n#### Syntax\n\n```shell\nSUM(value1, [value2, ...])\n```\n\n- `value1` - The first number or range to add together.\n\n- `value2`, ... - [ OPTIONAL ] - Additional numbers or ranges to add to value1.\n\n#### Example\n\ndata\n\n| A   | B   | C   |\n|-----|-----|-----|\n| 1   | 3   | 5   |\n| 2   | 4   | 6   |\n\n\n| Formula                | result |\n|------------------------|--------|\n| SUM(4, 2)              | 6      |\n| SUM(A1, B1)            | 4      |\n| SUM(A1:B2)             | 10     |\n| SUM(A1:B2, SUM(3, C1)) | 18     |\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n[*        ABS           *]: \u003c\u003e ()\n\n\u003cdetails\u003e\u003csummary\u003e ABS \u003c/summary\u003e\u003cblockquote\u003e\n\nReturns the absolute value of a number.\n\n#### Sample usage\n\n```shell\nABS(-2)\n\nABS(A2)\n```\n\n#### Syntax\n\n```shell\nABS(value)\n```\n\n- `value` - The number of which to return the absolute value.\n\n#### Example\n\n| Formula | result   |\n|---------|----------|\n| ABS(-1) | 1        |\n| ABS(A1) | 1        |\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eOperator\u003c/summary\u003e\n\u003cblockquote\u003e\n\n[*        ADD           *]: \u003c\u003e ()\n\u003cdetails\u003e\u003csummary\u003e ADD \u003c/summary\u003e\u003cblockquote\u003e\n\nReturns the sum of two numbers. Equivalent to the `+` operator.\n\n#### Sample usage\n\n```shell\nADD(A2,A3)\n\nADD(3,4)\n\nADD(3,ADD(A2, A3))\n```\n\n#### Syntax\n\n```shell\nADD(value1, value2)\n```\n\n- `value1` - The first addend.\n\n- `value2` - The second addend.\n\n#### Example\n\n| Formula    | result   |\n|------------|----------|\n| ADD(-1, 2) | 1        |\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n[*        AVG           *]: \u003c\u003e ()\n\n\u003cdetails\u003e\u003csummary\u003e AVG \u003c/summary\u003e\u003cblockquote\u003e\n\nReturns the average of a series of numbers and/or cells\n\n#### Sample usage\n\n```shell\nAVG(A2:A100)\n\nAVG(1,2,3,4,5)\n\nAVG(1,2,A2:A50)\n\nAVG(1,AVG(A1:A3, 1), 2+A3)\n```\n\n#### Syntax\n\n```shell\nAVG(value1, [value2, ...])\n```\n\n- `value1` - The first number or range to add together.\n\n- `value2`, ... - [ OPTIONAL ] - Additional numbers or ranges to add to value1.\n\n#### Example\n\n| Formula      | result |\n|--------------|--------|\n| AVG(1, 2, 3) | 2      |\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n[*        CONCAT        *]: \u003c\u003e ()\n\n\u003cdetails\u003e\u003csummary\u003e CONCAT \u003c/summary\u003e\u003cblockquote\u003e\n\nReturns the concatenation of two values. Equivalent to the `\u0026` operator.\n\n#### Sample usage\n\n```shell\nCONCAT(\"foo\",\"bar\")\n\nCONCAT(17,76)\n```\n\n#### Syntax\n\n```shell\nCONCAT(value1, value2)\n```\n\n- `value1` - The value to which value2 will be appended.\n\n- `value2` - The value to append to value1.\n\n#### Example\n\n| Formula              | result |\n|----------------------|--------|\n| CONCAT(\"foo\", \"bar\") | foobar |\n| CONCAT(1, 2)         | 12     |\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n[ *        DIVIDE        * ]: \u003c\u003e ()\n\n\u003cdetails\u003e\u003csummary\u003e DIVIDE \u003c/summary\u003e\u003cblockquote\u003e\n\nReturns one number divided by another. Equivalent to the `/` operator.\n\n#### Sample usage\n\n```shell\nDIVIDE(4,2)\n\nDIVIDE(A2,B2)\n```\n\n#### Syntax\n\n```shell\nDIVIDE(dividend, divisor)\n```\n\n- dividend - The number to be divided.\n\n- divisor - The number to divide by.\n\n  - divisor cannot equal 0.\n\n#### Example\n\n| Formula      | result |\n|--------------|--------|\n| DIVIDE(4, 2) | 2      |\n| CONCAT(5, 2) | 2.5    |\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n[ *         EQ           * ]: \u003c\u003e ()\n\n\u003cdetails\u003e\u003csummary\u003e EQ \u003c/summary\u003e\u003cblockquote\u003e\n\nReturns \"TRUE\" if two specified values are equal and \"FALSE\" otherwise. Equivalent to the \"=\" operator.\n\n#### Sample usage\n\n```shell\nEQ(A2,A3)\n\nEQ(2,3)\n```\n\n#### Syntax\n\n```shell\nEQ(value1, value2)\n```\n\n- `value1` - The first value.\n\n- `value2` - The value to test against value1 for equality.\n\n#### Example\n\n| Formula  | result |\n|----------|--------|\n| EQ(4, 2) | FALSE  |\n| EQ(2, 2) | TRUE   |\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n[ *         MULTIPLY     * ]: \u003c\u003e ()\n\n\u003cdetails\u003e\u003csummary\u003e MULTIPLY \u003c/summary\u003e\u003cblockquote\u003e\n\nReturns the product of two numbers. Equivalent to the `*` operator.\n\n#### Sample usage\n\n```shell\nMULTIPLY(A2,B2)\n\nMULTIPLY(2,3)\n```\n\n#### Syntax\n\n```shell\nMULTIPLY(factor1, factor2)\n```\n\n- `factor1` - The first multiplicand.\n\n- `factor2` - The second multiplicand.\n\n#### Example\n\n| Formula        | result |\n|----------------|--------|\n| MULTIPLY(4, 2) | 8      |\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n[ *         GTE          * ]: \u003c\u003e ()\n\n\u003cdetails\u003e\u003csummary\u003e GTE \u003c/summary\u003e\u003cblockquote\u003e\n\nReturns `TRUE` if the first argument is greater than or equal to the second, and `FALSE` otherwise. Equivalent to the `\u003e=` operator.\n\n#### Sample usage\n\n```shell\nGTE(A2,A3)\n\nGTE(2,3)\n```\n\n#### Syntax\n\n```shell\nGTE(value1, value2)\n```\n\n- `value1` - The value to test as being greater than or equal to value2.\n\n- `value2` - The second value.\n\n\n#### Example\n\n| Formula   | result |\n|-----------|--------|\n| GTE(4, 2) | TRUE   |\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n[ *         GT           * ]: \u003c\u003e ()\n\n\u003cdetails\u003e\u003csummary\u003e GT \u003c/summary\u003e\u003cblockquote\u003e\n\nReturns `TRUE` if the first argument is greater than to the second, and `FALSE` otherwise. Equivalent to the `\u003e` operator.\n\n#### Sample usage\n\n```shell\nGT(A2,A3)\n\nGT(2,3)\n```\n\n#### Syntax\n\n```shell\nGT(value1, value2)\n```\n\n- `value1` - The value to test as being greater than to value2.\n\n- `value2` - The second value.\n\n#### Example\n\n| Formula  | result |\n|----------|--------|\n| GT(4, 2) | TRUE   |\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e Logical \u003c/summary\u003e\n\u003cblockquote\u003e\n\n[ *         IF           * ]: \u003c\u003e ()\n\u003cdetails\u003e\u003csummary\u003e IF \u003c/summary\u003e\u003cblockquote\u003e\n\nReturns one value if a logical expression is `TRUE` and another if it is `FALSE`\n\n#### Sample usage\n\n```shell\nIF(A2 = \"foo\",\"A2 is foo\")\n\nIF(A2,\"A2 was true\",\"A2 was false\")\n\nIF(TRUE,4,5)\n```\n\n#### Syntax\n\n```shell\nIF(logical_expression, value_if_true, value_if_false)\n```\n\n- `logical_expression` - An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE.\n\n- `value_if_true` - The value the function returns if logical_expression is TRUE.\n\n- `value_if_false` - The value the function returns if logical_expression is FALSE.\n\n#### Example\n\n| Formula                  | result   |\n|--------------------------|----------|\n| IF(FALSE, 1, \"false ne\") | false ne |\n| IF(TRUE=TRUE, 1, 2)      | 1        |\n| IF(TRUE=TRUE, 1, 2)      | 1        |\n| IF(1\u003eSUM(1, 2), 1, 2)    | 2        |\n\n\u003c/blockquote\u003e\u003c/details\u003e\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n# Contribute\n\nThis repo is required [antlr](https://www.antlr.org/) to define grammar, make sure install it, change your own `EqlLexer.g4`\nand `EqlParser.g4` then run `make run` first\n\n- Fork repository\n- Create a feature branch\n- Open a new pull request\n- Create an issue for bug report or feature request\n\n# License\nThe MIT License (MIT). Please see [LICENSE](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqunv%2Feql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqunv%2Feql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqunv%2Feql/lists"}