-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathmetadata.py
More file actions
35 lines (29 loc) · 1.05 KB
/
metadata.py
File metadata and controls
35 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from __future__ import annotations
from typing import TYPE_CHECKING
from uuid import uuid4
from dandischema.conf import get_instance_config
if TYPE_CHECKING:
import datetime
class PublishableMetadataMixin:
@classmethod
def published_by(cls, now: datetime.datetime):
schema_config = get_instance_config()
return {
'id': uuid4().urn,
'name': 'DANDI publish',
'startDate': now.isoformat(),
# TODO: https://github.com/dandi/dandi-api/issues/465
# endDate needs to be defined before publish is complete
'endDate': now.isoformat(),
'wasAssociatedWith': [
{
'id': uuid4().urn,
'identifier': schema_config.instance_identifier,
'name': f'{schema_config.instance_name} API',
# TODO: version the API
'version': '0.1.0',
'schemaKey': 'Software',
}
],
'schemaKey': 'PublishActivity',
}