FairDataPoint#
- class fdp.fairdatapoint.FairDataPoint(url: str = 'http://127.0.0.1', token: str = None)#
Bases:
objectClass representing a Fair Data Point.
- property rest_operator: str#
The rest_operator.
- property url: str#
The url of the Fair Data Point.
- find_catalogs() dict#
Retrieves all the catalogs belonging to the Fair Data Point.
- Returns:
a dictionary
`{uuid: Catalog}`- Return type:
dict with str keys and Catalog class values
- get(path: str, uuid: str = None, **kwargs)#
Retrieve an item from the Fair Data Point.
- Parameters:
path (str) – the path to access
uuid – the uuid of the item to retrieve.
kwargs – custom arguments
Note
passing draft=True as kwargs result in the retrieve of items in draft state instead of the published ones.
- Returns:
the response of the Fair Data Point server.
- Return type:
dict, see the rest module’s get function.
- create(path: str, payload: str, headers: dict | None, **kwargs)#
Create a new item to the Fair Data Point.
- Parameters:
path (dict) – the path to access
payload – the content to update
headers – the headers for the update
kwargs (* *) – custom arguments
- Returns:
the response of the Fair Data Point server.
- Return type:
dict, see the rest module’s post function.
- update(path: str, uuid: str, payload: str, headers: dict, **kwargs)#
Update an item in the Fair Data Point.
- Parameters:
path (dict) – the path to access
uuid – the uuid of the item to retrieve.
payload – the content to update
headers – the headers for the update
- Returns:
the response of the Fair Data Point server.
- Return type:
dict, see the rest module’s put function.
- delete(fairdatapointitem)#
Deletes an instance of a Fair Data Point Item or of a derived class from the Fair data Point.
- Parameters:
fairdatapointitem (FairDataPointItem or derived class) – the item to delete
- Raises:
NotPresentError – if the item is not present in the Fair Data Point
- property finder: FairDataPointFinder#