-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.py
executable file
·38 lines (26 loc) · 1.11 KB
/
example.py
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
36
37
#!/usr/bin/env python
import os
import sys
pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # noqa
sys.path.insert(0, pkg_root) # noqa
from jsongen.hca_generator import HCAJsonGenerator
schema_urls = [
"https://raw.githubusercontent.com/HumanCellAtlas/metadata-schema/4.6.0/json_schema/analysis_bundle.json",
"https://raw.githubusercontent.com/HumanCellAtlas/metadata-schema/4.6.0/json_schema/assay_bundle.json",
"https://raw.githubusercontent.com/HumanCellAtlas/metadata-schema/4.6.0/json_schema/project_bundle.json",
"https://schema.humancellatlas.org/bundle/5.1.0/project",
"https://schema.humancellatlas.org/bundle/5.1.0/submission",
"https://schema.humancellatlas.org/bundle/5.1.0/ingest_audit",
]
faker = HCAJsonGenerator(schema_urls)
for name in faker.schemas.keys():
fake_json = faker.generate(name)
from jsongen.generator import JsonGenerator
schema_analysis={
"analysis_id": {
"type": "string",
"description": "A unique ID for this analysis."
}
}
json_gen = JsonGenerator()
generated_json = json_gen.generate_json(schema_analysis)