Coscine Python SDK merge requestshttps://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests2024-03-28T16:25:31+01:00https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/19fix: Retry does not support kw allowable_methods2024-03-28T16:25:31+01:00Leon Michel Gorißenfix: Retry does not support kw allowable_methodswhen initializing the ApiClient, the Retry object does not allow for keyword allowable methodswhen initializing the ApiClient, the Retry object does not allow for keyword allowable methodshttps://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/18Draft: added graph metadata format2024-03-21T15:16:41+01:00Nicole ParksDraft: added graph metadata format@romin.benfer we worked on a little change to the sdk so that metadata formatted as a rdflib Graph object can be used, as well. This allows one to use the SDK when working with the 'nested' application profiles. It isn't quite as nice as...@romin.benfer we worked on a little change to the sdk so that metadata formatted as a rdflib Graph object can be used, as well. This allows one to use the SDK when working with the 'nested' application profiles. It isn't quite as nice as using the metadata_form.
DRAFT because I have not yet dealt with updating metadata, just with uploading files and the metadata.https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/17Update for APIv22023-11-29T13:54:32+01:00RominUpdate for APIv2https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/16Dev2023-09-01T16:16:40+02:00RominDevhttps://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/15Fixed datetime format2023-07-10T20:59:54+02:00RominFixed datetime formatThe `xsd:dateTime` format was using `xsd:date` format, which gets rejected by Coscine (because their parser sucks I assume :skull:)
Implemented proper formatting for that type to support resources with dateTime fields. Uploading metada...The `xsd:dateTime` format was using `xsd:date` format, which gets rejected by Coscine (because their parser sucks I assume :skull:)
Implemented proper formatting for that type to support resources with dateTime fields. Uploading metadata to these resources with the python client did not work before. Now it should work.https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/14Fix targetClass not contained in application profile2023-06-22T16:05:44+02:00RominFix targetClass not contained in application profile- some application profiles do not contain the targetclass property
- all application profile contain the `sh:NodeShape` property
- Therefore I replace the targetClass query with the nodeshape query in the `graph.target()` method
- Addit...- some application profiles do not contain the targetclass property
- all application profile contain the `sh:NodeShape` property
- Therefore I replace the targetClass query with the nodeshape query in the `graph.target()` method
- Additionally I've added a parameter to the `FileObject.form()` method to force the client to fetch metadata for the file whenever it creates a form for it. By default this is disabled (set to false). For some profiles the metadata served by Coscine with the resource in JSON-LD format is atm broken. So until there is a fix for that, this provides a nice and easy workaround. Just use `object.form(True)` instead of regular old `object.form()` when you are impacted by the issue.https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/13Fix metadata loading upon `Resource.objects()`2023-04-11T19:15:24+02:00Niklas SiemerFix metadata loading upon `Resource.objects()`Since https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/12 is most probably not enough, I now simply allow for the new pattern to match.Since https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/12 is most probably not enough, I now simply allow for the new pattern to match.https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/10Load metadata from coscine if not in cache2023-04-11T15:10:38+02:00Niklas SiemerLoad metadata from coscine if not in cacheCurrently, the actual metadata of a file object seems not to be loaded anywhere, except one forces it in this method. However, if the metadata is not already in the cache and I ask for it on the file object, I would expect it to be loade...Currently, the actual metadata of a file object seems not to be loaded anywhere, except one forces it in this method. However, if the metadata is not already in the cache and I ask for it on the file object, I would expect it to be loaded from coscine.
Therefore, I deleted the `return None` such that a loading is attempted.
A question on the cache:
Currently, I do not see a method to easily populate the cache with the metadata in one directory. As such, the nice `.dataframe()` method only provides a more or less empty `DataFrame` - calling the `dataframe` should ideally result in a 'get all metadata into cache and load `DataFrame` with this data' request, IMHO.https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/12Fix metadata loading upon `Resource.objects()`2023-04-03T12:00:01+02:00Niklas SiemerFix metadata loading upon `Resource.objects()`Given the discussions in https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/10 especially
https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/10#note_2097758 I ...Given the discussions in https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/10 especially
https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/10#note_2097758 I tried to get all metadata correctly into the `FileObject`s. If I saw it correctly, the items of the two dictionaries are in the correct order and can simply be `zip`ed?! If this is not the case, this MR would result in an inconsistent data-metadata-mapping.https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/11Fill dataframe with raw values2023-04-03T11:46:31+02:00Niklas SiemerFill dataframe with raw valuesThe dataframe containing the `FormValue`s cannot be easily read or operated on. Therefore, I now fill the frame with the raw values.The dataframe containing the `FormValue`s cannot be easily read or operated on. Therefore, I now fill the frame with the raw values.https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/9Add alternative TIMEFORMAT with milliseconds2023-01-02T15:26:36+01:00Robin Joscha SonnabendAdd alternative TIMEFORMAT with millisecondsSometimes, coscine returns datetimes with milliseconds at the end, like
endDate: "2022-01-17T11:24:09.297"
This tries parsing datetimes with an added "%.f" in the end if the default format fails.
If possible, it might be a better c...Sometimes, coscine returns datetimes with milliseconds at the end, like
endDate: "2022-01-17T11:24:09.297"
This tries parsing datetimes with an added "%.f" in the end if the default format fails.
If possible, it might be a better change to ensure all datetimes returned by the server have the same format.
Fixes #20https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/7Ensure deletion of Project, Resource, and FileObject2022-11-10T23:46:49+01:00Niklas SiemerEnsure deletion of Project, Resource, and FileObjectCurrently, the `delete` method on the objects is to quickly called in my opinion. Since, there is no trash bin a single false call could result in a lot of harm.
Therefore, I propose to ensure the method a bit by requiring an additional ...Currently, the `delete` method on the objects is to quickly called in my opinion. Since, there is no trash bin a single false call could result in a lot of harm.
Therefore, I propose to ensure the method a bit by requiring an additional enable parameter to be set to `True` before giving the call to the Coscine API.https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/8Use colorama.Fore.RESET to reset color in banner2022-10-29T06:26:42+02:00Robin Joscha SonnabendUse colorama.Fore.RESET to reset color in bannerThe banner printed when creating a `Client` uses colors, but doesn't reset the color at the end, coloring all subsequent output.
Use `colorama.Fore.RESET` to reset the color after the banner.
Fixes #21The banner printed when creating a `Client` uses colors, but doesn't reset the color at the end, coloring all subsequent output.
Use `colorama.Fore.RESET` to reset the color after the banner.
Fixes #21https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/6Fix input forms2022-09-16T18:54:59+02:00Niklas SiemerFix input formsRight now, the variables on the input forms are class variables, i.e. if they are modified the class itself is changed and this had severe side effects:
```python
from coscine import Client
c = Client('TOKEN')
obj = c.object('TestProje...Right now, the variables on the input forms are class variables, i.e. if they are modified the class itself is changed and this had severe side effects:
```python
from coscine import Client
c = Client('TOKEN')
obj = c.object('TestProject/aRes/s_random.dat')
obj.form()
print(obj.form())
```
results in duplication of all values!
This MR fixes thishttps://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/5Primitive unittests2022-09-09T20:40:37+02:00Niklas SiemerPrimitive unittestshttps://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/4Fix format code docs2022-08-26T16:22:43+02:00Charlie PauvertFix format code docsHi,
Just a few fixes (including a dead link) I stumbled upon when reading the tutorial. Nothing urgent!
Best,Hi,
Just a few fixes (including a dead link) I stumbled upon when reading the tutorial. Nothing urgent!
Best,https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/3Development2021-10-08T16:55:13+02:00RominDevelopmentHotfix 0.5.1
Fixed type hinting issue for Python versions < 3.9Hotfix 0.5.1
Fixed type hinting issue for Python versions < 3.9https://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/2Development2021-09-16T10:59:01+02:00RominDevelopmentMerge version 0.5.0Merge version 0.5.0RominRominhttps://git.rwth-aachen.de/coscine/community-features/coscine-python-sdk/-/merge_requests/1Draft: Resolve "Missing parentheses"2021-05-26T23:08:25+02:00Bela BrengerDraft: Resolve "Missing parentheses"Closes #1Closes #1Bela BrengerBela Brenger