{"id":24001852,"url":"https://github.com/leopiccionia/lua-wolfram","last_synced_at":"2025-04-14T23:10:36.757Z","repository":{"id":45032268,"uuid":"97256785","full_name":"leopiccionia/lua-wolfram","owner":"leopiccionia","description":"A library for Wolfram|Alpha API.","archived":false,"fork":false,"pushed_at":"2019-06-06T21:12:49.000Z","size":56,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T11:11:36.953Z","etag":null,"topics":["lua","wolfram-alpha","wolfram-alpha-api"],"latest_commit_sha":null,"homepage":null,"language":"Lua","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/leopiccionia.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}},"created_at":"2017-07-14T17:14:34.000Z","updated_at":"2022-07-12T19:49:34.000Z","dependencies_parsed_at":"2022-09-05T09:40:12.421Z","dependency_job_id":null,"html_url":"https://github.com/leopiccionia/lua-wolfram","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leopiccionia%2Flua-wolfram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leopiccionia%2Flua-wolfram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leopiccionia%2Flua-wolfram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leopiccionia%2Flua-wolfram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leopiccionia","download_url":"https://codeload.github.com/leopiccionia/lua-wolfram/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975316,"owners_count":21192210,"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":["lua","wolfram-alpha","wolfram-alpha-api"],"created_at":"2025-01-08T00:38:39.334Z","updated_at":"2025-04-14T23:10:36.740Z","avatar_url":"https://github.com/leopiccionia.png","language":"Lua","readme":"# lua-wolfram\r\n\r\n**lua-wolfram** is an unofficial library for accessing plaintext results from [Wolfram|Alpha](https://www.wolframalpha.com), world's top computational knowledge engine.\r\n\r\n## Installing\r\n\r\nlua-wolfram is available in [LuaRocks](https://luarocks.org/modules/leopiccionia/lua-wolfram).\r\n\r\n```\r\nluarocks install lua-wolfram\r\n```\r\n\r\n## How to use\r\n\r\nThe API requires an AppID, that can be obtained [here](https://products.wolframalpha.com/api/).\r\n\r\n```lua\r\nlocal WolframAlpha = require \"wolfram\"\r\nlocal client = WolframAlpha(\"YOUR-API-KEY-HERE\")\r\n\r\nlocal short_answer = assert(wolfram:query(\"What's the capital of USA?\"))\r\nlocal long_answer = assert(wolfram:full_query(\"square root of 2\"))\r\n```\r\n\r\nMethod `query()` returns the the most immediate interpretation of the query, as a string:\r\n\r\n```lua\r\n\"Washington, District of Columbia, United States\"\r\n```\r\n\r\nThe method `full_query()`, on the other side, returns many views about the same query. It returns a table:\r\n\r\n```lua\r\n{\r\n    [\"Constant name\"] = {\r\n        \"Pythagora's constant\"\r\n    },\r\n    [\"Continued fraction\"] = {\r\n        \"[1; 2^_]\"\r\n    },\r\n    [\"All 2nd roots of 2\"] = {\r\n        \"sqrt(2)≈1.4142  (real, principal root)\",\r\n        \"-sqrt(2)≈-1.4142  (real root)\"\r\n    },\r\n    [\"Input\"] = {\r\n        \"sqrt(2)\"\r\n    },\r\n    [\"Decimal approximation\"] = {\r\n        \"1.414213562373095048801688724209698078569671875376948073176…\"\r\n    }\r\n}\r\n```\r\n\r\nPlease notice that subtables can contain both numerical and textual indexes (i.e. act as array, dictionary, or both).\r\n\r\n## Examples\r\n\r\nPlease look at [examples](/examples) folder.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleopiccionia%2Flua-wolfram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleopiccionia%2Flua-wolfram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleopiccionia%2Flua-wolfram/lists"}