Archive

Archive for October, 2021

Python Project: Properties Maintenance System P1

October 17, 2021 Leave a comment

Subject: Writing a Full Application for Properties Maintenance System
Learning : Python, Math, SQL, Logeic

[NOTE: To keep the code as simple as we can, We WILL NOT ADD any user input Varevecations. Assuming that our user will Enter the right inputs.]

In one of last week posts I mentioned that i am working on a New Project, and that we may start doning a “Properties Maintenance System” also I Draft-Down some points and brain-storming session [READ THE ARTICLE HERE]. In this Part -1 of the Properties Maintenance System

In this Post, we will see the Tables and the Fields, and will write the first Function to create the Data-Base and the tables, also Inserting the Zero-Records and the (some) Data in-to lookup tables. Also I will try to list-down all the Functions we may write in our Application. All the codes will be available in the Download Page.

Tables and Fields

  • Name: Job Status Table (job_s_t). Type: Lookup.
  • Name: Payment Method Table (pay_meth_t). Type: Lookup.
  • Name: Property Type Table (prop_type_t). Type: Lookup.
  • Name: Maintenance Job List Table (main_job_list_t). Type: Lookup.
  • Name: Properties Table (properties_t).
  • Name: Maintenance Request Table (maint_request_t)
  • Name: Receipt Table (receipt_t)

[Any other Table we may add more tables if we need latre]


Function: Here i am listing all the Functions we will create, this list will be the Main Menu.

… [ PROPERTIES MENU ] …

  • Add New Property.
  • Edit a Property.
  • Delete a Property.
  • Show Properties.

… [ LIST MANAGER ] …

  • Payment Method. [Add, Edit, Delete]
  • Job Status. [Add, Edit, Delete]
  • Property Type. [Add, Edit, Delete]
  • Maintenance List. [Add, Edit, Delete]
    … [ SETTING ] …

  • Create the Data-Base and the Tables.
  • Delete the Data-Base.
  • Export to Excel.


Function Exalmple: For each Function we have, this will be the template of the Function Name and the first three lines

 # Sample of: Add Job Status Function

def add_job_status():
    os.system('clear')
    line2 = "Add Job Status"
    header(line2, 9,14)  # Calling the header Function. 


Table Creation and Zero-Records
I am always start writing the ideas in the Python Editor as comments, and coding in the same time, so by the time i collect all this article the Part-1 of the project was done with Tow or Three Functions that Creating the Tables and Inserting the data into lookup-Tables. Here I am posting some screen shots of the code..

Property Maintenance System python code project ali radwani Property Maintenance System python code project ali radwani
Property Maintenance System python code project ali radwani Property Maintenance System python code project ali radwani


In Part-2 In Part-1 [This Article] We create the Data-Base and Tables, also Insert some Data into the lookup-tables and we create the Main-Menu Function. In Part-2 we will start writing some Functions to manage the lookup tables.

:: PMS Parts ::

Part 1 Part 2 Part 3 Part 4

..:: Have Fun with Coding ::.. 🙂

To Download my Python code (.py) files Click-Here



ali radwani ahradwani.com python projects codeFollow me on Twitter..

By: Ali Radwani

Nikon S9900 Shot 13

October 13, 2021 Leave a comment


Subject: Nikon S9900 in Souq-Waqif Journey

In 2016 I bought Nikon Coolpix S9900, I have Nikon D90, and Nikon 7100 both are DX (crop sensor), but S9900 is my first Coolpix (point & shoot) camera from Nikon, I use to have Sony T100. [:. Read more about my cameras and lenses Here .:]

This Shot: In one of most beautifully ‘Old Bazaar’ in Qatar called “Souq-Waqif” you may find lot’s of Vestibules, here is one that will take you to a Mosque, I take the shot using Nikon S9900.

…Click Image to Enlarge…
photo photography ali radwani doha qatar Souq-Waqif old bazaar Nikon Coolpix S9900
Camera in Hand, F:3.7, ISO:125, Shutter:1/400s, Focal-Point:5mm



::.. To see all my Nikon S9900 Photos Click-Here
::.. To see all my Nikon D7100 Photos Click-Here
::.. To see all my Nikon D90 Photos Click-Here




ali radwani ahradwani.com python projects codeFollow me on Twitter..

By: Ali Radwani

Python: Coffee Consumption P10

October 11, 2021 Leave a comment

Learning : Python, SQlite3, Dataset, Pandas,
Subject: Create Coffee Consumption Application.

[NOTE: To keep the code as simple as we can, We WILL NOT ADD any user input Varevecations. Assuming that our user will Enter the right inputs.]

[ IF THE IS FIRST TIME DOWNLOADING THE CODE FILE, SELECT OPTION 7 FROM MAIN-MENU TO CREATE THE DATABASE]


In this Last part (Part-10) of Coffee Consumption App, we will write a Function to Export the Data to an Excel Fiel, So this will be the Last part of this application and any other Enhancement will be added as new version of the application.

Exporting The Data: To Export the data to or say “writing into” Excel file we need to import New library Named: xlsxwriter [if you don’t have the library then you need to install it first, using this command: pip install xlsxwriter]. After installing we will call it into our python file using this command: import xlsxwriter. The Excel file [in this case] will have four Sheets, named as follow:
coffee_con, coffee_name, coffee_type, coffee_size
each sheet will contains the table header and the date.
File Name: The file name will be as: coffee_consumption_[Current Date & Time].xlsx, the date and time will be formated as: yyyymmdd_HM, the python code to generate this is:
now = datetime.now()
date_t = now.strftime(“%Y%m%d_%H%M”)

