Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Hotel-Manage-Soumya is a lightweight Python library designed to simplify and streamline the management of bookings, rooms, and users within Flask web applications. With its easy-to-use classes and methods, it provides a set of essential functionalities for handling booking management, room management, and user management.
Hotel-manage-soumya is a lightweight Python library designed to simplify and streamline the management of bookings, rooms, and users within Flask web applications. With its easy-to-use classes and methods, Hotel-manage-soumya provides a set of essential functionalities for handling booking reservations, room management, and user authentication.
Booking Class:
The Booking class allows users to manage booking reservations efficiently. It provides methods to create, update, and delete bookings, as well as retrieve booking details such as check in date, check out date, room number, total guests, guest Name, payment etc.
Room Class:
The Room class offers a convenient way to manage room information. Users can add new rooms, delete rooms, update existing room details, and retrieve information like room type, number of beds, amenities, price, room description and availability.
User Class:
The User class offers a convenient way to manage user information. Admin can add new user, delete user, update existing user details, and retrieve information like full name, username, email, role and phone. Admin create two type of user i.e Manager and Admin.
Easy Integration:
Hotel-manage-soumya is designed specifically for any python web applications, allowing smooth integration into existing projects.
Time-Saving:
By providing pre-built classes and methods, Hotel-manage-soumya eliminates the need to write boilerplate code for common booking, room, and user tasks.
Scalability:
Hotel-manage-soumya's modular design allows developers to extend its functionality to suit specific project requirements.
Following Flask app will return the total number of bookings, total number of rooms and total number of users. Follow steps to start Flask APP.
# Create directory
mkdir hotel_management
# Change directory
cd hotel_management
# Create and activate virtual environment
python -m venv .venv
# For Window:
source .venv/Scripts/activate
# For Ubuntu:
source .venv/bin/activate
Copy following code and save into app.py
from flask import Flask
import boto3
# Import classes from hotel_manage_soumya
from hotel_manage_soumya.booking import Booking
from hotel_manage_soumya.room import Room
from hotel_manage_soumya.user import User
load_dotenv()
app = Flask(__name__)
app.secret_key = 'your_secret_key'
# Initialize the DynamoDB client
dynamodb = boto3.client(
'dynamodb',
aws_access_key_id='YOUR_AWS_ACCESS_KEY_ID',
aws_secret_access_key='YOUR_AWS_SECRET_ACCESS_KEY',
region_name='us-east-1'
)
# Initialize classes objects
tableName = 'bookings'
booking_obj = Booking(tableName)
roomTableName = 'rooms'
bucketName = 'hotel-management-soumya'
room_obj = Room(roomTableName, bucketName)
userTableName = 'users'
user_obj = User(userTableName)
@app.route('/', methods=['GET'])
def home():
# All Bookings
all_booking = booking_obj.get_all_booking(dynamodb)
total_booking = len(all_booking['data']['Items'])
# All Rooms
all_rooms = room_obj.get_all_room(dynamodb)
total_room = len(all_rooms['data']['Items'])
# All users
all_users = user_obj.get_all_user(dynamodb)
total_users = len(all_users['data']['Items'])
return {
"statusCode": 200,
"TotalBooking": total_booking,
"TotalRoom": total_room,
"TotalUser": total_users
}
pip install hotel-manage-soumya
pip install flask
pip install boto3
{
"TotalBooking": 4,
"TotalRoom": 4,
"TotalUser": 3,
"statusCode": 200
}
python app.py OR flask run
Note:
Make sure you already have tables with data in DynamoDB and if you still face any issue then you can contact with us or explore the Class, Function from Github Hotel-manage-soumya and directory src/hotel_manage_soumya
.
For support, email x21174059@student.ncirl.ie , soumyaksoochik96@gmail.com.
FAQs
Hotel-Manage-Soumya is a lightweight Python library designed to simplify and streamline the management of bookings, rooms, and users within Flask web applications. With its easy-to-use classes and methods, it provides a set of essential functionalities for handling booking management, room management, and user management.
We found that hotel-manage-soumya demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.