Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quality-kpi
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cao, Martin
quality-kpi
Commits
31a6f6fa
Commit
31a6f6fa
authored
2 years ago
by
Richter, Manuela
Browse files
Options
Downloads
Patches
Plain Diff
start testing json data
parent
832cb913
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test_data.json
+11
-0
11 additions, 0 deletions
test_data.json
trial_json.py
+34
-0
34 additions, 0 deletions
trial_json.py
with
45 additions
and
0 deletions
test_data.json
0 → 100644
+
11
−
0
View file @
31a6f6fa
{
"KPI"
:[
{
"Name"
:
"Attribut_1"
,
"Unit"
:
"Percentage"
,
"Value"
:
43
},
{
"Name"
:
"Attribut_2"
,
"Unit"
:
"Percentage"
,
"Value"
:
56
}
]
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
trial_json.py
0 → 100644
+
34
−
0
View file @
31a6f6fa
# -*- coding: utf-8 -*-
"""
Created on Thu May 5 17:27:38 2022
@author: Richter
testfile for operating with json-files
"""
import
json
with
open
(
"
test_data.json
"
,
"
r+
"
)
as
file
:
data
=
json
.
load
(
file
)
print
(
len
(
data
))
print
(
type
(
data
))
#print(data["Name"])
a
=
data
.
keys
()
print
(
a
)
print
(
type
(
a
))
for
i
in
a
:
print
(
i
)
key
=
data
[
i
]
print
(
len
(
key
))
print
(
type
(
key
))
for
j
in
key
:
attrs
=
list
(
j
)
print
(
len
(
attrs
))
print
(
type
(
attrs
))
print
(
attrs
)
print
(
j
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment