Skip to content

Commit 339273a

Browse files
author
thugeyy
committed
Merge branch 'thugeyy' of https://github.com/thugeyy/All-In-One-Python-Projects into thugeyy
2 parents f1c1d6a + 8c6ae32 commit 339273a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+3788
-7
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Project Suggestion
3+
about: Propose an idea for a new project
4+
title: ""
5+
labels: "Project Suggestion"
6+
assignees: ""
7+
---
8+
9+
### Project Suggestion Title
10+
_A concise title for your project suggestion._
11+
12+
### Description
13+
_Provide a detailed description of the project idea or feature you would like to propose._
14+
15+
### Benefits
16+
_Explain how this project or feature would benefit the community or improve the existing repository._
17+
18+
### Implementation Ideas
19+
_Offer any initial thoughts on how the project could be implemented, including potential technologies or approaches._
20+
21+
### Additional Context
22+
_Include any other relevant information, links, or references that might help._
23+
24+
### Suggested Contributors
25+
_If you have specific contributors in mind who might be interested in this project, please list them here._
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: "Bug Report"
3+
about: "Report a bug or issue."
4+
title: "Bug Report Title"
5+
labels: ["bug", "help wanted"]
6+
---
7+
8+
## Description
9+
Please describe the bug you encountered, including steps to reproduce it.
10+
11+
## Steps to Reproduce
12+
1. Step 1
13+
2. Step 2
14+
3. Step 3 ...
15+
16+
## Expected Behavior
17+
What did you expect to happen?
18+
19+
## Actual Behavior
20+
What actually happened?
21+
22+
## Additional Context
23+
Add any other context about the problem, screenshots, or logs that might be helpful.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
blank_issues_enabled: false
2+
contact: false
3+
4+
templates:
5+
- name: "Project Suggestion"
6+
description: "Propose an idea for a new project."
7+
title: "Project Suggestion Title"
8+
labels: ["Project Suggestion"]
9+
10+
- name: "Bug Report"
11+
description: "Report a bug or issue."
12+
title: "Bug Report Title"
13+
labels: ["bug", "help wanted"]
14+
15+
- name: "Feature Request"
16+
description: "Request a new feature or enhancement."
17+
title: "Feature Request Title"
18+
labels: ["feature", "enhancement"]
19+
20+
- name: "Other"
21+
description: "Use this template for any other issues or inquiries."
22+
title: "Other Issue Title"
23+
labels: ["question", "others"]
24+
25+
choose_template:
26+
title: "Choose an Issue Template"
27+
description: "Please select one of the templates below to create your issue."
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: "Feature Request"
3+
about: "Request a new feature or enhancement."
4+
title: "Feature Request Title"
5+
labels: ["feature", "enhancement"]
6+
---
7+
8+
## Feature Description
9+
Please describe the feature you would like to request.
10+
11+
## Use Cases
12+
How will this feature be used? Please provide examples.
13+
14+
## Additional Context
15+
Add any other context about the feature request, including design ideas or potential impacts.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: "Other"
3+
about: "Use this template for any other issues or inquiries."
4+
title: "Other Issue Title"
5+
labels: ["question", "other"]
6+
---
7+
8+
## Description
9+
Please provide a detailed description of your inquiry or issue.
10+
11+
## Context
12+
Add any relevant context or background information that may help in addressing your request.
13+
14+
## Additional Information
15+
If applicable, include any additional information, screenshots, or references.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### Project Suggestion Title
2+
_A concise title for your project suggestion._
3+
4+
### Description
5+
_Provide a detailed description of the project idea or feature you would like to propose._
6+
7+
### Benefits
8+
_Explain how this project or feature would benefit the community or improve the existing repository._
9+
10+
### Implementation Ideas
11+
_Offer any initial thoughts on how the project could be implemented, including potential technologies or approaches._
12+
13+
### Additional Context
14+
_Include any other relevant information, links, or references that might help._
15+
16+
### Suggested Contributors
17+
_If you have specific contributors in mind who might be interested in this project, please list them here._

