ravenpack

RavenPack News Analytics connection

Description

The ravenpack function creates a ravenpack object. The ravenpack object represents a RavenPack® News Analytics connection.

After you create a ravenpack object, you can use the object functions to retrieve intraday, historical, and real-time news event data.

To use the RavenPack News Analytics software, you must first download it from the RavenPack Developer Zone.

Creation

Description

example

c = ravenpack(user,password) connects to RavenPack News Analytics Data Gateway, sets the User property, and uses a password.

example

c = ravenpack(user,password,application) also sets the Application property.

Input Arguments

expand all

Password, specified as a character vector or string scalar. For your password, contact RavenPack.

Data Types: char | string

Properties

expand all

This property is read-only.

RavenPack application service, specified as a character vector or string scalar.

Data Types: char | string

This property is read-only.

RavenPack Data Gateway Client, specified as a RavenPack Data Gateway Client object.

Example: [1x1 com.ravenpack.data.DataGatewayClient]

This property is read-only.

User name, specified as a character vector or string scalar. For your user name, contact RavenPack.

Example: 'username'

Data Types: char | string

Data return format, specified as one of these values, which determine the data type of the returned data.

ValueData Type of Returned Data
'table'table
'timetable'timetable

You can specify these values using a character vector or string (for example, "table").

To retrieve data as a timetable, you must set this property value manually at the command line or in a script using dot notation, for example:

c.DataReturnFormat = 'timetable';

The default date format is a datetime array.

After setting the DataReturnFormat property, use the timeseries function to retrieve intraday and historical data.

Object Functions

entitlementsRavenPack News Analytics Data Gateway entitlements
realtimeRavenPack News Analytics real-time data
timeseriesRavenPack News Analytics intraday and historical data
closeClose RavenPack News Analytics connection

Examples

collapse all

Create a RavenPack News Analytics connection. Then, retrieve historical data for a company.

Start the RavenPack Data Gateway process from the RavenPack folder in the Windows® Start menu.

Add the full path of the Data Gateway Client JAR file to the dynamic Java® class path. For details about static and dynamic class paths, see Java Class Path (MATLAB).

javaaddpath 'C:\Program Files\RavenPack\api\DataGatewayClient.jar'

Note

If you are running Linux®, start the RavenPack Data Gateway using the following command. This command assumes that you installed RavenPack News Analytics in the default /opt/ravenpack folder.

/opt/ravenpack/bin/DataGateway.sh

Then, add the full path of the Data Gateway Client JAR file using this command.

javaaddpath '/opt/ravenpack/api/DataGatewayClient.jar'

Create a RavenPack News Analytics connection using the user name username and password pwd. The RavenPack News Analytics connection object c appears in the MATLAB® workspace.

c = ravenpack('username','pwd')
c = 

  ravenpack with properties:

             Application: 'rpna-api'
                  Handle: [1x1 com.ravenpack.data.DataGatewayClient]
                    User: 'username'
        DataReturnFormat: 'table'

Retrieve RavenPack News Analytics data for the last day. Here, the symbol is the entitled symbol (entity-scores :rpna-4.0-eqt). The start date is 1 day ago. The end date is the current date and time. d is a table that contains the RavenPack News Analytics data.

symbol = '(entity-scores :rpna-4.0-eqt)';
startdate = now-1;
enddate = now;

d = timeseries(c,symbol,{startdate,enddate});

To retrieve more than 3 days of historical news data, use the RavenPack News Analytics Data Feed Tool.

Display the first four columns of the first record of historical data. Each row in the table is one record of news data. Here, the first four columns specify a news event on May 9, 2018 about a company.

d(1,1:4)
ans =

  1×4 table

       TIMESTAMP_UTC        RP_ENTITY_ID    ENTITY_TYPE    ENTITY_NAME 
    ____________________    ____________    ___________    ____________

    09-May-2018 15:02:00       2491BC          COMP        Twitter Inc.

Close the RavenPack News Analytics connection.

close(c)

Create a RavenPack News Analytics connection using a RavenPack application service. Then, retrieve historical data for a company.

Start the RavenPack Data Gateway process from the RavenPack folder in the Windows Start menu.

Add the full path of the Data Gateway Client JAR file to the dynamic Java class path. For details about static and dynamic class paths, see Java Class Path (MATLAB).

javaaddpath 'C:\Program Files\RavenPack\api\DataGatewayClient.jar'

Note

If you are running Linux, start the RavenPack Data Gateway using the following command. This command assumes that you installed RavenPack News Analytics in the default /opt/ravenpack folder.

/opt/ravenpack/bin/DataGateway.sh

Then, add the full path of the Data Gateway Client JAR file using this command.

javaaddpath '/opt/ravenpack/api/DataGatewayClient.jar'

Create a RavenPack News Analytics connection using the user name username, password pwd, and application service app-service-name. The RavenPack News Analytics connection object c appears in the MATLAB workspace.

user = 'username';
password = 'pwd';
application = 'app-service-name';
c = ravenpack(user,password,application)
c = 

  ravenpack with properties:

             Application: 'app-service-name'
                  Handle: [1x1 com.ravenpack.data.DataGatewayClient]
                    User: 'username'
        DataReturnFormat: 'table'

Retrieve RavenPack News Analytics data for the last day. Here, the symbol is the entitled symbol (entity-scores :rpna-4.0-eqt). The start date is 1 day ago. The end date is the current date and time. d is a table that contains the RavenPack News Analytics data.

symbol = '(entity-scores :rpna-4.0-eqt)';
startdate = now-1;
enddate = now;

d = timeseries(c,symbol,{startdate,enddate});

To retrieve more than 3 days of historical news data, use the RavenPack News Analytics Data Feed Tool.

Display the first four columns of the first record of historical data. Each row in the table is one record of news data. Here, the first four columns specify a news event on May 9, 2018 about a company.

d(1,1:4)
ans =

  1×4 table

       TIMESTAMP_UTC        RP_ENTITY_ID    ENTITY_TYPE         ENTITY_NAME     
    ____________________    ____________    ___________    _____________________

    09-May-2018 15:29:20       375C05          COMP        Ecolomondo Corp. Inc.

Close the RavenPack News Analytics connection.

close(c)

Introduced in R2015b