{"id":13593984,"url":"https://github.com/obi1kenobi/trustfall","last_synced_at":"2025-05-12T13:22:46.997Z","repository":{"id":37023317,"uuid":"446669912","full_name":"obi1kenobi/trustfall","owner":"obi1kenobi","description":"A query engine for any combination of data sources. Query your files and APIs as if they were databases!","archived":false,"fork":false,"pushed_at":"2025-05-05T04:03:28.000Z","size":6061,"stargazers_count":2684,"open_issues_count":52,"forks_count":78,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-05-05T05:20:16.523Z","etag":null,"topics":["javascript","python","query-language","rust","wasm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obi1kenobi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["obi1kenobi"],"thanks_dev":"obi1kenobi","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-01-11T03:54:11.000Z","updated_at":"2025-05-05T04:03:32.000Z","dependencies_parsed_at":"2023-12-06T23:22:41.942Z","dependency_job_id":"845ca7fd-afd0-4e95-8de8-34f6b809ca42","html_url":"https://github.com/obi1kenobi/trustfall","commit_stats":{"total_commits":321,"total_committers":8,"mean_commits":40.125,"dds":"0.39563862928348914","last_synced_commit":"a9d8d786cbf306da70896e31b92fdb7a3b13466f"},"previous_names":[],"tags_count":105,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obi1kenobi%2Ftrustfall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obi1kenobi%2Ftrustfall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obi1kenobi%2Ftrustfall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obi1kenobi%2Ftrustfall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obi1kenobi","download_url":"https://codeload.github.com/obi1kenobi/trustfall/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745278,"owners_count":21957337,"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":["javascript","python","query-language","rust","wasm"],"created_at":"2024-08-01T16:01:27.222Z","updated_at":"2025-05-12T13:22:46.969Z","avatar_url":"https://github.com/obi1kenobi.png","language":"Rust","funding_links":["https://github.com/sponsors/obi1kenobi","https://thanks.dev/obi1kenobi"],"categories":["Rust","其他_大数据"],"sub_categories":["资源传输下载"],"readme":"# Trustfall — Engine for Querying (Almost) Everything\n\nTrustfall is a query engine for querying any kind of data source, from APIs and databases\nto any kind of files on disk — and even AI models.\n\n* [Try Trustfall in your browser](#try-trustfall-in-your-browser)\n* [10min tech talk + demo](#10min-tech-talk--demo)\n* [Examples of querying real-world data with Trustfall](#examples-of-querying-real-world-data-with-trustfall)\n\n## Try Trustfall in your browser\n\nThe Trustfall Playground supports running queries against public data sources such as:\n- the HackerNews REST APIs: https://play.predr.ag/hackernews\n- the rustdoc JSON of top Rust crates: https://play.predr.ag/rustdoc\n\nFor example,\n[this link](https://play.predr.ag/hackernews#?f=1\u0026q=IyBDcm9zcyBBUEkgcXVlcn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CBoYXZlIGF0IGxlYXN0IG9uZQogICAgICAgICAgICAjIGxpbmsgdGhhdCBwb2ludHMgdG8gZWl0aGVyIEdpdEh1YiBvciBUd2l0dGVyLgogICAgICAgICAgICBsaW5rCiAgICAgICAgICAgICAgQGZvbGQKICAgICAgICAgICAgICBAdHJhbnNmb3JtKG9wOiAiY291bnQiKQogICAgICAgICAgICAgIEBmaWx0ZXIob3A6ICI%2BPSIsIHZhbHVlOiBbIiRtaW5Qcm9maWxlcyJdKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgY29tbWVudGVySURzOiB1cmwgQGZpbHRlcihvcDogInJlZ2V4IiwgdmFsdWU6IFsiJHNvY2lhbFBhdHRlcm4iXSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBAb3V0cHV0CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0KICAgIH0KICB9Cn0%3D\u0026v=ewogICJzaXRlUGF0dGVybiI6ICJodHRwW3NdOi8vKFteLl0qXFwuKSpvcGVuYWkuY29tLy4qIiwKICAibWluUHJvZmlsZXMiOiAxLAogICJzb2NpYWxQYXR0ZXJuIjogIihnaXRodWJ8dHdpdHRlcilcXC5jb20vIgp9)\nshows the results of the HackerNews query: \"Which GitHub or Twitter\nusers are commenting on stories about OpenAI?\"\n\nIn the Playground, Trustfall is configured to run client-side as WASM, performing\nall aspects of query processing (parsing, compilation, and execution) within the browser.\nWhile this demo highlights Trustfall's ability to be embedded within a target application,\nit is of course able to be used in a more traditional client-server context as well.\n\n## 10min tech talk + demo\n\nTrustfall was featured in the [\"How to Query (Almost) Everything\" talk](https://www.hytradboi.com/2022/how-to-query-almost-everything)\ntalk at the [HYTRADBOI 2022](https://www.hytradboi.com/) conference.\n\n![Terminal recording of running `cargo run --release -- query example_queries/actions_in_repos_with_min_10_hn_pts.ron` in the `demo-hytradboi` demo project. The system returns the first 20 results of the query in 6.36 seconds.\"](./demo-hytradboi/query-demo.gif)\n\n*Demo from the talk showing the execution of the cross-API query: \"Which GitHub Actions are used in projects on the front page of HackerNews with \u003e=10 points?\"*\n\nThe demo executes the following query across the HackerNews and GitHub APIs and over the YAML-formatted GitHub repository workflow files:\n```graphql\n{\n  HackerNewsTop(max: 200) {\n    ... on HackerNewsStory {\n      hn_score: score @filter(op: \"\u003e=\", value: [\"$min_score\"]) @output\n\n      link {\n        ... on GitHubRepository {\n          repo_url: url @output\n\n          workflows {\n            workflow: name @output\n            workflow_path: path @output\n\n            jobs {\n              job: name @output\n\n              step {\n                ... on GitHubActionsImportedStep {\n                  step: name @output\n                  action: uses @output\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nInstructions for\nrunning the demo are available together with the source code in the\n`demo-hytradboi` directory: [link](./demo-hytradboi).\n\n## Examples of querying real-world data with Trustfall\n\n- [HackerNews APIs](./trustfall/examples/hackernews/), including an overview of the query language\n  and an example of querying REST APIs.\n- [RSS/Atom feeds](./trustfall/examples/feeds/), showing how to query structured data\n  like RSS/Atom feeds.\n- [airport weather data (METAR)](./trustfall/examples/weather), showing how to query CSV data from\n  aviation weather reports.\n\nTrustfall also powers the [`cargo-semver-checks`](https://crates.io/crates/cargo-semver-checks)\nsemantic versioning linter.\nMore details on the role Trustfall plays in that use case are available in\n[this blog post](https://predr.ag/blog/speeding-up-rust-semver-checking-by-over-2000x/).\n\n## Using Trustfall over a new data source\n\nThe easiest way to plug in a new data source is by implementing\n[the `BasicAdapter` trait](https://docs.rs/trustfall_core/latest/trustfall_core/interpreter/basic_adapter/trait.BasicAdapter.html).\n\nPython bindings are available, and are built automatically on every change to\nthe engine; the most recent version may be downloaded\n[here](https://github.com/obi1kenobi/trustfall/releases). A getting started\nguide for Python is forthcoming ([tracking\nissue](https://github.com/obi1kenobi/trustfall/issues/16)); in the meantime, the\nbest resource is the Python bindings' [test suite](./pytrustfall/trustfall/tests/test_execution.py).\n\n## Directory Registry\n\n- [`trustfall`](./trustfall/) is a façade crate. This is the preferred way to use Trustfall.\n- [`trustfall_core`](./trustfall_core/) contains the query engine internals\n- [`trustfall_derive`](./trustfall_derive/) defines macros that simplify plugging in data sources.\n- [`pytrustfall`](./pytrustfall/) contains Trustfall's Python bindings\n- [`trustfall_wasm`](./trustfall_wasm/) is a WASM build of Trustfall\n- [`trustfall_filetests_macros`](./trustfall_filetests_macros/) is a procedural\n  macro used to generate test cases defined by files: they ensure that the\n  function under test, when given an input specified by one file, produces an\n  output equivalent to the contents of another file.\n- [`experiments`](./experiments/) contains various experimental projects\n  such as the [Trustfall web playground](https://play.predr.ag/).\n\nCopyright 2022-present Predrag Gruevski.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nThe present date is determined by the timestamp of the most recent commit in the repository.\nBy accessing, and contributing code, comments, or issues to this repository,\nyou are agreeing that all your contributions may be used, modified, copied, and/or redistributed\nunder any terms chosen by the original author and/or future maintainers of this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobi1kenobi%2Ftrustfall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobi1kenobi%2Ftrustfall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobi1kenobi%2Ftrustfall/lists"}