Also we need to know that the file will be saved in the same directory of the application or (python .py file)


New Function: from our back_up function we will call another Function called: write_data(data_set,col_list,the_sheet): this Function will write the data-set into Excel file sheet, so we need to pass the data_set, column list and the Sheet Name as arguments to the function and it will use the command: write(row,col,data) to write the row to the sheet. Here is the code

# Writing the data into the sheet

def write_data(data_set,col_list,the_sheet):
    """
    Function to write the data-set into Excel file sheet.
    
    Argument:
        data_set:
        col_list: List of the columns in the data_set.
        the_sheet: the Sheet Name.      
    
    """    
    # write the Table Header
    for x in range (0,len(col_list)):
        the_sheet.write(0,x,col_list[x])
        
    rows = len(data_set)
    for row in range (1,rows) :
        for col in range (0,len(col_list)) :
            the_sheet.write(row,col,data_set[row][col])


In our main back-up function, we prepare the data-set and column list, then we call the new Function write_data passing the variable. Here is two parts of the code, first one is generating the file name, and calling the datetime function, second part is dealing with the data tables in the database, fetching the data, listing the columns and passing this to write_data function.. Here is the code

python project coffee ali doha radwani
python project coffee ali doha radwani

… Done. We finish the Coffee Consumption Application using Python and Sqlite. Next Week we will start New Application ..


..:: Have Fun with Coding ::.. 🙂


Part 1 Part 2 Part 3 Part 4 Part 5
Part 6 Part 7 Part 8 Part 9 Part 10


To Download my Python code (.py) files Click-Here



ali radwani ahradwani.com python projects codeFollow me on Twitter..

By: Ali Radwani

Python: Property Mainenance System

October 6, 2021 1 comment

Project Name: Property Mainenance System
By: Ali Radwani
First-Draf: 5.10.2021 [Brin Storming]


I start writing the outline for a New Project about Renting System, one of the Functions in the system was Property Maintenance Service, then I notes that this Function can be a Stand-Alone System because of it’s Size and Requerment, so i decide to transfer the Property Maintenance Service into an Application.

Here are some Brain-Storming ideas [Not sorted, Not checked, Need to been Reviewed]

  • Submit Maintenance Request (by Tenant) : (For What?: [Bathroom, kitchen, WaterSystem[Colling, Heating], Windoews and Doors, Paints, TV & Aoudio,Insects and Bugs, Roof, Others (If other please write.. )]
  • Request Date,time
  • Property address.
  • Maintenance Suggested Date (by Tenant) [Need Maintenance team appoval]
  • Cost Evaluation. [Tenant Approval Requear]
  • IF Approved. Do Payment,[Cash, cheque, card] Set the Date and Time for the Maintenance.
  • Start the job after payment.()
  • After Maintenance Finsh Close the case.
  • Print Report if requered.
  • —> Tables:
    • Properties: ID, Address[Zone, Street, Building],Type[Villa, Appartment], Bedroom(numbers), Bathroom(numbers), Kitchen(numbers),Car_garage(numbers), Intercome, TV_Cable, Internet, contract_period
    • Maintenance_request: property ID, maintenance for, date_time status[pending, inprogress, complete],
    • Payments: Total Cost, Date, Payed_by, Payment Method[cash,cheuq], Property ID, receipt id.
    • completed: data, property ID, maintenance for, cost,
    • —> look-up tables:
      • job status: [pending, inprogress, complete, ]
      • payment methods: [Cash, Card, cheque,]
      • Maintenance List: [Bathroom, kitchen, WaterSystem[Colling, Heating], Windoews and Doors, Paints, TV & Aoudio, Insects and Bugs, Roof, Others (If other please write.. )]
  • Functions:
    • Main Menu.
    • Add, Edit, Delete [For each Section/Function in the tables/Application]
    • Show Data/Records.
    • Reports
    • submin_request.

… More to be added .. Needs:[Tables Name, ] .. Tables or functions may Merged or Deleted.

Nikon S9900 Shot # 12

October 3, 2021 Leave a comment


Subject: A Photo from Souq-Waqif with Nikon S9900

In 2016 I bought Nikon Coolpix S9900, I have Nikon D90, and Nikon 7100 both are DX (crop sensor), but S9900 is my first Coolpix (point & shoot) camera from Nikon, I use to have Sony T100. [:. Read more about my cameras and lenses Here .:]

This Shot: I was walking in Souq-Waqif one the most famous ‘Bazaar’ in Qatar
I fond this Restaurant, and I take the shot using my Nikon S9900, camera In-Hand.

…Click Image to Enlarge…

Camera in Hand, F:4 , ISO:125 , Shutter:1/640s
Focal-Point:6mm



::.. To see all my Nikon S9900 Photos Click-Here
::.. To see all my Nikon D7100 Photos Click-Here
::.. To see all my Nikon D90 Photos Click-Here


::.. Other Photos From Qatar Click-Here



ali radwani ahradwani.com python projects codeFollow me on Twitter..

By: Ali Radwani