.github/pull_request_template.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### Developer Checklist
2+
- [ ] Adhered to the guidelines outlined in the README & Contributing file.
3+
- [ ] Maintained the correct directory structure (e.g., ProjectName/...yourfiles).
4+
- [ ] Please ensure to include a README file for enhanced project clarity.
5+
- [ ] Starred ⭐ the repository (optional).
6+
7+
### Summary
8+
###### _Please provide a brief summary here._
9+
10+
### Screenshot
11+
###### _Attach any relevant screenshots or GIFs here._
12+
13+
### Live Project Link
14+
###### _Include a link to the live project here._
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Generate Project List
2+
3+
on:
4+
schedule:
5+
- cron: 0 0 * * *
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
generate-list:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
with:
17+
token: ${{ secrets.ACTION_TOKEN }}
18+
persist-credentials: true
19+
20+
- name: Fetch latest changes
21+
run: git fetch origin
22+
23+
- name: Merge changes
24+
run: |
25+
git merge origin/main || echo "No new changes to merge or merge conflict"
26+
27+
- name: Generate project list
28+
run: |
29+
exclude_dirs=(.github)
30+
exclude_files=("LICENSE" "README.md" "CONTRIBUTING.md" "Example README.md" "CODE_OF_CONDUCT.md" "PROJECTS.md")
31+
32+
projects=()
33+
for dir in */; do
34+
if [[ ! " ${exclude_dirs[@]} " =~ " ${dir%/} " ]]; then
35+
projects+=("$dir")
36+
fi
37+
done
38+
39+
echo "# Project List" > PROJECTS.md
40+
echo "" >> PROJECTS.md
41+
42+
for project in "${projects[@]}"; do
43+
project_name=${project%/}
44+
safe_project_name=${project_name// /%20}
45+
echo "* [$project_name](https://github.com/king04aman/All-In-One-Python-Projects/tree/main/$safe_project_name)" >> PROJECTS.md
46+
done
47+
48+
for file in "${exclude_files[@]}"; do
49+
sed -i "/$file/d" PROJECTS.md
50+
done
51+
52+
# Debug output to check the content of PROJECTS.md
53+
cat PROJECTS.md
54+
55+
- name: Commit project list
56+
run: |
57+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
58+
git config --global user.name "github-actions[bot]"
59+
git add PROJECTS.md
60+
if ! git diff --cached --exit-code; then
61+
git commit -m "Update project list"
62+
git push --force-with-lease
63+
else
64+
echo "No changes to commit."
65+
fi
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}

