Work in progress

bentonitedata.com

The #1 collection of bentonite THCMG data.

Python API

The data in bentonitedata.com is accessible using a Python API that can be downloaded here.

In order to use the API, place the bentonitedata.py file into the same folder with your own code, and import it. The API is very simple. Usage is demonstrated in an example .py file included in the .zip, and also shown below.


import bentonitedata


# Find a list of identifiers of all the available experiments.
ids = bentonitedata.get_id_list()

print(f"Received {len(ids)} experiment identifiers.")
print(f"The first one is {ids[0]}")



# Download all data of one experiment as dictionary.
id = ids[0]
exp_data = bentonitedata.get_experiment(id)

print(f"This experiment was performed by {exp_data['contact']['name']}")
print(f"The name of the first result is {exp_data['results'][0]['name']}")
x_vals = exp_data['results'][0]['x']['values']
print(f"and the range of x-values is from {x_vals[0]} to {x_vals[-1]}.")

The output is


$ python3 bentonitedata_examples.py 
Received 31 experiment identifiers.
The first one is JyU_E10R1
This experiment was performed by Joni Tanttu
The name of the first result is Layer positions
and the range of x-values is from -0.44444 to 387.31250.

HTTP REST API

The data in bentonitedata.com is accessible in JSON format through simple HTTP REST queries.

The data is identified through experiment ID numbers that are listed in the Browse page. A list of valid experiment ID numbers can also be queried by HTTP GET request to https://www.bentonitedata.com/list. The return value is a JSON formatted list of experiment IDs.

JSON formatted data corresponding to a specific experiment ID can be retrieved by HTTP GET query to https://www.bentonitedata.com/data/[ID], where [ID] must be replaced by a valid experiment ID.

HTTP GET queries can be made, e.g., with web browsers by pointing address to the URIs given above, or using command line tools such as wget or curl that are installed by default on most Linux computers.