altadata-java

Functions for interacting directly with the ALTADATA API. With this Java package, developers can build applications around the ALTADATA API without having to deal with accessing and managing requests and responses.

License

License

Categories

Categories

Java Languages Data
GroupId

GroupId

io.altadata
ArtifactId

ArtifactId

altadata-java
Last Version

Last Version

0.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

altadata-java
Functions for interacting directly with the ALTADATA API. With this Java package, developers can build applications around the ALTADATA API without having to deal with accessing and managing requests and responses.
Project URL

Project URL

https://github.com/altabering/altadata-java
Source Code Management

Source Code Management

http://github.com/altabering/altadata-java/tree/master

Download altadata-java

How to add to project

<!-- https://jarcasting.com/artifacts/io.altadata/altadata-java/ -->
<dependency>
    <groupId>io.altadata</groupId>
    <artifactId>altadata-java</artifactId>
    <version>0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/io.altadata/altadata-java/
implementation 'io.altadata:altadata-java:0.1.1'
// https://jarcasting.com/artifacts/io.altadata/altadata-java/
implementation ("io.altadata:altadata-java:0.1.1")
'io.altadata:altadata-java:jar:0.1.1'
<dependency org="io.altadata" name="altadata-java" rev="0.1.1">
  <artifact name="altadata-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.altadata', module='altadata-java', version='0.1.1')
)
libraryDependencies += "io.altadata" % "altadata-java" % "0.1.1"
[io.altadata/altadata-java "0.1.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.json : json jar 20201115

test (1)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter jar

Project Modules

There are no modules declared in this project.

ALTADATA Java Client

Build status Maven central javadoc

ALTADATA is a Curated Data Marketplace. This Java package provides convenient access to the ALTADATA API from applications written in the Java language. With this Java package, developers can build applications around the ALTADATA API without having to deal with accessing and managing requests and responses.

Installing with Maven

To include altadata-java in your Maven application, add a dependency on its artifacts to your project's pom.xml file. For example,

<dependency>
    <groupId>io.altadata</groupId>
    <artifactId>altadata-java</artifactId>
    <version>0.1.1</version>
</dependency>

Quickstart

Obtain an API key in your dashboard and initialize the client:

import io.altadata.AltaData;

AltaData client = new AltaData("YOUR_API_KEY");

Retrieving Data

You can get the entire data with the code below.

ArrayList<JSONObject> data = client.get_data("PRODUCT_CODE").load();

Retrieving Subscription Info

You can get your subscription info with the code below.

ArrayList<JSONObject> subscription_info = client.list_subscription();

Retrieving Data Header Info

You can get your data header with the code below.

Set<String> header_info = client.get_header("PRODUCT_CODE");

Retrieving Data with Conditions

You can get data with using various conditions.

The columns you can apply these filter operations to are limited to the filtered columns.

You can find the filtered columns in the data section of the data product page.

equal condition

String product_code = "co_10_jhucs_03";

ArrayList<JSONObject> data = client.get_data(product_code)
    .equal("province_state", "Alabama")
    .load();

not equal condition

String product_code = "co_10_jhucs_03";

ArrayList<JSONObject> data = client.get_data(product_code)
    .not_equal("province_state", "Montana")
    .load();

in condition

String product_code = "co_10_jhucs_03";

ArrayList<JSONObject> data = client.get_data(product_code)
    .condition_in("province_state", new String[]{"Montana", "Utah"})
    .load();

condition_value parameter of condition_in method must be Array

not in condition

String product_code = "co_10_jhucs_03";

ArrayList<JSONObject> data = client.get_data(product_code)
    .condition_not_in("province_state", new String[]{"Montana", "Utah", "Alabama"})
    .load();

condition_value parameter of condition_not_in method must be Array

sort operation

String product_code = "co_10_jhucs_03";
String order_method = "desc";

ArrayList<JSONObject> data = client.get_data(product_code)
    .sort("reported_date", order_method)
    .load();

Default value of order_method parameter is 'asc' and order_method parameter must be "asc" or "desc"

select specific columns

String product_code = "co_10_jhucs_03";
String[]selected_column = {"reported_date", "province_state", "mortality_rate"};

ArrayList<JSONObject> data = client.get_data(product_code)
    .select(selected_column)
    .load();

selected_column parameter of select method must be Array

get the specified amount of data

String product_code = "co_10_jhucs_03";
int data_limit = 20;

ArrayList<JSONObject> data = client.get_data(product_code, data_limit).load();

Retrieving Data with Multiple Conditions

You can use multiple condition at same time.

String product_code = "co_10_jhucs_03";
int data_limit = 100;
String order_method = "desc";
String[] selected_column = {"reported_date", "province_state", "mortality_rate"};

ArrayList<JSONObject> data = client.get_data(product_code, data_limit)
    .condition_in("province_state", new String[]{"Montana", "Utah"})
    .sort("mortality_rate", order_method)
    .select(selected_column)
    .load();

License

altadata-java is under MIT license. See the LICENSE file for more info.

io.altadata

ALTADATA

Versions

Version
0.1.1
0.1.0