Skip to content

Commit bd85aa4

Browse files
Merge pull request #2 from CSWorldTelugu/dev
container upload, error handler utility, docs add
2 parents a4325af + 9867cdc commit bd85aa4

10 files changed

Lines changed: 386 additions & 42 deletions

File tree

CODE_OF_CONDUCT.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Code of Conduct - python-fm-dapi-weaver
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to a positive environment for our
15+
community include:
16+
17+
* Demonstrating empathy and kindness toward other people
18+
* Being respectful of differing opinions, viewpoints, and experiences
19+
* Giving and gracefully accepting constructive feedback
20+
* Accepting responsibility and apologizing to those affected by our mistakes,
21+
and learning from the experience
22+
* Focusing on what is best not just for us as individuals, but for the
23+
overall community
24+
25+
Examples of unacceptable behavior include:
26+
27+
* The use of sexualized language or imagery, and sexual attention or
28+
advances
29+
* Trolling, insulting or derogatory comments, and personal or political attacks
30+
* Public or private harassment
31+
* Publishing others' private information, such as a physical or email
32+
address, without their explicit permission
33+
* Other conduct which could reasonably be considered inappropriate in a
34+
professional setting
35+
36+
## Our Responsibilities
37+
38+
Project maintainers are responsible for clarifying and enforcing our standards of
39+
acceptable behavior and will take appropriate and fair corrective action in
40+
response to any instances of unacceptable behavior.
41+
42+
Project maintainers have the right and responsibility to remove, edit, or reject
43+
comments, commits, code, wiki edits, issues, and other contributions that are
44+
not aligned to this Code of Conduct, or to ban
45+
temporarily or permanently any contributor for other behaviors that they deem
46+
inappropriate, threatening, offensive, or harmful.
47+
48+
## Scope
49+
50+
This Code of Conduct applies within all community spaces, and also applies when
51+
an individual is officially representing the community in public spaces.
52+
Examples of representing our community include using an official e-mail address,
53+
posting via an official social media account, or acting as an appointed
54+
representative at an online or offline event.
55+
56+
## Enforcement
57+
58+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
59+
reported to the community leaders responsible for enforcement at <>.
60+
All complaints will be reviewed and investigated promptly and fairly.
61+
62+
All community leaders are obligated to respect the privacy and security of the
63+
reporter of any incident.
64+
65+
## Attribution
66+
67+
This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version
68+
[1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and
69+
[2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md),
70+
and was generated by [contributing-gen](https://github.com/bttger/contributing-gen).

CONTRIBUTING.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Contributing to Python FM DAPI Weaver
2+
3+
4+
Thank you for your interest in contributing to **Python FM DAPI Weaver**!This guide outlines the steps to get started and the standards we follow.
5+
6+
7+
8+
9+
## Ways to Contribute?
10+
11+
You can help improve the project in the following ways:
12+
13+
14+
15+
- Identifying and reporting bugs
16+
- Proposing new features or enhancements
17+
- Improving or expanding documentation
18+
- Fixing existing issues
19+
- Developing new features or API endpoints
20+
21+
22+
23+
## Contribution Guidelines
24+
25+
- Keep your code clean and well-documented.
26+
- Follow the coding conventions used in the project.
27+
- Ensure your changes don’t break existing functionality (run tests if available).
28+
- Make small, focused commits with clear messages.
29+
30+
31+
32+
33+
## How to Contribute:
34+
35+
36+
37+
1. **Fork the Project:** Create a personal copy of the repository by forking it on GitHub.
38+
39+
40+
41+
2. **Clone Your Fork:** Pull the repository onto your local computer using Git.
42+
43+
44+
45+
3. **Create a Feature Branch:** Work on a new branch dedicated to the feature or fix you're adding.
46+
47+
48+
49+
4. **Make Necessary Changes:** Implement your changes and thoroughly test to ensure everything works.
50+
51+
52+
53+
5. **Commit the Changes:** Commit your work with a concise, clear message about what was modified.
54+
55+
56+
57+
6. **Push to Your Fork on GitHub:** Push the branch to your GitHub account.
58+
59+
60+
61+
7. **Open a Pull Request:** Submit your pull request to the project repository for review and merging.
62+
63+
64+
## Code of Conduct and Licensing
65+
66+
By participating in this project, you agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md) and are licensed under the project's [License](./LICENSE).
67+
68+
69+
70+
# Thank You for Contributing!
71+
72+
73+
74+
Your contributions are what make this project great! We appreciate the time, effort, and ideas you put into helping us improve.
75+
76+
77+
78+
If you have any questions, feel free to reach out. We encourage everyone to contribute, no matter how big or small. Together, we can make this project even better!
79+
80+
81+
82+
Happy coding!
83+

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Use a lightweight Python base image
2+
FROM python:3.9-slim
3+
4+
# Set the project directory
5+
WORKDIR /python-fm-api
6+
7+
# Copy the requirements file
8+
COPY requirements.txt .
9+
10+
# Install dependencies
11+
RUN pip install --no-cache-dir -r requirements.txt
12+
13+
# Copy the entire code
14+
COPY . .
15+
16+
# Expose the port
17+
EXPOSE 8000
18+
19+
20+
# run the application
21+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
22+
23+
24+

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Mindfire Digital LLP
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

controllers/auth.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
from fastapi import FastAPI, HTTPException, Header, Request, APIRouter
22
from starlette.responses import JSONResponse
33
import requests
4-
from typing import Annotated
5-
6-
74

85
async def validate_token(req: Request):
96
print("reaching here---validateToken")
@@ -69,8 +66,6 @@ async def validate_session(req: Request):
6966
except Exception as error:
7067
return JSONResponse(status_code=401, content={"error": "Session validation failed"})
7168

72-
73-
7469
async def signin(req: Request):
7570
try:
7671
await validate_token(req)

controllers/index.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
get_all_records,
66
find_record,
77
update_record,
8-
delete_record
8+
delete_record,
9+
upload_container
910
)
1011

1112
controllers_to_skip_validation = ["signin"]
@@ -16,7 +17,8 @@
1617
"updateRecord": update_record,
1718
"deleteRecord": delete_record,
1819
"signin": signin,
19-
"signout" : signout
20+
"signout" : signout,
21+
"uploadContainer":upload_container
2022

2123
}
2224

0 commit comments

Comments
 (0)