Python Console Application Development 2
Python Console Application Development 2
Company Profile
1.1 Introduction
Udemy is the world’s largest marketplace for teaching and learning. Tens of thousands of expert
instructors have published online courses on Udemy on everything from programming to yoga,
marketing to guitar, photography to cake decorating, and much more. Millions of students in
190+ countries are taking these courses to advance their careers and pursue their passions. Each
course is available on-demand, 24 / 7, via the iPhone, iPad, Android and Web. Organizations al-
so use Udemy for Organizations (UFO), a corporate online learning platform that provides train-
ing solutions to thousands of companies.
Key Facts
• The top 10 Udemy experts have earned over $10 million teaching online (as of January
2014)
• Over 50 experts have earned $50,000 or more teaching on Udemy (as of January 2014)
Udemy is a global marketplace for learning and teaching online where students are mastering
new skills and achieving their goals by learning from an extensive library of over 80,000 courses
taught by expert instructors.
Page 1
1.2 Some Clients of Company
In addition to being the world’s largest online learning marketplace, we’re the learning solution
that organizations choose for employee up-skilling and development. We help people at compa-
nies like Lyft, PayPal, Century21, MetLife, and Volkswagen do whatever comes next through a
curated collection of top-rated business and technical courses.
1. Pinterest
2. Malwarebytes
3. TBC Corporation
4. Ellation
5. PayPal
6. Adidas
7. Mercedes Benz
Page 2
1.3 Company Services in Technology
Udemy’s tech stack includes: AngularJS, Bootstrap, Cloudflare, Comodo SSL, Datadog, Django,
Elasticsearch, Fastly, GlobalSign, HTML5, Jenkins, jQuery, Memcached, MySQL, nginx, PHP,
Python, Raven.js, Redis, Sentry, Symantec SSL, Zencoder.
Support & Sales: Elucify, InsideView, Intercom, Salesforce Sales Cloud, Qualaroo,
Zendesk
Page 3
2. TECHNOLOGY
Development Environments
Most Python implementations (including CPython) include a read–eval–print loop (REPL), per-
mitting them to function as a command line interpreter for which the user enters statements se-
quentially and receives results immediately.
Other shells, including IDLE and IPython, add further abilities such as auto-completion, session
state retention and syntax highlighting.
Page 4
Applications for Python
The Python Package Index lists thousands of third party modules for Python.
JSON
E-mail processing.
BeautifulSoup, an HTML parser that can handle all sorts of oddball HTML.
Page 5
Scientific and Numeric
IPython is a powerful interactive shell that features easy editing and recording of a work
session, and supports visualizations and parallel computing.
The Software Carpentry Course teaches basic skills for scientific computing, running
bootcamps and providing open-access teaching materials.
Education
Python is a superb language for teaching programming, both at the introductory level and in
more advanced courses.
The Education Special Interest Group is a good place to discuss teaching issues.
Desktop GUIs
Some toolkits that are usable on several platforms are available separately:
wxWidgets
GTK+
Page 6
Software Development
Python is often used as a support language for software developers, for build control and
management, testing, and in many other ways.
Buildbot and Apache Gump for automated continuous compilation and testing.
Business Applications
Page 7
Libraries Used
1. Datetime — Basic date and time types: The datetime module supplies classes for manipulat-
ing dates and times in both simple and complex ways. While date and time arithmetic is sup-
ported, the focus of the implementation is on efficient attribute extraction for output formatting
and manipulation. For related functionality, see also the time and calendar modules.
The datetime module exports the following constants:
datetime.MINYEAR
The smallest year number allowed in a date or datetime object. MINYEAR is 1.
datetime.MAXYEAR
The largest year number allowed in a date or datetime object. MAXYEAR is 9999.
A date object represents a date (year, month and day) in an idealized calendar, the current Gre-
gorian calendar indefinitely extended in both directions. January 1 of year 1 is called day number
1, January 2 of year 1 is called day number 2, and so on. This matches the definition of the “pro-
leptic Gregorian” calendar in Dershowitz and Reingold’s book Calendrical Calculations, where
it’s the base calendar for all computations. See the book for algorithms for converting between
proleptic Gregorian ordinals and many other calendar systems.
A datetime object is a single object containing all the information from a date object and
a time object. Like a date object, datetime assumes the current Gregorian calendar extended in
both directions; like a time object, datetime assumes there are exactly 3600*24 seconds in every
day.
Constructor:
Page 8
2. Tkinter: The Tkinter module (“Tk interface”) is the standard Python interface to the Tk GUI
toolkit. Both Tk and Tkinter are available on most Unix platforms, as well as on Windows sys-
tems. (Tk itself is not part of Python; it is maintained at ActiveState.)
Running python -m Tkinter from the command line should open a window demonstrating a sim-
ple Tk interface, letting you know that Tkinter is properly installed on your system, and also
showing what version of Tcl/Tk is installed, so you can read the Tcl/Tk documentation specific
to that version.
3. JSON: JSON (JavaScript Object Notation), specified by RFC 7159 (which obsoletes RFC
4627) and by ECMA-404, is a lightweight data interchange format inspired by JavaScript object
literal syntax (although it is not a strict subset of JavaScript [1] ).
json exposes an API familiar to users of the standard library marshal and pickle modules.
If skipkeys is true (default: False), then dict keys that are not of a basic type
(str, unicode, int, long, float, bool, None) will be skipped instead of raising
a TypeError.
Page 9
If ensure_ascii is true (the default), all non-ASCII characters in the output are escaped
with \uXXXX sequences, and the result is a str instance consisting of ASCII characters
only. If ensure_ascii is false, some chunks written to fp may be unicode instances. This
usually happens because the input contains unicode strings or the encoding parameter is
used. Unless fp.write() explicitly understands unicode (as in codecs.getwriter()) this is
likely to cause an error.
If check_circular is false (default: True), then the circular reference check for container
types will be skipped and a circular reference will result in an OverflowError (or
worse).
If indent is a non-negative integer, then JSON array elements and object members will be
pretty-printed with that indent level. An indent level of 0, or negative, will only insert
newlines. None (the default) selects the most compact representation.
4. Requests: Requests allows you to send organic, grass-fed HTTP/1.1 requests, without the need
for manual labor. There’s no need to manually add query strings to your URLs, or to form-
encode your POST data. Keep-alive and HTTP connection pooling are 100% automatic. Re-
quests is the perfect example how beautiful an API can be with the right level of abstraction.
Nike, Twitter, Spotify, Microsoft, Amazon, Lyft, BuzzFeed, Reddit, The NSA, Her Majesty’s
Government, Google, Twilio, Runscope, Mozilla, Heroku, PayPal, NPR, Obama for America,
Transifex, Native Instruments, The Washington Post, SoundCloud, Kippt, Sony, and Federal
U.S. Institutions that prefer to be unnamed claim to use Requests internally.
Requests is the perfect example how beautiful an API can be with the right level of ab-
straction.
Matt DeBoard—
I’m going to get Kenneth Reitz’s Python requests module tattooed on my body, somehow.
The whole thing.
Daniel Greenfeld—
Nuked a 1200 LOC spaghetti code library with 10 lines of code thanks to Kenneth Reitz’s
Requests library. Today has been AWESOME.
Kenny Meyers—
Page
10
Python HTTP: When in doubt, or when not in doubt, use Requests. Beautiful, simple, Py-
thonic.
Requests is one of the most downloaded Python packages of all time, pulling in over 400,000
downloads each day. Join the party!
If your organization uses Requests internally, consider supporting the development of 3.0. Your
generosity will be greatly appreciated, and help drive the project forward into the future.
Beloved Features
Requests officially supports Python 2.7 & 3.4–3.7, and runs great on PyPy.
5. OS: This module provides a portable way of using operating system dependent functionality. If
you just want to read or write a file see open(), if you want to manipulate paths, see
the os.path module, and if you want to read all the lines in all the files on the command line see
the fileinput module. For creating temporary files and directories see the tempfile module, and
for high-level file and directory handling see the shutil module.
Page
11
The design of all built-in operating system dependent modules of Python is such that as
long as the same functionality is available, it uses the same interface; for example, the
function os.stat(path) returns stat information about path in the same format (which hap-
pens to have originated with the POSIX interface).
Extensions peculiar to a particular operating system are also available through
the os module, but using them is of course a threat to portability.
All functions accepting path or file names accept both bytes and string objects, and result
in an object of the same type, if a path or file name is returned.
An “Availability: Unix” note means that this function is commonly found on Unix sys-
tems. It does not make any claims about its existence on a specific operating system.
If not separately noted, all functions that claim “Availability: Unix” are supported on
Mac OS X, which builds on a Unix core.
6. PRETTYTABLE: PrettyTable is a simple Python library designed to make it quick and easy to
represent tabular data in visually appealing ASCII tables. It was inspired by the ASCII tables
used in the PostgreSQL shell psql. PrettyTable allows for selection of which columns are to be
printed, independent alignment of columns (left or right justified or centred) and printing of
“sub-tables” by specifying a row range.
PrettyTable is a Python library for generating simple ASCII tables. It was inspired by the ASCII
tables used in the PostgreSQL shell psql. We can control many aspects of a table, such as the
width of the column padding, the alignment of text, or the table border. We can sort data.
We can also choose which columns and rows are going to be displayed in the final output. Pret-
tyTable can read data from CSV, HTML, or database cursor and output data in ASCII or
HTML.
PrettyTable installation:
Generating PrettyTable:
Page
12
3. PROJECT WORK
3.1 PROJECT 1: CRYPTOCURRENCY PORTFOLIO
3.1.1 Objective: Crypto currency Portfolio is a console application which provides user the in-
formation related to the price of various cryptocurrencies in which he has invested some certain
amount along withit, it also shows the user the information about variation in the value of those
cryptcurrency in past 1 hour, 1 day and 1 week.
The objective of maintaining the portfolio is to provide the user a comfortable environment in
which he can get the information regarding amount of cryptocurrency he has invested in without
sacrificing his details and whereabouts.
3.1.2 Scope: The crypto currency market has returned over 900% since the beginning of 2017 (at
the time of writing this). You cannot find these kinds of return on investments in the stock mar-
ket or anywhere. That’s why this portfolio helps a lot in keeping an eye on your investment.
Cryptocurrency is a growing decentralized currency which gives higher and safer returns than
stock market, due to which it is better to invest in for getting better returns. User can keep an eye
on the worth of his investment without going to any other party.
Technologies Used:
Python
Atom text editor
Coinmarketcap API
Page
13
3.1.3 Output Screen and Coding:
Output Screen
Code
import os
import json
import requests
init(convert=True)
convert = 'USD'
Page
14
listings_url = 'https://api.coinmarketcap.com/v2/listings/?convert=' + convert
request = requests.get(listings_url)
results = request.json()
data = results['data']
ticker_url_pairs = {}
symbol = currency['symbol']
url = currency['id']
ticker_url_pairs[symbol] = url
print()
print('MY PORTFOLIO')
print()
portfolio_value = 0.00
last_updated = 0
table = PrettyTable(['Asset', 'Amount Owned', convert + ' Value', 'Price', '1h', '24h', '7d'])
Page
15
ticker, amount = line.split()
ticker = ticker.upper()
request = requests.get(ticker_url)
results = request.json()
currency = results['data'][0]
rank = currency['rank']
name = currency['name']
last_updated = currency['last_updated']
symbol = currency['symbol']
quotes = currency['quotes'][convert]
hour_change = quotes['percent_change_1h']
day_change = quotes['percent_change_24h']
week_change = quotes['percent_change_7d']
price = quotes['price']
if hour_change > 0:
else:
Page
16
hour_change = Back.RED + str(hour_change) + '%' + Style.RESET_ALL
if day_change > 0:
else:
if week_change > 0:
else:
portfolio_value += value
value_string = '{:,}'.format(round(value,2))
amount,
'$' + value_string,
'$' + str(price),
str(hour_change),
str(day_change),
str(week_change)])
print(table)
Page
17
print()
portfolio_value_string = '{:,}'.format(round(portfolio_value,2))
print()
print()
Page
18
3.2 PROJECT 2: CRYPTOCURRENCY ALERTS
3.2.1 Objective: This is also a console based application, in which user will set a certain value at
which he aims to sell his assets to get an alert message when any cryptocurrency will hit certain
value, at which user wants to sell his assets.
3.2.2 Scope: The crypto currency market has returned over 900% since the beginning of 2017 (at
the time of writing this). You cannot find these kinds of return on investments in the stock mar-
ket or anywhere. So it will be very favorable if you will get notified when the cryptocurency hits
the desired value.
Technologies Used:
Python
Atom text editor
Coinmarketcap API
Page
19
3.2.3 Output Screen and Coding:
Output Screen
Code
import os
import json
import time
import requests
convert = 'USD'
Page
20
request = requests.get(listings_url)
results = request.json()
data = results['data']
ticker_url_pairs = {}
symbol = currency['symbol']
url = currency['id']
ticker_url_pairs[symbol] = url
print()
print('ALERTS TRACKING...')
print()
already_hit_symbols = []
while True:
ticker = ticker.upper()
Page
21
request = requests.get(ticker_url)
results = request.json()
currency = results['data'][0]
name = currency['name']
last_updated = currency['last_updated']
symbol = currency['symbol']
quotes = currency['quotes'][convert]
price = quotes['price']
already_hit_symbols.append(symbol)
print('...')
time.sleep(300)
Page
22
Data Flow Diagram
Submit Value
Run Program
SYSTEM USER
Enter Input
Page
23
5. Requirement & Analysis
5.1 PERT Chart
Start
Project Code
Learn Python Simulator
Resources Compile
Code
Create Revise
Schedule Schedule
Page
24
Gantt Chart
Page
25
5.2Software and Hardware Requirement
Software :
Hardware :
Page
26
6. References
1. Udemy Courses
2. Stackoverflow.com
3. Geeksforgeeks.com
Page
27