.github/workflows/welcome.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Welcome Comments
2+
3+
permissions:
4+
actions: write
5+
attestations: write
6+
checks: write
7+
contents: write
8+
deployments: write
9+
id-token: write
10+
issues: write
11+
discussions: write
12+
packages: write
13+
pages: write
14+
pull-requests: write
15+
repository-projects: write
16+
security-events: write
17+
statuses: write
18+
19+
on:
20+
issues:
21+
types: [opened, closed]
22+
pull_request_target:
23+
types: [opened, closed]
24+
25+
jobs:
26+
welcomer:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Auto Welcome on Issues or PRs
30+
uses: actions/github-script@v6
31+
with:
32+
github-token: ${{ secrets.GITHUB_TOKEN }}
33+
script: |
34+
const author = context.payload.sender.login;
35+
const commentBody = (message) => `👋 @${author} 👋\n\n${message}`;
36+
37+
if (context.eventName === 'issues') {
38+
const issue = context.payload.issue;
39+
40+
if (context.payload.action === 'opened') {
41+
const message = `We're thrilled to see you opening an issue! Your input is valuable to us. Don’t forget to fill out our issue template for the best experience. We will look into it soon.`;
42+
github.rest.issues.createComment({
43+
issue_number: issue.number,
44+
owner: context.repo.owner,
45+
repo: context.repo.repo,
46+
body: commentBody(message),
47+
});
48+
} else if (context.payload.action === 'closed') {
49+
const message = `Thanks for closing the issue! We appreciate your updates.`;
50+
github.rest.issues.createComment({
51+
issue_number: issue.number,
52+
owner: context.repo.owner,
53+
repo: context.repo.repo,
54+
body: commentBody(message),
55+
});
56+
}
57+
} else if (context.eventName === 'pull_request_target') {
58+
const pr = context.payload.pull_request;
59+
60+
if (context.payload.action === 'opened') {
61+
const message = `We're delighted to have your pull request! Please take a moment to check our contributing guidelines and ensure you've filled out the PR template for a smooth process. We will review it soon.`;
62+
github.rest.issues.createComment({
63+
issue_number: pr.number,
64+
owner: context.repo.owner,
65+
repo: context.repo.repo,
66+
body: commentBody(message),
67+
});
68+
} else if (context.payload.action === 'closed') {
69+
const message = pr.merged
70+
? `🎉 You've just merged your pull request! We're excited to have you in our community. Keep up the fantastic contributions to the project!`
71+
: `Thanks for closing the pull request! Your contributions are valuable to us.`;
72+
73+
github.rest.issues.createComment({
74+
issue_number: pr.number,
75+
owner: context.repo.owner,
76+
repo: context.repo.repo,
77+
body: commentBody(message),
78+
});
79+
}
80+
}

Geographic Distance/README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Geographic Distance and Travel Time Calculator
2+
3+
This Python script calculates the geodesic distance between two geographic coordinates and estimates travel time based on a given average speed. It uses the geopy library to compute distances.
4+
5+
## Features
6+
7+
- Input coordinates for two locations (latitude and longitude) interactively.
8+
- Calculate the distance between the two coordinates in kilometers.
9+
- Estimate the travel time based on a given average speed (in km/h).
10+
11+
## Prerequisites
12+
13+
- Python 3.x installed on your system.
14+
15+
## Setup
16+
17+
1. Clone the repository
18+
19+
```bash
20+
git clone https://github.com/king04aman/All-In-One-Python-Projects.git
21+
cd All-In-One-Python-Projects/Geographic Distance
22+
```
23+
24+
2. Create and activate a virtual environment
25+
26+
- For macOS/Linux:
27+
28+
```bash
29+
python3 -m venv venv
30+
source venv/bin/activate
31+
```
32+
33+
- For Windows:
34+
35+
```bash
36+
python -m venv venv
37+
venv\Scripts\activate
38+
```
39+
40+
3. Install the required dependencies
41+
42+
The required packages are listed in requirements.txt. Install them using the following command:
43+
44+
```bash
45+
pip install -r requirements.txt
46+
```
47+
48+
Note: The main dependency is geopy for calculating distances based on geodesic coordinates.
49+
50+
## Usage
51+
52+
1. Run the script:
53+
54+
```bash
55+
python geographic_distance.py
56+
```
57+
58+
2. Enter the coordinates (latitude and longitude) of the two locations when prompted.
59+
3. Enter the average speed in km/h to calculate the travel time.
60+
61+
Example input:
62+
63+
```
64+
Enter the latitude and longitude of the first location (lat1, lon1) Example: 40.7128, -74.006: 52.5200, 13.4050
65+
Enter the latitude and longitude of the second location (lat2, lon2) Example: 37.7749, -122.4194: 48.8566, 2.3522
66+
Enter the average speed in km/h Example: 60: 80
67+
```
68+
69+
Example output:
70+
71+
```
72+
Distance between the two coordinates: 878.84 kilometers
73+
Estimated travel time: 10.99 hours
74+
```
75+
76+
## Requirements
77+
78+
Here’s a list of Python dependencies in requirements.txt:
79+
80+
```
81+
geopy==2.2.0
82+
pytest==8.3.3
83+
```

0 commit comments

Comments
 (0)