https://github.com/cldwalker/wolfram
Wolfram|Alpha client
https://github.com/cldwalker/wolfram
Last synced: 11 months ago
JSON representation
Wolfram|Alpha client
- Host: GitHub
- URL: https://github.com/cldwalker/wolfram
- Owner: cldwalker
- License: mit
- Fork: true (ianwhite/wac)
- Created: 2011-01-23T15:00:28.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2023-08-06T18:25:43.000Z (almost 3 years ago)
- Last Synced: 2024-11-29T16:43:32.508Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 65.4 KB
- Stars: 48
- Watchers: 6
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Description
===========
Explore the vast world of computational knowledge available for free via Wolfram's v2 API.
### Install
To install this gem:
```bash
gem install wolfram
```
Ruby 2.7 and later are supported; earlier versions may work, but are
not supported.
### Setup
You'll need a Wolfram Appid (api key) by [creating an account
here](http://developer.wolframalpha.com/portal/apisignup.html) and
then clicking on the 'Get an APPID' button.
Once you have your own appid, set it in your shell, preferably in your ~/.bashrc:
```bash
export WOLFRAM_APPID='YOURKEY'
```
If you want to explicitly set your appid in a script:
```ruby
Wolfram.appid = "YOURKEY"
```
### Usage
Query away on the commandline!
```bash
# Calculate distance and travel time between places
wolfram from boston to new york
# Solve an equation
wolfram x^3 - 4x^2 + 6x - 24 = 0
# Find words ending with able
wolfram words ending with able
```
Regular ruby usage:
```ruby
query = 'boston population'
result = Wolfram.fetch(query)
# to see the result as a hash of pods and assumptions:
hash = Wolfram::HashPresenter.new(result).to_hash
```
For many more examples, [see here](http://www.wolframalpha.com/examples/).
## Credits
* [Ian White](https://github.com/ianwhite) is the original author of this gem.
* @spaghetticode for HashPresenter
* @bdigital, @emilesilvis for bug fixes
## Todo
* More tests!
* A better inspect
* Handle more api options including format