Sathwikchowdary commited on
Commit
6a34ea2
·
verified ·
1 Parent(s): 7c1bbe7

Update pages/Info_of_Json.py

Browse files
Files changed (1) hide show
  1. pages/Info_of_Json.py +84 -0
pages/Info_of_Json.py CHANGED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import numpy as np
4
+
5
+ # Custom CSS for styling
6
+ custom_css = """
7
+ <style>
8
+ html, body, [data-testid="stAppViewContainer"] {
9
+ background-image: linear-gradient(
10
+ rgba(0, 0, 0, 0.6),
11
+ rgba(0, 0, 0, 0.6)
12
+ ),
13
+ url("https://www.istockphoto.com/photo/tech-or-space-background-abstract-3d-illustration-gm1367865109-437999705?utm_source=pixabay&utm_medium=affiliate&utm_campaign=SRP_photo_sponsored&utm_content=https%3A%2F%2Fpixabay.com%2Fphotos%2Fsearch%2Fbackground%2520datascience%2F&utm_term=background+datascience.jpg");
14
+ background-size: cover;
15
+ background-position: center;
16
+ background-repeat: no-repeat;
17
+ background-attachment: fixed;
18
+ color: white; /* Ensures all text is readable */
19
+ }
20
+ h2, h3 {
21
+ color: #FFD700; /* Gold color for headings */
22
+ }
23
+ p {
24
+ color: #FFFFFF; /* White text for paragraphs */
25
+ }
26
+ </style>
27
+ """
28
+
29
+ # Inject the CSS into the app
30
+ st.markdown(custom_css, unsafe_allow_html=True)
31
+ st.markdown("<h2 style='text-align: left; color: Black;'>📈What is JavaScript Object Notation (JSON)</h2>", unsafe_allow_html=True)
32
+ st.markdown(
33
+ "<p style='font-size: 16px; color: White; font-style: italic;'>"
34
+ "JSON (JavaScript Object Notation) is a simple and lightweight format for exchanging data. It is human-readable, easy to write, and efficiently parsed and generated by machines. Due to its straightforward structure and versatility, JSON is commonly used in web applications to transfer data between servers and clients. It organizes data in the form of key-value pairs, arrays, and nested structures."
35
+ "</p>",
36
+ unsafe_allow_html=True
37
+ )
38
+ st.markdown(
39
+ "<p style='font-size: 16px; color: White; font-style: italic;'>"
40
+ "The default structure of JSON is similar to a dictionary, where keys must always be strings when creating a JSON file. In a JSON file, the keys serve as column names, while the values represent the corresponding column data."
41
+ "</p>",
42
+ unsafe_allow_html=True
43
+ )
44
+ st.markdown("<h3 style='text-align: left; color: Black;'>Orientation</h3>", unsafe_allow_html=True)
45
+ st.markdown(
46
+ "<p style='font-size: 16px; color: White; font-style: italic;'>"
47
+ " JSON supports various orientations, which provide different structural formats. There are four primary types of JSON formats, each serving specific use cases."
48
+ "</p>",
49
+ unsafe_allow_html=True
50
+ )
51
+ st.markdown("1.Index Orientation")
52
+ st.markdown("2.Column Orientation")
53
+ st.markdown("3.Values Orientation")
54
+ st.markdown("4.Split Orientation")
55
+ st.markdown("<h3 style='text-align: left; color: Black;'> Index Orientation</h3>", unsafe_allow_html=True)
56
+ st.markdown(
57
+ "<p style='font-size: 16px; color: White; font-style: italic;'>"
58
+ "In JSON, index orientation organizes data so that the dictionary keys function as index labels, while the values represent individual rows of data. This format is commonly used to store tabular data in a structured way, with the index acting as a unique identifier for each row."
59
+ "</p>",
60
+ unsafe_allow_html=True
61
+ )
62
+ st.markdown("<h3 style='text-align: left; color: Black;'> Column Orientation</h3>", unsafe_allow_html=True)
63
+ st.markdown(
64
+ "<p style='font-size: 16px; color: White; font-style: italic;'>"
65
+ "In this format, keys represent column names, and the corresponding values are arrays containing all the data for each column. This orientation is ideal for representing tabular data in a columnar format."
66
+ "</p>",
67
+ unsafe_allow_html=True
68
+ )
69
+ st.markdown("<h3 style='text-align: left; color: Black;'> Values Orientation</h3>", unsafe_allow_html=True)
70
+ st.markdown(
71
+ "<p style='font-size: 16px; color: White; font-style: italic;'>"
72
+ "In this orientation, each record is represented as a list of values, and the order of values matches the order of column names provided separately."
73
+ "</p>",
74
+ unsafe_allow_html=True
75
+ )
76
+ st.markdown("<h3 style='text-align: left; color: Black;'> Split Orientation</h3>", unsafe_allow_html=True)
77
+ st.markdown(
78
+ "<p style='font-size: 16px; color: White; font-style: italic;'>"
79
+ "This format splits the data into three components: index, columns, and data. It provides a complete representation of tabular data with structure."
80
+ "</p>",
81
+ unsafe_allow_html=True
82
+ )
83
+
84
+