{"id":23029677,"url":"https://github.com/antononcube/raku-www-wolframalpha","last_synced_at":"2025-08-20T18:35:42.668Z","repository":{"id":238332733,"uuid":"796339893","full_name":"antononcube/Raku-WWW-WolframAlpha","owner":"antononcube","description":"Raku package for accessing Wolfram|Alpha.","archived":false,"fork":false,"pushed_at":"2024-05-06T12:58:10.000Z","size":185,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T20:32:48.098Z","etag":null,"topics":["rakulang","web-api","webapi","wolfram","wolfram-alpha"],"latest_commit_sha":null,"homepage":"https://raku.land/zef:antononcube/WWW::WolframAlpha","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antononcube.png","metadata":{"files":{"readme":"README-work.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":"2024-05-05T16:48:52.000Z","updated_at":"2024-05-06T12:58:26.000Z","dependencies_parsed_at":"2025-04-02T20:30:58.051Z","dependency_job_id":"726091aa-1193-4756-9cd5-e5ff2d6fb374","html_url":"https://github.com/antononcube/Raku-WWW-WolframAlpha","commit_stats":null,"previous_names":["antononcube/raku-www-wolframalpha"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/antononcube/Raku-WWW-WolframAlpha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antononcube%2FRaku-WWW-WolframAlpha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antononcube%2FRaku-WWW-WolframAlpha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antononcube%2FRaku-WWW-WolframAlpha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antononcube%2FRaku-WWW-WolframAlpha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antononcube","download_url":"https://codeload.github.com/antononcube/Raku-WWW-WolframAlpha/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antononcube%2FRaku-WWW-WolframAlpha/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261334912,"owners_count":23143441,"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":["rakulang","web-api","webapi","wolfram","wolfram-alpha"],"created_at":"2024-12-15T14:16:43.294Z","updated_at":"2025-08-20T18:35:42.639Z","avatar_url":"https://github.com/antononcube.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WWW::WolframAlpha\n\n[![MacOS](https://github.com/antononcube/Raku-WWW-WolframAlpha/actions/workflows/macos.yml/badge.svg)](https://github.com/antononcube/Raku-WWW-WolframAlpha/actions/workflows/macos.yml)\n[![Linux](https://github.com/antononcube/Raku-WWW-WolframAlpha/actions/workflows/linux.yml/badge.svg)](https://github.com/antononcube/Raku-WWW-WolframAlpha/actions/workflows/linux.yml)\n[![Win64](https://github.com/antononcube/Raku-WWW-WolframAlpha/actions/workflows/windows.yml/badge.svg)](https://github.com/antononcube/Raku-WWW-WolframAlpha/actions/workflows/windows.yml)\n[![https://raku.land/zef:antononcube/WWW::WolframAlpha](https://raku.land/zef:antononcube/WWW::WolframAlpha/badges/version)](https://raku.land/zef:antononcube/WWW::WolframAlpha)\n\n## In brief\n\nThis Raku package provides access to the answer engine [Wolfram|Alpha](https://www.wolframalpha.com), [WA1, Wk1].\nFor more details of the Wolfram|Alpha's API usage see [the documentation](https://products.wolframalpha.com/api/documentation), [WA2].\n\n**Remark:** To use the Wolfram|Alpha API one has to register and obtain an authorization key.\n\n\n-----\n\n## Installation\n\nPackage installations from both sources use [zef installer](https://github.com/ugexe/zef)\n(which should be bundled with the \"standard\" Rakudo installation file.)\n\nTo install the package from [Zef ecosystem](https://raku.land/) use the shell command:\n\n```\nzef install WWW::WolframAlpha\n```\n\nTo install the package from the GitHub repository use the shell command:\n\n```\nzef install https://github.com/antononcube/Raku-WWW-WolframAlpha.git\n```\n\n----\n\n## Usage examples\n\n**Remark:** When the authorization key, `auth-key`, is specified to be `Whatever`\nthen the functions `wolfam-alpha*` attempt to use the env variable `WOLFRAM_ALPHA_API_KEY`.\n\nThe package has an universal \"front-end\" function `wolfram-alpha` for the \n[different endpoints provided by Wolfram|Alpha Web API](https://products.wolframalpha.com/api/documentation).\n\n### (Plaintext) results\n\nHere is a _result_ call:\n\n```perl6\nuse WWW::WolframAlpha;\nwolfram-alpha-result('How many calories in 4 servings of potato salad?');\n```\n\n### Simple (image) results\n\nHere is a _simple_ call (produces an image):\n\n```perl6, results=asis\nwolfram-alpha-simple('What is popularity of the name Larry?', format =\u003e 'md-image');\n```\n\n**Remark:** Pretty good conjectures of Larry Wall's birthday year or age can be made using the obtained graphs.\n\n### Full queries\n\nFor the so called *full queries* Wolfram|Alpha returns complicated data of pods in either XML or JSON format;\nsee [\"Explanation of Pods\"](https://products.wolframalpha.com/api/documentation?scrollTo=explanation-of-pods).\n\nHere we get the result of a full query and show its (complicated) data type (using [\"Data::TypeSystem\"](https://raku.land/zef:antononcube/Data::TypeSystem)):\n\n```perl6\nuse Data::TypeSystem;\n\nmy $podRes = wolfram-alpha-query('convert 44 lbs to kilograms', output =\u003e 'json', format =\u003e 'hash');\n\ndeduce-type($podRes)\n```\n\nHere we convert the query result into Markdown (`data-translation` can be also used):\n\n```perl6, results=asis\nwolfram-alpha-pods-to-markdown($podRes, header-level =\u003e 4):plaintext;\n```\n\n-------\n\n## Command Line Interface\n\n### Playground access\n\nThe package provides a Command Line Interface (CLI) script:\n\n```shell\nwolfram-alpha --help\n```\n\n\n**Remark:** When the authorization key argument \"auth-key\" is specified set to \"Whatever\"\nthen `wolfram-alpha` attempts to use the env variable `WOLFRAM_ALPHA_API_KEY`.\n\n\n--------\n\n## Mermaid diagram\n\nThe following flowchart corresponds to the steps in the package function `wolfram-alpha-query`:\n\n```mermaid\ngraph TD\n\tUI[/Some natural language text/]\n\tTO[/\"Wolfram|Alpha\u003cbr/\u003eProcessed output\"/]\n\tWR[[Web request]]\n\tWolframAlpha{{http://api.wolframalpha.com}}\n\tPJ[Parse JSON]\n\tQ{Return\u003cbr\u003ehash?}\n\tMSTC[Compose query]\n\tMURL[[Make URL]]\n\tTTC[Process]\n\tQAK{Auth key\u003cbr\u003esupplied?}\n\tEAK[[\"Try to find\u003cbr\u003eWOLFRAM_ALPHA_API_KEY\u003cbr\u003ein %*ENV\"]]\n\tQEAF{Auth key\u003cbr\u003efound?}\n\tNAK[/Cannot find auth key/]\n\tUI --\u003e QAK\n\tQAK --\u003e |yes|MSTC\n\tQAK --\u003e |no|EAK\n\tEAK --\u003e QEAF\n\tMSTC --\u003e TTC\n\tQEAF --\u003e |no|NAK\n\tQEAF --\u003e |yes|TTC\n\tTTC -.-\u003e MURL -.-\u003e WR -.-\u003e TTC\n\tWR -.-\u003e |URL|WolframAlpha \n\tWolframAlpha -.-\u003e |JSON|WR\n\tTTC --\u003e Q \n\tQ --\u003e |yes|PJ\n\tQ --\u003e |no|TO\n\tPJ --\u003e TO\n```\n\n--------\n\n## References\n\n[AAp1] Anton Antonov,\n[Data::TypeSystem Raku package](https://github.com/antononcube/Raku-Data-TypeSystem),\n(2023),\n[GitHub/antononcube](https://github.com/antononcube).\n\n[WA1] Wolfram Alpha LLC, [Wolfram|Alpha](https://www.wolframalpha.com). \n\n[WA2] Wolfram Alpha LLC, [Web API documentation](https://products.wolframalpha.com/api/documentation).\n\n[Wk1] Wikipedia entry, [WolframAlpha](https://en.wikipedia.org/wiki/WolframAlpha).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantononcube%2Fraku-www-wolframalpha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantononcube%2Fraku-www-wolframalpha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantononcube%2Fraku-www-wolframalpha/lists"}