sricharan-dev-package 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dev/__init__.py ADDED
@@ -0,0 +1,32 @@
1
+ import os
2
+
3
+ def show_all_content():
4
+ package_path = os.path.dirname(__file__)
5
+
6
+ files = [
7
+ "run1.py",
8
+ "run2.py",
9
+ "run3.py",
10
+ "run4.py",
11
+ "run5.py",
12
+ "run6.py",
13
+ "run7.py"
14
+ ]
15
+
16
+ for file in files:
17
+ print("\n==========", file, "==========")
18
+
19
+ file_path = os.path.join(package_path, file)
20
+
21
+ with open(file_path, "r") as f:
22
+ content = f.read()
23
+ print(content)
24
+
25
+
26
+ from . import run1
27
+ from . import run2
28
+ from . import run3
29
+ from . import run4
30
+ from . import run5
31
+ from . import run6
32
+ from . import run7
dev/run1.py ADDED
@@ -0,0 +1,12 @@
1
+ git --version
2
+ git config --global user.name "YourName"
3
+ git config --global user.email "youremail@gmail.com"
4
+ Open repository in browser → Click Fork
5
+ cd desktop
6
+ git clone https://github.com/your-username/sample-project.git
7
+ cd sample-project
8
+ git status
9
+ echo Hello GitHub > demo.txt
10
+ git add .
11
+ git commit -m "Added demo file"
12
+ git push origin main
dev/run2.py ADDED
@@ -0,0 +1,23 @@
1
+ cd ~/desktop
2
+
3
+ git clone https://github.com/your-username/website-project.git
4
+
5
+ cd website-project
6
+
7
+ echo "<h1>My Website</h1>" > index.html
8
+
9
+ cat index.html
10
+
11
+ git status
12
+ git add .
13
+ git commit -m "Added website files"
14
+ git push origin main
15
+
16
+ code .
17
+
18
+ git status
19
+ git add .
20
+ git commit -m "Updated website"
21
+ git push
22
+
23
+ git pull origin main
dev/run3.py ADDED
@@ -0,0 +1,47 @@
1
+ docker --version
2
+ docker info
3
+ docker ps
4
+ docker ps -a
5
+ docker images
6
+ docker pull ubuntu
7
+ docker run -it ubuntu
8
+ ls
9
+ exit
10
+ docker pull alpine
11
+ docker run -it alpine
12
+ ls
13
+ exit
14
+ docker pull debian
15
+ docker pull fedora
16
+ mkdir python-docker-app
17
+ cd python-docker-app
18
+
19
+
20
+ notepad app.py
21
+
22
+ from flask import Flask
23
+
24
+ app = Flask(__name__)
25
+
26
+ @app.route('/')
27
+ def home():
28
+ return "Hello from Docker Flask App!"
29
+
30
+ if __name__ == '__main__':
31
+ app.run(host='0.0.0.0', port=5000)
32
+
33
+ notepad Dockerfile
34
+
35
+ FROM python:3.8-slim
36
+ WORKDIR /app
37
+ COPY app.py .
38
+ RUN pip install flask
39
+ EXPOSE 5000
40
+ CMD ["python", "app.py"]
41
+
42
+ ren Dockerfile.txt Dockerfile
43
+ docker build -t python-flask-app . OR docker build --nocache -t python-flask-app .
44
+ docker run -p 5000:5000 python-flask-app
45
+
46
+ docker pull sricharan216/python-flask-app
47
+ docker run -p 5000:5000 sricharan216/python-flask-app
dev/run4.py ADDED
@@ -0,0 +1,122 @@
1
+ docker-compose --version
2
+ mkdir microservices-lab
3
+ cd microservices-lab
4
+ mkdir backend
5
+ cd backend
6
+
7
+ BACKEND
8
+
9
+
10
+ notepad app.py
11
+
12
+ from flask import Flask
13
+
14
+ app = Flask(__name__)
15
+
16
+ @app.route('/')
17
+ def hello_world():
18
+ return 'Hello, World! From Backend!'
19
+
20
+ if __name__ == '__main__':
21
+ app.run(host='0.0.0.0', port=5000)
22
+
23
+
24
+ notepad Dockerfile
25
+
26
+ FROM python:3.9-slim
27
+
28
+ WORKDIR /app
29
+
30
+ COPY requirements.txt /app/
31
+
32
+ RUN pip install --no-cache-dir -r requirements.txt
33
+
34
+ COPY . /app/
35
+
36
+ EXPOSE 5000
37
+
38
+ CMD ["python", "app.py"]
39
+
40
+
41
+ notepad requirements.txt
42
+
43
+ Flask==2.1.1
44
+ Werkzeug==2.0.3
45
+
46
+ -------------------------------
47
+ CD ..
48
+ -------------------------------
49
+
50
+ mkdir frontend
51
+ cd frontend
52
+
53
+ FRONTEND
54
+
55
+
56
+ notepad app.py
57
+
58
+ from flask import Flask
59
+ import requests
60
+
61
+ app = Flask(__name__)
62
+
63
+ @app.route('/')
64
+ def hello_world():
65
+ response = requests.get('http://backend:5000')
66
+ return f"Frontend says: {response.text}"
67
+
68
+ if __name__ == '__main__':
69
+ app.run(host='0.0.0.0', port=5001)
70
+
71
+
72
+ notepad Dockerfile
73
+
74
+ FROM python:3.9-slim
75
+ WORKDIR /app
76
+ COPY requirements.txt /app/
77
+ RUN pip install --no-cache-dir -r requirements.txt
78
+ COPY . /app/
79
+ EXPOSE 5001
80
+ CMD ["python", "app.py"]
81
+
82
+
83
+ notepad requirements.txt
84
+
85
+ Flask==2.1.1
86
+ Werkzeug==2.0.3
87
+ requests==2.26.0
88
+
89
+ -------------------------------
90
+ CD ..
91
+ -------------------------------
92
+
93
+ DOCKER-COMPOSE.YML
94
+
95
+ version: '3.8'
96
+
97
+ services:
98
+ backend:
99
+ build:
100
+ context: ./backend
101
+ ports:
102
+ - "5000:5000"
103
+ networks:
104
+ - app-network
105
+
106
+ frontend:
107
+ build:
108
+ context: ./frontend
109
+ ports:
110
+ - "5001:5001"
111
+ depends_on:
112
+ - backend
113
+ networks:
114
+ - app-network
115
+
116
+ networks:
117
+ app-network:
118
+ driver: bridge
119
+
120
+ docker compose up --build
121
+ http://localhost:5001
122
+ http://localhost:5000
dev/run5.py ADDED
@@ -0,0 +1,157 @@
1
+ java --version
2
+ 8081
3
+ http://localhost:8081
4
+ C:\ProgramData\Jenkins\.jenkins\secrets\initialAdminPassword
5
+ type "C:\ProgramData\Jenkins\.jenkins\secrets\initialAdminPassword"
6
+ Install suggested plugins
7
+ Jenkins URL --> Keep URL as --> http://localhost:8081/
8
+
9
+ Start using Jenkins
10
+ Create Simple Pipeline Job --> Click New Item, Enter item name : FirstPipeline
11
+ Select Pipeline.
12
+ Click OK.
13
+
14
+ Add Pipeline Script
15
+ pipeline {
16
+ agent any
17
+ stages {
18
+ stage('Hello') {
19
+ steps {
20
+ echo 'Hello from Jenkins Pipeline'
21
+ }
22
+ }
23
+ }
24
+ }
25
+
26
+ Run Pipeline --> Click --> Build Now
27
+
28
+
29
+
30
+ :: ===== PROGRAM 5 : INSTALL JENKINS AND CONFIGURE FOR FIRST USE =====
31
+
32
+ :: STEP 1 — Check Java Installation
33
+ java --version
34
+
35
+ :: If Java is not installed, install JDK first.
36
+
37
+
38
+ :: STEP 2 — Download Jenkins
39
+
40
+ :: Open Browser
41
+ :: Go to Jenkins download page
42
+ :: Download Windows .msi installer
43
+ :: Run installer
44
+
45
+
46
+ :: STEP 3 — Install Jenkins
47
+
48
+ :: Click Next
49
+ :: Select installation folder
50
+ :: Run service as: LocalSystem
51
+
52
+ Port: 8081
53
+
54
+ :: Test Port
55
+ :: Continue Installation
56
+ :: Finish Installation
57
+
58
+
59
+ :: STEP 4 — Open Jenkins
60
+
61
+ http://localhost:8081
62
+
63
+
64
+ :: STEP 5 — Get Initial Admin Password
65
+
66
+ :: Open File Explorer
67
+
68
+ C:\ProgramData\Jenkins\.jenkins\secrets\initialAdminPassword
69
+
70
+ :: OR use CMD as Administrator:
71
+
72
+ type "C:\ProgramData\Jenkins\.jenkins\secrets\initialAdminPassword"
73
+
74
+
75
+ :: STEP 6 — Unlock Jenkins
76
+
77
+ :: Paste password into Jenkins page
78
+ :: Click Continue
79
+
80
+
81
+ :: STEP 7 — Install Plugins
82
+
83
+ :: Click:
84
+ Install suggested plugins
85
+
86
+ :: Wait for installation to complete
87
+
88
+
89
+ :: STEP 8 — Create Admin User
90
+
91
+ Username: admin
92
+ Password: <your password>
93
+ Full Name: <your name>
94
+ Email: <your email>
95
+
96
+ :: Click Save and Continue
97
+
98
+
99
+ :: STEP 9 — Jenkins URL
100
+
101
+ http://localhost:8081/
102
+
103
+ :: Click Save and Finish
104
+
105
+
106
+ :: STEP 10 — Start Jenkins
107
+
108
+ :: Click:
109
+ Start using Jenkins
110
+
111
+
112
+ :: STEP 11 — Create Pipeline Job
113
+
114
+ :: Jenkins → New Item
115
+
116
+ Item Name: FirstPipeline
117
+
118
+ :: Select:
119
+ Pipeline
120
+
121
+ :: Click OK
122
+
123
+
124
+ :: STEP 12 — Add Pipeline Script
125
+
126
+ pipeline {
127
+ agent any
128
+
129
+ stages {
130
+
131
+ stage('Hello') {
132
+ steps {
133
+ echo 'Hello from Jenkins Pipeline'
134
+ }
135
+ }
136
+
137
+ }
138
+ }
139
+
140
+ :: Click Save
141
+
142
+
143
+ :: STEP 13 — Run Pipeline
144
+
145
+ :: Click:
146
+ Build Now
147
+
148
+
149
+ :: STEP 14 — Check Output
150
+
151
+ :: Click Build Number
152
+ :: Click Console Output
153
+
154
+ :: Expected Output:
155
+
156
+ Hello from Jenkins Pipeline
157
+ Finished: SUCCESS
dev/run6.py ADDED
@@ -0,0 +1,167 @@
1
+ :: ===== PROGRAM 6 : INSTALL & CONFIGURE SONARQUBE + JENKINS PIPELINE =====
2
+
3
+ :: STEP 1 — Start Docker Desktop
4
+ :: Open Docker Desktop and wait until it starts.
5
+
6
+ :: STEP 2 — Run SonarQube Container
7
+ docker run -d --name sonar -p 9000:9000 sonarqube:lts-community
8
+
9
+ :: If container already exists
10
+ docker start sonar
11
+
12
+ :: STEP 3 — Open SonarQube
13
+ :: Browser:
14
+ http://localhost:9000
15
+
16
+ :: Default Login
17
+ Username: admin
18
+ Password: admin
19
+
20
+ :: Set new password if prompted.
21
+
22
+
23
+ :: STEP 4 — Install SonarQube Scanner Plugin in Jenkins
24
+
25
+ :: Open Jenkins
26
+ http://localhost:8081
27
+
28
+ :: Manage Jenkins → Plugins
29
+ :: Search: SonarQube Scanner
30
+ :: Install Plugin
31
+ :: Restart Jenkins if asked.
32
+
33
+
34
+ :: STEP 5 — Add SonarQube Scanner Tool in Jenkins
35
+
36
+ :: Manage Jenkins → Tools
37
+ :: Find SonarQube Scanner
38
+ :: Add SonarQube Scanner
39
+
40
+ :: Configure:
41
+ Name: sonar
42
+ Install automatically: ✓
43
+
44
+ :: Save
45
+
46
+
47
+ :: STEP 6 — Generate Token in SonarQube
48
+
49
+ :: Open SonarQube
50
+ :: User Profile → My Account → Security
51
+
52
+ :: Generate Token
53
+
54
+ Token Name: jenkins-token
55
+ Token Type: User Token
56
+
57
+ :: Generate and copy token.
58
+
59
+
60
+ :: STEP 7 — Add Token in Jenkins Credentials
61
+
62
+ :: Open Jenkins
63
+ :: Manage Jenkins → Credentials
64
+ :: System → Global Credentials → Add Credentials
65
+
66
+ Kind: Secret text
67
+ Secret: <Paste SonarQube Token>
68
+
69
+ ID: sonar-token
70
+ Description: SonarQube Token
71
+
72
+ :: Click Create
73
+
74
+
75
+ :: STEP 8 — Configure SonarQube Server in Jenkins
76
+
77
+ :: Manage Jenkins → System
78
+ :: Find SonarQube Servers
79
+
80
+ Environment Variables: ✓
81
+
82
+ Add SonarQube
83
+
84
+ Name: sonar
85
+ Server URL: http://localhost:9000
86
+ Server Authentication Token: sonar-token
87
+
88
+ :: Save
89
+
90
+
91
+ :: STEP 9 — Create Python File
92
+
93
+ notepad "C:\Users\Asus\OneDrive\Desktop\Helloworld.py"
94
+
95
+ :: Paste:
96
+
97
+ print("Hello World")
98
+
99
+ :: Save and close.
100
+
101
+
102
+ :: STEP 10 — Create Jenkins Pipeline Job
103
+
104
+ :: Open Jenkins
105
+ :: New Item
106
+
107
+ Name: DO-P4
108
+
109
+ :: Select:
110
+ Pipeline
111
+
112
+ :: Click OK
113
+
114
+
115
+ :: STEP 11 — Paste Pipeline Script
116
+
117
+ pipeline {
118
+ agent any
119
+
120
+ stages {
121
+
122
+ stage('Copy File') {
123
+ steps {
124
+ bat 'copy "C:\\Users\\Asus\\OneDrive\\Desktop\\Helloworld.py" .'
125
+ }
126
+ }
127
+
128
+ stage('SonarQube Analysis') {
129
+ steps {
130
+ script {
131
+ def scannerHome = tool 'sonar'
132
+
133
+ withSonarQubeEnv('sonar') {
134
+
135
+ bat "${scannerHome}\\bin\\sonar-scanner.bat -Dsonar.projectKey=PythonDemo -Dsonar.sources=."
136
+
137
+ }
138
+ }
139
+ }
140
+ }
141
+
142
+ }
143
+ }
144
+
145
+ :: Click Save
146
+
147
+
148
+ :: STEP 12 — Run Pipeline
149
+
150
+ :: Click:
151
+ Build Now
152
+
153
+
154
+ :: STEP 13 — Check Console Output
155
+
156
+ :: Click Build Number
157
+ :: Click Console Output
158
+ :: Verify successful build.
159
+
160
+
161
+ :: STEP 14 — Open SonarQube Report
162
+
163
+ :: Browser:
164
+ http://localhost:9000
165
+
166
+ :: Check Project:
167
+ PythonDemo
dev/run7.py ADDED
@@ -0,0 +1,216 @@
1
+ :: ===== PROGRAM 7 : MAVEN + GRADLE INSTALLATION & SETUP =====
2
+
3
+ :: PART A — MAVEN
4
+
5
+ :: Check Java Installation
6
+ java -version
7
+
8
+ :: Set Maven Environment Variables (Run CMD as Administrator)
9
+ setx MAVEN_HOME "C:\Program Files\Apache\apache-maven-3.9.16" /M
10
+ setx PATH "%PATH%;C:\Program Files\Apache\apache-maven-3.9.16\bin" /M
11
+
12
+ :: Close and reopen CMD
13
+
14
+ :: Verify Maven
15
+ mvn -v
16
+
17
+ :: Create Maven Project
18
+ mvn archetype:generate -DgroupId=com.example -DartifactId=demo-demo -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
19
+
20
+ :: Enter Project
21
+ cd demo-demo
22
+
23
+ :: Check Files
24
+ dir
25
+
26
+ :: Build Maven Project
27
+ mvn clean package
28
+
29
+ :: Check Build Output
30
+ dir target
31
+
32
+
33
+ :: PART B — GRADLE
34
+
35
+ :: Set Gradle Environment Variables (Run CMD as Administrator)
36
+ setx GRADLE_HOME "C:\Program Files\Gradle\gradle-8.5.1" /M
37
+ setx PATH "%PATH%;C:\Program Files\Gradle\gradle-8.5.1\bin" /M
38
+
39
+ :: Close and reopen CMD
40
+
41
+ :: Verify Gradle
42
+ gradle -v
43
+
44
+ :: Alternative verification if needed
45
+ "C:\Program Files\Gradle\gradle-8.5.1\bin\gradle.bat" -v
46
+
47
+ :: Create Gradle Project
48
+ mkdir gradle-demo
49
+ cd gradle-demo
50
+
51
+ :: Initialize Gradle Java Application
52
+ gradle init --type java-application
53
+
54
+ :: Choose:
55
+ :: Build script DSL: Groovy
56
+ :: Test framework: JUnit Jupiter
57
+ :: Project name: gradle-demo
58
+ :: Source package: com.example
59
+
60
+ :: Build Gradle Project
61
+ gradle build
62
+
63
+ :: Run Gradle Application (Optional)
64
+ gradle run
65
+
66
+ -------------------------------------------------------------------------------------------------------------------
67
+ Program 8
68
+ -------------------------------------------------------------------------------------------------------------------
69
+
70
+ java -version
71
+ mvn archetype:generate -DgroupId=com.example -DartifactId=demo-project -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
72
+ cd demo-project
73
+ dir
74
+
75
+ POM.XML
76
+
77
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
78
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
79
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
80
+ http://maven.apache.org/maven-v4_0_0.xsd">
81
+
82
+ <modelVersion>4.0.0</modelVersion>
83
+
84
+ <groupId>com.example</groupId>
85
+ <artifactId>demo-project</artifactId>
86
+ <packaging>jar</packaging>
87
+ <version>1.0-SNAPSHOT</version>
88
+ <name>demo-project</name>
89
+ <url>http://maven.apache.org</url>
90
+
91
+ <dependencies>
92
+
93
+ <dependency>
94
+ <groupId>junit</groupId>
95
+ <artifactId>junit</artifactId>
96
+ <version>3.8.1</version>
97
+ <scope>test</scope>
98
+ </dependency>
99
+
100
+ <dependency>
101
+ <groupId>com.google.code.gson</groupId>
102
+ <artifactId>gson</artifactId>
103
+ <version>2.10.1</version>
104
+ </dependency>
105
+
106
+ </dependencies>
107
+
108
+ <build>
109
+ <plugins>
110
+ <plugin>
111
+ <groupId>org.apache.maven.plugins</groupId>
112
+ <artifactId>maven-shade-plugin</artifactId>
113
+ <version>3.5.0</version>
114
+
115
+ <executions>
116
+ <execution>
117
+ <phase>package</phase>
118
+ <goals>
119
+ <goal>shade</goal>
120
+ </goals>
121
+
122
+ <configuration>
123
+ <transformers>
124
+ <transformer
125
+ implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
126
+ <mainClass>com.example.App</mainClass>
127
+ </transformer>
128
+ </transformers>
129
+ </configuration>
130
+
131
+ </execution>
132
+ </executions>
133
+
134
+ </plugin>
135
+ </plugins>
136
+ </build>
137
+
138
+ </project>
139
+
140
+ APP.JAVA
141
+
142
+ package com.example;
143
+
144
+ import com.google.gson.Gson;
145
+
146
+ public class App {
147
+ public static void main(String[] args) {
148
+
149
+ Gson gson = new Gson();
150
+
151
+ Student student = new Student("Sricharan", 21);
152
+
153
+ String json = gson.toJson(student);
154
+
155
+ System.out.println(json);
156
+ }
157
+ }
158
+
159
+ class Student {
160
+
161
+ String name;
162
+ int age;
163
+
164
+ Student(String name, int age) {
165
+ this.name = name;
166
+ this.age = age;
167
+ }
168
+ }
169
+
170
+ mvn compile
171
+ mvn test
172
+ mvn package
173
+ mvn clean package
174
+ dir target
175
+ java -jar target\demo-project-1.0-SNAPSHOT.jar
176
+
177
+ -------------------------------------------------------------------------------------------------------------------
178
+ Program 9
179
+ -------------------------------------------------------------------------------------------------------------------
180
+
181
+ cd C:\Users\asus\demo-project
182
+ dir
183
+ del pom.xml
184
+ rmdir /s /q target
185
+ notepad build.gradle
186
+
187
+ plugins {
188
+ id 'java'
189
+ id 'application'
190
+ }
191
+
192
+ group = 'com.example'
193
+ version = '1.0-SNAPSHOT'
194
+
195
+ repositories {
196
+ mavenCentral()
197
+ }
198
+
199
+ dependencies {
200
+ implementation 'com.google.code.gson:gson:2.10.1'
201
+ testImplementation 'junit:junit:4.13.2'
202
+ }
203
+
204
+ application {
205
+ mainClass = 'com.example.App'
206
+ }
207
+
208
+ notepad settings.gradle
209
+
210
+ rootProject.name = 'demo-project'
211
+
212
+ dir
213
+ gradle build
214
+ gradle test
215
+ gradle run
216
+ java -cp build\libs\demo-project-1.0-SNAPSHOT.jar com.example.App
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.4
2
+ Name: sricharan-dev-package
3
+ Version: 1.0.0
4
+ Summary: My first Python package
5
+ Author: Sricharan
6
+ Author-email: your_email@gmail.com
7
+ Requires-Python: >=3.8
8
+ Dynamic: author
9
+ Dynamic: author-email
10
+ Dynamic: requires-python
11
+ Dynamic: summary
@@ -0,0 +1,12 @@
1
+ dev/__init__.py,sha256=LqxiDPrKal7JqFsAn3C_LxqJAYBa0W0BUKXgskcdza0,625
2
+ dev/run1.py,sha256=LMl1eGIayosCUl2kKumptY7j5ZvlWeeZt_3IxTatJaE,356
3
+ dev/run2.py,sha256=XdjXOzqENaVV3ehn3GcwKhkGvGiQujrXzsZ7ioHE5hc,349
4
+ dev/run3.py,sha256=8oVO1f4Hgfv6iGD7Y4irUfk4P3uV6-vdVdcQjybEbJs,887
5
+ dev/run4.py,sha256=5IbU8_hHgkUXa2_cnVhy2bghDX7ASHvvoAzSuV3m9Gk,1824
6
+ dev/run5.py,sha256=CEjl1qNDFzAtNheq-9QRfW36Q89g5JOMpWzfIt3PcAo,2556
7
+ dev/run6.py,sha256=VttkUsoFnPTPGub0yQTTMeKRreR7G8zDLOKek0JoCZk,2913
8
+ dev/run7.py,sha256=ysibra6Us9Om8DIsdZeCB9bPHOUN0lHLM1Ii5klchn4,5297
9
+ sricharan_dev_package-1.0.0.dist-info/METADATA,sha256=0mi3ydnrThZeLbqTvLV6oYvbEfM6HwLwaMMB1Xw5Lpg,265
10
+ sricharan_dev_package-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
11
+ sricharan_dev_package-1.0.0.dist-info/top_level.txt,sha256=nFlV_JmmC49t7mz1gsRCDZHhs-KiAfUyyR4svfzn-lE,4
12
+ sricharan_dev_package-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+