DataSets[Quandl] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Statistics and Data Analysis : DataSets Package : Quandl : DataSets/Quandl/SetToken

DataSets[Quandl]

  

SetToken

  

set the Quandl API authentication token

 

Calling Sequence

Parameters

Description

Examples

Adding SetToken to Your Personal Initialization File

Compatibility

Calling Sequence

SetToken(token)

SetToken(token, premium)

Parameters

token

-

string; the Quandl API authentication token to be used for API calls

premium

-

(optional) an equation of the form premium=truefalse; denotes whether the token is a premium token and defaults to false

Description

• 

The SetToken commands sets the authentication token used for Quandl API calls.

• 

By default, Maple does not use an authentication token for Quandl API calls. That is, API calls are made anonymously.

• 

Anonymous API calls can only access public databases and are limited in the number of requests that can be made per day.

• 

If you have a Quandl authentication token, use SetToken("yourToken") to perform more Quandl API requests and to access premium databases you have purchased. See http://www.quandl.com/ for more information on the Quandl API and authentication tokens.

• 

The premium option is used by Maple to determine what errors to return when a request fails. It does not allow you to access to premium databases.

• 

The default value for the premium option is false. In this case, Maple returns a warning and an empty data set the first time you request data from a premium database. After that, only the empty data set is returned (that is, Maple knows not to expect valid data sets for every request).

• 

Set premium = true if you have access to premium databases. In this case, Maple always returns an error if your request results in an empty data set.

• 

SetToken returns the value of the previous authentication token.

• 

Add SetToken to your personal initialization file in order to set your Quandl authentication token every time you start or restart Maple.

Examples

withDataSets:

The following command sets the Quandl authentication token to an empty string (that is, API calls are anonymous) and sets the premium option to false, which is the same as the default authentication method used by Maple. The command returns the value of the previous token.

Quandl:-SetToken,premium=false

(1)

Adding SetToken to Your Personal Initialization File

Your personal initialization file contains Maple commands that run every time you start or restart Maple.

If you have a Quandl authentication token, add the SetToken command to your initialization file in order to perform more requests and to access your premium databases.

To add SetToken to your personal initialization file:

1. 

Open a text editor.

2. 

If you have an initialization file, open it. If not, create a new one.

Note: The location and name of your personal initialization file depend on your operating system:

• 

Windows: <homeDirectory>\maple.ini

• 

Linux or Mac: <homeDirectory>/.mapleinit

Where <homeDirectory> is the output from the kernelopts(homedir) command.

3. 

Add the following command to your initialization file:

  

DataSets:-Quandl:-SetToken("yourToken", premium = premiumAccess ):

Where yourToken is your Quandl authentication token and premiumAccess is either true or false, depending on your Quandl access level.

4. 

Save and then close your initialization file.

To test your initialization file, open a new Maple worksheet and then run the command you entered in step 3. The output should be your Quandl authentication token.

Note: If you do not get your authentication token, then Maple is using another initialization file. See Create Maple Initialization File for details on where Maple looks for initialization files.

Compatibility

• 

The DataSets[Quandl][SetToken] command was introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.

See Also

DataSets[Quandl][Reference]

DataSets

Create Maple Initialization File