{"id":28965525,"url":"https://github.com/danielgerlag/powerfx-rust","last_synced_at":"2026-02-24T05:43:59.389Z","repository":{"id":277449501,"uuid":"692259272","full_name":"danielgerlag/powerfx-rust","owner":"danielgerlag","description":"Power Fx interpreter for Rust","archived":false,"fork":false,"pushed_at":"2025-02-14T16:29:45.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T05:16:50.493Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/danielgerlag.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-09-16T00:07:53.000Z","updated_at":"2025-04-11T10:39:30.000Z","dependencies_parsed_at":"2025-02-14T01:38:14.780Z","dependency_job_id":"fdd1005e-c565-4436-97ef-3d446bdc4a9f","html_url":"https://github.com/danielgerlag/powerfx-rust","commit_stats":null,"previous_names":["danielgerlag/powerfx-rust"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danielgerlag/powerfx-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielgerlag%2Fpowerfx-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielgerlag%2Fpowerfx-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielgerlag%2Fpowerfx-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielgerlag%2Fpowerfx-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielgerlag","download_url":"https://codeload.github.com/danielgerlag/powerfx-rust/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielgerlag%2Fpowerfx-rust/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261622838,"owners_count":23186026,"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":[],"created_at":"2025-06-24T06:37:57.815Z","updated_at":"2026-02-24T05:43:59.383Z","avatar_url":"https://github.com/danielgerlag.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Power Fx interpreter for Rust\n\nThis crate provides an embedded [Power Fx](https://learn.microsoft.com/en-us/power-platform/power-fx/overview) interpreter for Rust projects.\n\n## Getting started\n\nInstall the package.\n\n```shell\ncargo add powerfx\n```\n\n## Testing\n\nRun all tests:\n\n```shell\ncargo test\n```\n\nThe project includes two types of tests:\n\n1. **Unit tests** (`src/tests/mod.rs`) - 37 Rust-based tests\n2. **Expression tests** (`tests/expression_tests/`) - 364 txt-based tests in a format similar to Microsoft's Power-Fx test format\n\n### Adding Expression Tests\n\nCreate a `.txt` file in `tests/expression_tests/` with this format:\n\n```\n// Comments start with //\n\u003e\u003e 1 + 2\n3\n\n\u003e\u003e Upper('hello')\n\"HELLO\"\n```\n\n## Status\n\nThis library is still in an alpha status.  The following functions have been implemented:\n\n**Table Functions:**\n- Table, First, Last, Index, Filter, CountRows\n- LookUp, Sort, CountIf, ForAll\n- Sequence, Distinct, FirstN, LastN, Shuffle, Reverse\n- AddColumns, DropColumns, RenameColumns, ShowColumns, SortByColumns\n\n**Context:**\n- Set\n\n**Logical:**\n- If, And, Or, Not, Coalesce\n- IsBlank, Blank, IsEmpty\n- Switch, IfError, With, Boolean\n- IsBoolean, IsText, IsNumber, IsDate, IsTable, IsRecord\n\n**Math:**\n- Abs, Sqrt, Round, RoundUp, RoundDown\n- Int, Trunc, Mod, Power\n- Rand, RandBetween, Exp, Ln, Log\n- Sin, Cos, Tan, Asin, Acos, Atan, Atan2\n- Pi, Floor, Ceiling, Sign, Degrees, Radians\n- IsNumeric, Dec2Hex, Hex2Dec\n\n**Text:**\n- Left, Mid, Right, Upper, Lower, Len\n- Concat, Concatenate\n- Trim, TrimEnds, StartsWith, EndsWith\n- Find, Replace, Substitute\n- Value, Text, Char, Exact, Proper\n- Split, Rept, EncodeUrl, PlainText\n- HashTags, JSON, GUID\n\n**Date/Time:**\n- Now, Today, Date, Year, Month, Day\n- Weekday, DateAdd, DateDiff, IsToday\n- EOMonth, IsBetween, Calendar\n\n**Aggregation:**\n- Average, Sum, Min, Max\n- StdevP, VarP, CountA\n\n## Examples\n\nThe following example illustrates adding two constant numbers.\n\n```rust\nuse powerfx::{DataValue, PowerFxEngine};\n\nfn main() {\n    let engine = PowerFxEngine::new();\n    let result = engine.evaluate(\"2 + 3\", None).unwrap();\n    assert_eq!(result, DataValue::Number(5.0));\n}\n```\n\nThis can also be done with variables.\n\n```rust\nlet engine = PowerFxEngine::new();\nlet mut session = Session::new();\nsession.set_variable(\"a\", DataValue::Number(2.0));\nsession.set_variable(\"b\", DataValue::Number(3.0));\n\nlet result = engine.evaluate(\"a + b\", Some(\u0026mut session)).unwrap();\nassert_eq!(result, DataValue::Number(5.0));\n```\n\nFor more examples, please see the [Examples Folder](./examples/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielgerlag%2Fpowerfx-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielgerlag%2Fpowerfx-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielgerlag%2Fpowerfx-rust/lists"}