veejas 0.1.0__tar.gz

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.
veejas-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.4
2
+ Name: veejas
3
+ Version: 0.1.0
4
+ Summary: A terminal menu for browsing programming examples
5
+ Requires-Python: >=3.9
6
+ Description-Content-Type: text/markdown
7
+
8
+
9
+
10
+ \# veejas
11
+
12
+
13
+
14
+ A terminal menu for browsing programming examples.
15
+
16
+
17
+
18
+ \## Installation
19
+
20
+
21
+
22
+ ```bash
23
+
24
+ pip install veejas
25
+
26
+ ```
27
+
28
+
29
+
30
+ \## Usage
31
+
32
+
33
+
34
+ ```bash
35
+
36
+ veejas
37
+
38
+ ```
39
+
40
+
41
+
42
+ Choose a program to display its contents.
43
+
44
+ Enter 0 to exit.
45
+
46
+
47
+
veejas-0.1.0/README.md ADDED
@@ -0,0 +1,40 @@
1
+
2
+
3
+ \# veejas
4
+
5
+
6
+
7
+ A terminal menu for browsing programming examples.
8
+
9
+
10
+
11
+ \## Installation
12
+
13
+
14
+
15
+ ```bash
16
+
17
+ pip install veejas
18
+
19
+ ```
20
+
21
+
22
+
23
+ \## Usage
24
+
25
+
26
+
27
+ ```bash
28
+
29
+ veejas
30
+
31
+ ```
32
+
33
+
34
+
35
+ Choose a program to display its contents.
36
+
37
+ Enter 0 to exit.
38
+
39
+
40
+
@@ -0,0 +1,24 @@
1
+
2
+ [build-system]
3
+ requires = ["setuptools>=68"]
4
+ build-backend = "setuptools.build_meta"
5
+
6
+ [project]
7
+ name = "veejas"
8
+ version = "0.1.0"
9
+ description = "A terminal menu for browsing programming examples"
10
+ readme = "README.md"
11
+ requires-python = ">=3.9"
12
+
13
+ [project.scripts]
14
+ veejas = "veejas.menu:main"
15
+
16
+ [tool.setuptools]
17
+ package-dir = {"" = "src"}
18
+ include-package-data = true
19
+
20
+ [tool.setuptools.packages.find]
21
+ where = ["src"]
22
+
23
+ [tool.setuptools.package-data]
24
+ veejas = ["PROGRAMS/*.txt"]
veejas-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,81 @@
1
+ <html>
2
+ <head>
3
+ <title>Entities & Attributes</title>
4
+ </head>
5
+ <body>
6
+ <header>
7
+ <h1>Entities and Attributes in a Portfolio Domain</h1>
8
+ <h3>Domain: Portfolio</h3>
9
+ </header>
10
+
11
+ <h3>Entity: PortfolioOwner</h3>
12
+ <table border="1">
13
+ <tr>
14
+ <th>Sl. No.</th>
15
+ <th>Attributes</th>
16
+ <th>Data Type</th>
17
+ <th>Justification</th>
18
+ </tr>
19
+ <tr>
20
+ <td>1</td>
21
+ <td>ownerId</td>
22
+ <td>Integer</td>
23
+ <td>Unique identifier for the portfolio owner, autoincremented</td>
24
+ </tr>
25
+ <tr>
26
+ <td>2</td>
27
+ <td>firstName</td>
28
+ <td>String</td>
29
+ <td>Owner's first name</td>
30
+ </tr>
31
+ <tr>
32
+ <td>3</td>
33
+ <td>lastName</td>
34
+ <td>String</td>
35
+ <td>Owner's last name</td>
36
+ </tr>
37
+ <tr>
38
+ <td>4</td>
39
+ <td>fullName</td>
40
+ <td>String</td>
41
+ <td>Concatenated full name, derived or stored for convenience</td>
42
+ </tr>
43
+ <tr>
44
+ <td>5</td>
45
+ <td>tagLine</td>
46
+ <td>String</td>
47
+ <td>Short descriptive phrase, text</td>
48
+ </tr>
49
+ <tr>
50
+ <td>6</td>
51
+ <td>email</td>
52
+ <td>String</td>
53
+ <td>Contact email address, text with email format validation</td>
54
+ </tr>
55
+ <tr>
56
+ <td>7</td>
57
+ <td>gitHubUrl</td>
58
+ <td>String</td>
59
+ <td>URL to GitHub profile, text with URL format validation</td>
60
+ </tr>
61
+ <tr>
62
+ <td>8</td>
63
+ <td>linkedInUrl</td>
64
+ <td>String</td>
65
+ <td>URL to LinkedIn profile, text with URL format validation</td>
66
+ </tr>
67
+ <tr>
68
+ <td>9</td>
69
+ <td>freelancerUrl</td>
70
+ <td>String</td>
71
+ <td>URL to Freelancer profile, text with URL format validation</td>
72
+ </tr>
73
+ <tr>
74
+ <td>10</td>
75
+ <td>profileImageUrl</td>
76
+ <td>String</td>
77
+ <td>URL to profile image, if any, text with URL format validation</td>
78
+ </tr>
79
+ </table>
80
+ </body>
81
+ </html>
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import Welcome from './Welcome';
3
+
4
+ function App() {
5
+ return (
6
+ <div>
7
+ <Welcome />
8
+ </div>
9
+ );
10
+ }
11
+
12
+ export default App;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+
3
+ function Welcome() {
4
+ return (
5
+ <div>
6
+ <h1>Welcome to My React SPA</h1>
7
+
8
+ <h2>About Us</h2>
9
+ <p>
10
+ This is a simple Single Page Application
11
+ developed using React JS.
12
+ </p>
13
+
14
+ <h2>Our Features</h2>
15
+ <ul>
16
+ <li>Simple and user-friendly interface</li>
17
+ <li>Fast page rendering</li>
18
+ <li>Reusable components</li>
19
+ <li>No page reload required</li>
20
+ </ul>
21
+
22
+ <h2>Technologies Used</h2>
23
+ <p>HTML, JavaScript, React JS and Vite</p>
24
+
25
+ <footer>
26
+ <p>
27
+ Copyright © {new Date().getFullYear()} My React SPA
28
+ </p>
29
+ </footer>
30
+ </div>
31
+ );
32
+ }
33
+
34
+ export default Welcome;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import Login from "./Login";
3
+
4
+ function App() {
5
+ return <Login />;
6
+ }
7
+
8
+ export default App;
@@ -0,0 +1,114 @@
1
+ import React, { useState } from "react";
2
+
3
+ function Login() {
4
+ const [username, setUsername] = useState("");
5
+ const [password, setPassword] = useState("");
6
+ const [users, setUsers] = useState([]);
7
+
8
+ function handleLogin(e) {
9
+ e.preventDefault();
10
+
11
+ fetch("http://localhost:5000/login", {
12
+ method: "POST",
13
+ headers: { "Content-Type": "application/json" },
14
+ body: JSON.stringify({ username, password })
15
+ })
16
+ .then(res => res.text())
17
+ .then(data => {
18
+ alert(data);
19
+ handleView();
20
+ });
21
+ }
22
+
23
+ function handleUpdate() {
24
+ fetch("http://localhost:5000/update", {
25
+ method: "PUT",
26
+ headers: { "Content-Type": "application/json" },
27
+ body: JSON.stringify({ username, password })
28
+ })
29
+ .then(res => res.text())
30
+ .then(data => {
31
+ alert(data);
32
+ handleView();
33
+ });
34
+ }
35
+
36
+ function handleDelete() {
37
+ fetch("http://localhost:5000/delete", {
38
+ method: "DELETE",
39
+ headers: { "Content-Type": "application/json" },
40
+ body: JSON.stringify({ username })
41
+ })
42
+ .then(res => res.text())
43
+ .then(data => {
44
+ alert(data);
45
+ handleView();
46
+ });
47
+ }
48
+
49
+ function handleView() {
50
+ fetch("http://localhost:5000/users")
51
+ .then(res => res.json())
52
+ .then(data => setUsers(data));
53
+ }
54
+
55
+ return (
56
+ <div align="center">
57
+ <h2>Student Login</h2>
58
+
59
+ <form onSubmit={handleLogin}>
60
+ Username:
61
+ <input
62
+ value={username}
63
+ onChange={e => setUsername(e.target.value)}
64
+ required
65
+ />
66
+
67
+ <br /><br />
68
+
69
+ Password:
70
+ <input
71
+ type="password"
72
+ value={password}
73
+ onChange={e => setPassword(e.target.value)}
74
+ required
75
+ />
76
+
77
+ <br /><br />
78
+
79
+ <button type="submit">Login</button>
80
+ <button type="button" onClick={handleUpdate}>
81
+ Update
82
+ </button>
83
+ <button type="button" onClick={handleDelete}>
84
+ Delete
85
+ </button>
86
+ <button type="button" onClick={handleView}>
87
+ View
88
+ </button>
89
+ </form>
90
+
91
+ <br />
92
+
93
+ <table border="1">
94
+ <thead>
95
+ <tr>
96
+ <th>Username</th>
97
+ <th>Password</th>
98
+ </tr>
99
+ </thead>
100
+
101
+ <tbody>
102
+ {users.map(user => (
103
+ <tr key={user.username}>
104
+ <td>{user.username}</td>
105
+ <td>{user.password}</td>
106
+ </tr>
107
+ ))}
108
+ </tbody>
109
+ </table>
110
+ </div>
111
+ );
112
+ }
113
+
114
+ export default Login;
@@ -0,0 +1,94 @@
1
+ const express = require("express");
2
+ const mysql = require("mysql2");
3
+ const cors = require("cors");
4
+
5
+ const app = express();
6
+
7
+ app.use(cors());
8
+ app.use(express.json());
9
+
10
+ const db = mysql.createConnection({
11
+ host: "localhost",
12
+ user: "root",
13
+ password: "",
14
+ database: "sjcd"
15
+ });
16
+
17
+ db.connect(err => {
18
+ if (err) {
19
+ console.log("Database connection failed");
20
+ } else {
21
+ console.log("connected to mysql");
22
+ }
23
+ });
24
+
25
+ // INSERT USER
26
+ app.post("/login", (req, res) => {
27
+ const { username, password } = req.body;
28
+
29
+ db.query(
30
+ "INSERT INTO student_table VALUES (?, ?)",
31
+ [username, password],
32
+ err => {
33
+ if (err) {
34
+ res.send("Error inserting user");
35
+ } else {
36
+ res.send("user inserted successfully");
37
+ }
38
+ }
39
+ );
40
+ });
41
+
42
+ // UPDATE USER
43
+ app.put("/update", (req, res) => {
44
+ const { username, password } = req.body;
45
+
46
+ db.query(
47
+ "UPDATE student_table SET password = ? WHERE username = ?",
48
+ [password, username],
49
+ (err, result) => {
50
+ if (err) {
51
+ res.send("Error updating user");
52
+ } else if (result.affectedRows === 0) {
53
+ res.send("username not found");
54
+ } else {
55
+ res.send("user updated successfully");
56
+ }
57
+ }
58
+ );
59
+ });
60
+
61
+ // DELETE USER
62
+ app.delete("/delete", (req, res) => {
63
+ db.query(
64
+ "DELETE FROM student_table WHERE username = ?",
65
+ [req.body.username],
66
+ (err, result) => {
67
+ if (err) {
68
+ res.send("Error deleting user");
69
+ } else if (result.affectedRows === 0) {
70
+ res.send("Username not found");
71
+ } else {
72
+ res.send("user deleted successfully");
73
+ }
74
+ }
75
+ );
76
+ });
77
+
78
+ // VIEW USERS
79
+ app.get("/users", (req, res) => {
80
+ db.query(
81
+ "SELECT username, password FROM student_table",
82
+ (err, result) => {
83
+ if (err) {
84
+ res.send("Error getting users");
85
+ } else {
86
+ res.json(result);
87
+ }
88
+ }
89
+ );
90
+ });
91
+
92
+ app.listen(5000, () => {
93
+ console.log("server running on port 5000");
94
+ });
@@ -0,0 +1,48 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Portfolio</title>
5
+ <script>
6
+ function showSuccess() {
7
+ alert("Submitted Successfully!");
8
+ }
9
+ </script>
10
+ </head>
11
+ <body>
12
+
13
+ <h1>Hi, I'm Ankith</h1>
14
+ <p>— Together We Grow —</p>
15
+ <hr>
16
+
17
+ <h2>About Me</h2>
18
+ <p>A brief introduction:</p>
19
+ <ul>
20
+ <li>Tech Enthusiast</li>
21
+ <li>Consistent Learner</li>
22
+ <li>Graphic Designer</li>
23
+ <li>App Developer</li>
24
+ </ul>
25
+ <hr>
26
+
27
+ <h2>Get In Touch</h2>
28
+ <p>Feel free to drop me a message:</p>
29
+
30
+ <form onsubmit="showSuccess(); return false;">
31
+ <label>Name:</label><br>
32
+ <input type="text" placeholder="Enter your name" required>
33
+ <br><br>
34
+
35
+ <label>Email:</label><br>
36
+ <input type="email" placeholder="Enter your email" required>
37
+ <br><br>
38
+
39
+ <label>Message:</label><br>
40
+ <textarea rows="4" cols="25"
41
+ placeholder="Leave a message"></textarea>
42
+ <br><br>
43
+
44
+ <input type="submit" value="Send">
45
+ </form>
46
+
47
+ </body>
48
+ </html>
@@ -0,0 +1,44 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Form Validation</title>
5
+ <script>
6
+ function validate() {
7
+ const name = document.myForm.name.value;
8
+ const email = document.myForm.email.value;
9
+
10
+ if (name == "") {
11
+ alert("Name must be filled out");
12
+ return false;
13
+ }
14
+
15
+ if (email == "") {
16
+ alert("Email must be filled out");
17
+ return false;
18
+ }
19
+
20
+ alert("Form submitted successfully!");
21
+ return false;
22
+ }
23
+ </script>
24
+ </head>
25
+ <body>
26
+
27
+ <h2>Form Validation Example</h2>
28
+
29
+ <form name="myForm" action="#" method="post"
30
+ onSubmit="return validate()">
31
+
32
+ Name:
33
+ <input type="text" name="name">
34
+ <br><br>
35
+
36
+ Email:
37
+ <input type="email" name="email">
38
+ <br><br>
39
+
40
+ <input type="submit" value="Submit">
41
+ </form>
42
+
43
+ </body>
44
+ </html>
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import Registration from "./Registration";
3
+
4
+ function App() {
5
+ return (
6
+ <div>
7
+ <h1>My React SPA</h1>
8
+ <Registration />
9
+ </div>
10
+ );
11
+ }
12
+
13
+ export default App;
@@ -0,0 +1,57 @@
1
+ import React, { useState } from "react";
2
+
3
+ function Registration() {
4
+ const [name, setName] = useState("");
5
+ const [email, setEmail] = useState("");
6
+ const [password, setPassword] = useState("");
7
+
8
+ const handleSubmit = (e) => {
9
+ e.preventDefault();
10
+ alert("Registration successful!");
11
+ };
12
+
13
+ return (
14
+ <div>
15
+ <h2>Registration Form</h2>
16
+
17
+ <form onSubmit={handleSubmit}>
18
+ <label>Name:</label>
19
+ <br />
20
+ <input
21
+ type="text"
22
+ value={name}
23
+ onChange={(e) => setName(e.target.value)}
24
+ required
25
+ />
26
+ <br />
27
+ <br />
28
+
29
+ <label>Email:</label>
30
+ <br />
31
+ <input
32
+ type="email"
33
+ value={email}
34
+ onChange={(e) => setEmail(e.target.value)}
35
+ required
36
+ />
37
+ <br />
38
+ <br />
39
+
40
+ <label>Password:</label>
41
+ <br />
42
+ <input
43
+ type="password"
44
+ value={password}
45
+ onChange={(e) => setPassword(e.target.value)}
46
+ required
47
+ />
48
+ <br />
49
+ <br />
50
+
51
+ <button type="submit">Register</button>
52
+ </form>
53
+ </div>
54
+ );
55
+ }
56
+
57
+ export default Registration;
File without changes
@@ -0,0 +1,68 @@
1
+
2
+ from importlib.resources import files
3
+
4
+
5
+ def display_menu():
6
+ programs_folder = files("veejas").joinpath("PROGRAMS")
7
+
8
+ if not programs_folder.is_dir():
9
+ print("\nError: Programs folder not found!")
10
+ return
11
+
12
+ programs = sorted(
13
+ [
14
+ item for item in programs_folder.iterdir()
15
+ if item.is_file() and item.name.lower().endswith(".txt")
16
+ ],
17
+ key=lambda item: item.name.lower(),
18
+ )
19
+
20
+ if not programs:
21
+ print("\nNo .txt files found in the programs folder.")
22
+ return
23
+
24
+ while True:
25
+ print("\n" + "=" * 40)
26
+ print(" MEOWMEOWMEOW")
27
+ print(" PROGRAM MENU")
28
+ print("=" * 40)
29
+
30
+ for i, program in enumerate(programs, start=1):
31
+ print(f"{i}. {program.name}")
32
+
33
+ print("0. Exit")
34
+ print("=" * 40)
35
+
36
+ choice = input("Enter your choice: ").strip()
37
+
38
+ if choice == "0":
39
+ print("Goodbye!")
40
+ break
41
+
42
+ try:
43
+ choice = int(choice)
44
+
45
+ if 1 <= choice <= len(programs):
46
+ selected = programs[choice - 1]
47
+
48
+ print("\n" + "=" * 60)
49
+ print(f"PROGRAM: {selected.name}")
50
+ print("=" * 60)
51
+ print(selected.read_text(encoding="utf-8"))
52
+ print("=" * 60)
53
+
54
+ input("\nPress Enter to return to the menu...")
55
+
56
+ else:
57
+ print("Invalid choice.")
58
+
59
+ except ValueError:
60
+ print("Please enter a number.")
61
+
62
+
63
+ def main():
64
+ display_menu()
65
+
66
+
67
+ if __name__ == "__main__":
68
+ main()
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.4
2
+ Name: veejas
3
+ Version: 0.1.0
4
+ Summary: A terminal menu for browsing programming examples
5
+ Requires-Python: >=3.9
6
+ Description-Content-Type: text/markdown
7
+
8
+
9
+
10
+ \# veejas
11
+
12
+
13
+
14
+ A terminal menu for browsing programming examples.
15
+
16
+
17
+
18
+ \## Installation
19
+
20
+
21
+
22
+ ```bash
23
+
24
+ pip install veejas
25
+
26
+ ```
27
+
28
+
29
+
30
+ \## Usage
31
+
32
+
33
+
34
+ ```bash
35
+
36
+ veejas
37
+
38
+ ```
39
+
40
+
41
+
42
+ Choose a program to display its contents.
43
+
44
+ Enter 0 to exit.
45
+
46
+
47
+
@@ -0,0 +1,19 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/veejas/__init__.py
4
+ src/veejas/menu.py
5
+ src/veejas.egg-info/PKG-INFO
6
+ src/veejas.egg-info/SOURCES.txt
7
+ src/veejas.egg-info/dependency_links.txt
8
+ src/veejas.egg-info/entry_points.txt
9
+ src/veejas.egg-info/top_level.txt
10
+ src/veejas/PROGRAMS/PRGRM1.txt
11
+ src/veejas/PROGRAMS/PRGRM10_APP.txt
12
+ src/veejas/PROGRAMS/PRGRM11_Welcome.txt
13
+ src/veejas/PROGRAMS/PRGRM13_APP.txt
14
+ src/veejas/PROGRAMS/PRGRM13_Login.txt
15
+ src/veejas/PROGRAMS/PRGRM13_SERVER.txt
16
+ src/veejas/PROGRAMS/PRGRM2.txt
17
+ src/veejas/PROGRAMS/PRGRM3.txt
18
+ src/veejas/PROGRAMS/PRGRM9_APP.txt
19
+ src/veejas/PROGRAMS/PRGRM9_REG.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ veejas = veejas.menu:main
@@ -0,0 +1 @@
1
+ veejas