Learning Python Network Programming

Utilize Python 3 to get network applications up and running quickly and easily
Preview in Mapt

Learning Python Network Programming

Dr. M. O. Faruque Sarker, Sam Washington

1 customer reviews
Utilize Python 3 to get network applications up and running quickly and easily
Mapt Subscription
FREE
$29.99/m after trial
eBook
$28.00
RRP $39.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$28.00
$49.99
$29.99 p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Learning Python Network Programming Book Cover
Learning Python Network Programming
$ 39.99
$ 28.00
Neural Network Programming with Python Book Cover
Neural Network Programming with Python
$ 35.99
$ 25.20
Buy 2 for $35.00
Save $40.98
Add to Cart

Book Details

ISBN 139781784396008
Paperback320 pages

Book Description

Network programming has always been a demanding task. With full-featured and well documented libraries all the way up the stack, Python makes network programming the enjoyable experience it should be.

Starting with a walkthrough of today's major networking protocols, with this book you'll learn how to employ Python for network programming, how to request and retrieve web resources, and how to extract data in major formats over the Web. You'll utilize Python for e-mailing using different protocols and you'll interact with remote systems and IP and DNS networking.

As the book progresses, socket programming will be covered, followed by how to design servers and the pros and cons of multithreaded and event-driven architectures. You'll develop practical client-side applications, including web API clients, e-mail clients, SSH, and FTP. These applications will also be implemented through existing web application frameworks.

Table of Contents

Chapter 1: Network Programming and Python
An introduction to TCP/IP networks
Network programming with Python
Breaking a few eggs
Summary
Chapter 2: HTTP and Working with the Web
Request and response
Requests with urllib
Response objects
Status codes
Handling problems
HTTP headers
Customizing requests
Content negotiation
User agents
Cookies
Redirects
URLs
HTTP methods
Formal inspection
HTTPS
The Requests library
Summary
Chapter 3: APIs in Action
Getting started with XML
The Amazon S3 API
JSON
The Twitter API
HTML and screen scraping
With great power...
Summary
Chapter 4: Engaging with E-mails
E-mail terminologies
Sending e-mails with SMTP
Sending e-mails securely with TLS
Retrieving e-mails by using POP3 with poplib
Retrieving e-mails by using IMAP with imaplib
Sending e-mail attachments
Sending e-mails via the logging module
Summary
Chapter 5: Interacting with Remote Systems
Secure shell – access using Python
Transferring files through SFTP
Transferring files with FTP
Fetching Simple Network Management Protocol data
Reading Light-weight Directory Access Protocol data
Sharing files with SAMBA
Summary
Chapter 6: IP and DNS
Retrieving the network configuration of a local machine
Manipulating IP addresses
GeoIP look-ups
NTP clients
Summary
Chapter 7: Programming with Sockets
Basics of sockets
Working with TCP sockets
Working with UDP sockets
TCP port forwarding
A non-blocking socket I/O
Securing sockets with TLS/SSL
Creating a custom SSL client/server
Summary
Chapter 8: Client and Server Applications
Client and server
An echo protocol
A simple echo server
A simple echo client
Concurrent I/O
Multithreading and multiprocessing
A multithreaded echo server
Designing a chat server
A chat protocol
Handling data on persistent connections
A multithreaded chat server
A multithreaded chat client
Event-driven servers
A low-level event-driven chat server
Frameworks
An eventlet-based chat server
An asyncio-based chat server
More on frameworks
Taking our servers forward
Summary
Chapter 9: Applications for the Web
What's in a web server?
Python and the Web
Flask – a microframework
Hosting Python web applications
Hosting in practice
Summary

What You Will Learn

  • Develop an understanding of network stacks and the power of encapsulation
  • Design high-performance network server applications
  • Implement socket-based network applications using asynchronous models
  • Build client applications for major web APIs, including Amazon S3 and Twitter
  • Interact with e-mail servers using SMTP, POP3, and IMAP protocols
  • Deal with remote network servers using SSH, FTP, SNMP, SMB/CIFS, and LDAP protocols
  • Work with IP addresses including Geo-IP lookups
  • Download objects from the Web and craft custom HTTP requests with urllib and the Requests library

Authors

Table of Contents

Chapter 1: Network Programming and Python
An introduction to TCP/IP networks
Network programming with Python
Breaking a few eggs
Summary
Chapter 2: HTTP and Working with the Web
Request and response
Requests with urllib
Response objects
Status codes
Handling problems
HTTP headers
Customizing requests
Content negotiation
User agents
Cookies
Redirects
URLs
HTTP methods
Formal inspection
HTTPS
The Requests library
Summary
Chapter 3: APIs in Action
Getting started with XML
The Amazon S3 API
JSON
The Twitter API
HTML and screen scraping
With great power...
Summary
Chapter 4: Engaging with E-mails
E-mail terminologies
Sending e-mails with SMTP
Sending e-mails securely with TLS
Retrieving e-mails by using POP3 with poplib
Retrieving e-mails by using IMAP with imaplib
Sending e-mail attachments
Sending e-mails via the logging module
Summary
Chapter 5: Interacting with Remote Systems
Secure shell – access using Python
Transferring files through SFTP
Transferring files with FTP
Fetching Simple Network Management Protocol data
Reading Light-weight Directory Access Protocol data
Sharing files with SAMBA
Summary
Chapter 6: IP and DNS
Retrieving the network configuration of a local machine
Manipulating IP addresses
GeoIP look-ups
NTP clients
Summary
Chapter 7: Programming with Sockets
Basics of sockets
Working with TCP sockets
Working with UDP sockets
TCP port forwarding
A non-blocking socket I/O
Securing sockets with TLS/SSL
Creating a custom SSL client/server
Summary
Chapter 8: Client and Server Applications
Client and server
An echo protocol
A simple echo server
A simple echo client
Concurrent I/O
Multithreading and multiprocessing
A multithreaded echo server
Designing a chat server
A chat protocol
Handling data on persistent connections
A multithreaded chat server
A multithreaded chat client
Event-driven servers
A low-level event-driven chat server
Frameworks
An eventlet-based chat server
An asyncio-based chat server
More on frameworks
Taking our servers forward
Summary
Chapter 9: Applications for the Web
What's in a web server?
Python and the Web
Flask – a microframework
Hosting Python web applications
Hosting in practice
Summary

Book Details

ISBN 139781784396008
Paperback320 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Learning Penetration Testing with Python Book Cover
Learning Penetration Testing with Python
$ 39.99
$ 28.00
Effective Python Penetration Testing Book Cover
Effective Python Penetration Testing
$ 31.99
$ 22.40
Python Network Programming Cookbook Book Cover
Python Network Programming Cookbook
$ 26.99
$ 18.90
Modern Python Cookbook Book Cover
Modern Python Cookbook
$ 39.99
$ 28.00
Python: Penetration Testing for Developers Book Cover
Python: Penetration Testing for Developers
$ 67.99
$ 47.60
Learning Python Application Development Book Cover
Learning Python Application Development
$ 35.99
$ 25.20