Summer Training Project in Python Programming
Summer Training Project in Python Programming
In
Python Programming
Project Report
submitted in partial fulfilment of the requirements for the
award of the degree of
BACHELOR OF TECHNOLOGY
(COMPUTER SCIENCE AND ENGINEERING)
Undertaken at:
itmtb Technologies
Submitted By:
Tanvi Bansal
Roll No.- 11901161
Regd No. 7141-2019-0261
Table of Contents
2
PREFACE
This work has been done as a part of industrial training. The purpose of industrial
training is to familiarize the students with the present working environment in country
and outside.
To provide the students with the opportunity to study the latest technical trends those
have been established as well as one that what they are learning during the period of
industrial training will certainly help them to develop their potential and technical
skills. The report has been explained with the help of diagrams and figures. The
running project has presented through a CD representation. The subject matter has been
compiled in a simple, illustrative and lucid manner.
Through this project I have learned so many skills and techniques about python and
how I could use it in making other applications.
3
ACKNOWLEDGEMENT
It is my proud privilege and duty to acknowledge the kind of help and guidance received
from several people in preparation of this report. It would not have been possible to prepare
this report in this form without their valuable help, cooperation and guidance.
First and foremost, I wish to record our sincere gratitude to Mr. Aakash Ahuja
founder and CEO of Prospareto and our tutor for the training for their constant
support and encouragement in preparation of this report and for making available
videos and interface facilities needed to prepare this report.
The seminar on “Python” was very helpful to us in giving the necessary background
information and inspiration in choosing this topic for the seminar. Their contributions
and technical support in preparing this report are greatly acknowledged.
Last but not the least, we wish to thank our parents for financing our studies in this
college as well as for constantly encouraging us to learn engineering. Their personal
sacrifice in providing this opportunity to learn engineering is gratefully acknowledge.
TANVI BANSAL
(11901161)
4
DECLARATION
I, Tanvi Bansal , hereby affirm that the project report titled “Summer Training in Python
Programming”, submitted to Punjabi University, Patiala in partial fulfilment of the
requirements for the award of degree of B.Tech. (Computer Science and Engineering) is an
authentic record of my own work and that to the best of my knowledge and belief, it contains
no written material which has been accepted for the qualification of any other degree or
diploma of a university or other institution of higher learning except where due acknowledge
is made.
5
TRAINING COMPLETION LETTER
6
COMPANY PROFILE
itmtb – Ideas That Make Things Better – stands true to its name because here they are
passionate about technology, using it to solve all the problems and make things better. Every
unsatisfactory experience leaves us wondering if they can improve it using technology,
perhaps do it differently, if it will make a good difference to people’s lives. If the answer is
yes, they don’t stop until it’s completed.
Digitisation is the core of their approach. There products are powered by cutting edge
Artificially Intelligent engines.
7
INTRODUCTION TO PYTHON PROGRAMMING
(with codes done for practice as examples)
#What is Python?
Python is Interactive: You can actually sit at a Python prompt and interact
with the interpreter directly to write your programs.
#Python Features :
Python is easy to learn and use. It is developer-friendly and high level programming
language.
8
2) Expressive Language
Python language is more expressive means that it is more understandable and readable.
3) Interpreted Language
Python is an interpreted language i.e. interpreter executes the code line by line at a
time. This makes debugging easy and thus suitable for beginners.
4) Cross-platform Language
Python can run equally on different platforms such as Windows, Linux, Unix
and Macintosh etc. So, we can say that Python is a portable language.
Python language is freely available at official web address. The source- code is also
available. Therefore it is open source.
6) Object-Oriented Language
Python supports object oriented language and concepts of classes and objects come
into existence.
7) Extensible
It implies that other languages such as C/C++ can be used to compile the code and
thus it can be used further in our python code.
Python has a large and broad library and provides rich set of module and functions
for rapid application development.
10) Integrated
9
It can be easily integrated with languages like C, C++, JAVA etc.
Apart from the above-mentioned features, Python has a big list of good
features, few are listed below:
It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
#Python Syntax
Hello world
10
#Datatypes
Built-in Data Types
Variables can store data of different types, and different types can do different things.
Python has the following data types built-in by default, in these categories:
11
#Variables
#Strings
Strings in python are surrounded by either single quotation marks, or double quotation marks.
Like many other popular programming languages, strings in Python are arrays of bytes
representing unicode characters.
However, Python does not have a character data type, a single character is simply a string
with a length of 1.
#Boolean
You can evaluate any expression in Python, and get one of two
answers, True or False.
12
Strings Attributes
13
14
#Operators
Arithmetic operators
15
Relational Operators
16
Logical Operators
17
#List
Lists are one of 4 built-in data types in Python used to store collections of data, the other 3
are Tuple, Set, and Dictionary, all with different qualities and usage.
18
#Tuples
19
Tuples are used to store multiple items in a single variable.
Tuple is one of 4 built-in data types in Python used to store collections of data, the other 3
are List, Set, and Dictionary, all with different qualities and usage.
20
21
#Sets
Set is one of 4 built-in data types in Python used to store collections of data, the other 3
are List, Tuple, and Dictionary, all with different qualities and usage.
myset = {"apple", "banana", "cherry"}
#Dictionaries
A dictionary is a collection which is ordered*, changeable and does not allow duplicates.
22
#Functions
#Classes/Objects
23
INTRODUCTION TO THE PROJECT
Customer Management System ->
On any site when we sign up they ask we want to subscribe for their information on our
email id or updates. Newsletter is very simple things for us whenever we sign up for any site
we start getting updates, newsletters from them. But in certain countries and continents
specially Europe it can be a big deal .
Procter and Gamble which works in more than 180 countries had a lot of challenges back in
2016 and 2017 in Europe and US. GDPR General Data Production Rules which is the
regulation started by American and European government to protect the privacy of the
customer. According to this rule if you get any spam calls you can easily case on them of 1-2
million dollars and also more chances to win . Data Privacy is so strict in these countries.
So, here Procter and Gamble who deals with so many people for them data privacy and
management becomes more problematic.
When this GDPR regulation government gave the time of 8 months to the companies to
change their systems for proper management of customer data.
GDPR consist of many rules , one of them was if a person asks you what data you have of
him than you have to tell it including their history data.
The problem this regulation creates for Procter and Gamble was, the customer management
system of Procter and Gamble that relie on couple of things. Like classifying the customer
properly , when a customer subscribes than sending the information and updates on a same
medium they asked for and these all were a simple part . Challenges came when customer opt
out from the subscription. One day when he ask that he doesn’t want that information
anymore. Now, Procter and Gamble on a daily basis used to run around 2700 campaign.
These would be phone campaign , email campaigns or digital campaigns etc. If you have opt
out from phone campaigns it was the rule of government that within 10 days P&G have to fix
their systems so that from 11th day the customer should not receive that particular
information on that medium. Its sound easy but its not. After GDPR is launched company
was in situation twice where a customer of 20 million dollars just because he received one
extra email. When customer saw that government has come up with such rules some were
happy and some started taking disadvantage of it and started filing cases and taking money
from companies whenever the receive a extra mail or so my mistake. So it was a big issue.
So managing the entire thing it took the team of 21 people to handle its customer
management system . As it was so necessary to build a strong system as it was not easy at all
when we talk about such a big company like Procter and Gamble more than 180 countries,
millions and billions of customers and if government fine you than your legal fees,
reputation, brand value like issues our also main headache.
So, here we are trying to simulate that system that is Customer Management System.
24
Features :
Requirements:
TASK:
New customer id is created. It shall be unique.
Customer's login defaults to certain topics subscriptions.
INPUT FORMAT:
inp={
"f_nm":"Iron",
"l_nm":"Man",
"dob":"",
"g":"m",
"eml":"[email protected]",
"img":"",
"ph":"1765490324",
"al1":"",
"al2":"",
"al3":"",
"tg":"67682983789"
}
OUTPUT FORMAT:
25
If there are errors.
out={
"data":{},
"error":[200, “Invalid address”]
}
SUBTASKS:
Accept incoming data
Check if customer has accessed before using their email address
If yes, then return their customer id
If not, then
generate a new, unique customer id
store customer information the database
store email information in the database
store phone information in the database
store address information in the database
Return newly generated customer id
Convert code to user modular components
DESIGN/PROCESS FLOW:
User logs in to the front end - sends a json to the server
Login function is executed on the server
Return is made after processing
FUNCTIONS NEEDED:
generate a new, unique customer id
Do login checks/processing
Laterly,
System architecture
Python programming as required in commercial applications
Securing python code
Making Python code that performs within SLAs (Service Level Agreements of
code - an agreement between customer and solution developer guaranteeing a
minimum level of performance)
Writing code that scales with increasing workload
Integrating with database
Building secure APIs in Python
26
Platform to be used for build
AWS
Is built on the same lines as the Prospareto production cloud setup. And I am provided
with the access of it.
Used:
RDS for MySQL
EC2 for Linux compute nodes
Gunicorn for web server
Architecture to be created
MySQL backend
Database access control through MySQL/Data access controlled from Python
Main Python classes serving API requests
Common modules
API Security layer designed in Python
Endpoint layer
Gunicorn web server for handling requests
Processes
Requirement gathering
High level design
Low level design
Development
Unit testing
Integration testing
Deployment
Early Life Support (ELS)
Close
Involves
History processing
Logging/Auditing
Error handling/not sending real error to user
Surrogate key generator
27
CODE OF THE PROJECT
28
29
30
31
RESULT
32
SHORT PROJECT FOR PRACTICE
33
BIBLOGRAPHY
The following sites are used to fulfil the requirements of proposed project and are helpful in
understanding, development and the maintenance of the project
. 1. https://www.tutorialspoint.com/python/index.htm
2. https://www.javatpoint.com/python-tutorial
34