![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
The tvb-rest-client
is a helper package built with the intention to simplify a
Python client interaction with TVB REST Server.
All the logic necessary to prepare and send requests towards the REST server, is embedded under this client API.
GET requests are sent from this python client using the requests library.
For the POST requests, a client has to attach a file with some input configuration.
Such a file is usually an H5 in TVB specific format.
Thus, tvb-rest-client
has all the logic for preparing those H5 files and sending requests.
Also, the REST server uses a Keycloak client at log in time, so this client will open a browser that allows the user to
log in, before attempting to make the requests.
You should have a TVB REST server running, or access to a public one.
Then into tvb-rest-client
you need to provide the URL towards this TVB REST server.
For the following example, we will suppose TVB REST server runs on http://localhost:9090
To launch a TVB REST server locally, you should download tvb-framework
version >2.0. and launch it::
$ python -m tvb.interfaces.rest.server.run # Launch TVB REST server locally
If the TVB REST server you want to access runs at another address, change the parameter in the bellow TVBClient instantiation.
.. code-block:: python
from tvb.interfaces.rest.client.tvb_client import TVBClient
tvb_client = TVBClient("http://localhost:9090")
..
Attempt to login and start using the client API to send requests, by calling different types of methods:
.. code-block:: python
tvb_client.browser_login()
list_of_user_projects = tvb_client.get_project_list()
list_of_datatypes_in_project = tvb_client.get_data_in_project(list_of_user_projects[0].gid)
list_of_operations_for_datatype = tvb_client.get_operations_for_datatype(list_of_datatypes_in_project[0].gid)
..
.. code-block:: python
datatype_path = tvb_client.retrieve_datatype(list_of_datatypes_in_project[0].gid, download_folder)
..
.. code-block:: python
datatype = tvb_client.load_datatype_from_file(datatype_path)
..
methods that launch operations in the TVB server Such an operation requires the client to prepare the operation configuration and send it in an H5 file together with the requests.
By using the client API, the user only needs to instantiate the proper Model class and send it as argument to the following method. It wraps the serialization of the Model inside the H5 and the attaching to the POST request.
The example above launches a Fourier analyzer, we suppose the Fourier AlgorithmDTO is list_of_operations_for_datatype[0].
.. code-block:: python
from tvb.adapters.analyzers.fourier_adapter import FFTAdapterModel, FourierAdapter
project_gid = list_of_user_projects[0].gid
model = FFTAdapterModel()
# logic to fill the model with required attributes
operation_gid = tvb_client.launch_operation(project_gid, FourierAdapter, model)
..
.. code-block:: python
monitor_operation(tvb_client, operation_gid)
..
This project has received funding from the European Union’s Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreement Nos. 785907 (Human Brain Project SGA2), 945539 (Human Brain Project SGA3) and VirtualBrainCloud 826421.
FAQs
A helper package for preparing and sending requests towards the TVB REST API
We found that tvb-rest-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.