万本电子书0元读

万本电子书0元读

顶部广告

Python for Secret Agents - Volume II电子书

售       价:¥

37人正在读 | 0人评论 9.8

作       者:Steven Lott

出  版  社:Packt Publishing

出版时间:2015-12-08

字       数:119.1万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:此类商品不支持退换货,不支持下载打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Gather, analyze, and decode data to reveal hidden facts using Python, the perfect tool for all aspiring secret agents About This Book Discover the essential features of Python programming: statements, variables, expressions, and many of the built-in data types Use Python’s standard library to do more sophisticated data gathering and analysis Written by a Python programming expert, with over 35 years' experience as a consultant, teacher, author and software developer Who This Book Is For This book is for Secret Agents who have some exposure to Python. Our focus is on the Field Agents who are ready to do more sophisticated and complex programming in Python. We'll stick to simple statistics for the most part. A steady hand with a soldering iron is not required, but a skilled field agent should be able to assemble a working Arduino circuit to gather their own sensor data.What You Will Learn Upgrade Python to the latest version and discover its latest and greatest tools Use Python libraries to extract data from log files that are designed more for people to read than for automated analysis Summarize log files and extract meaningful information Gather data from social networking sites and leverage your experience of analyzing log files to summarize the data you find Extract text and images from social networking sites Parse the complex and confusing data structures in a PDF file to extract meaningful text that we can analyze Connect small, intelligent devices to our computer to use them as remote sensors Use Python to analyze measurements from sensors to calibrate them and use sensors efficiently In Detail Python is easy to learn and extensible programming language that allows any manner of secret agent to work with a variety of data. Agents from beginners to seasoned veterans will benefit from Python's simplicity and sophistication. The standard library provides numerous packages that move beyond simple beginner missions. The Python ecosystem of related packages and libraries supports deep information processing. This book will guide you through the process of upgrading your Python-based toolset for intelligence gathering, analysis, and communication. You'll explore the ways Python is used to analyze web logs to discover the trails of activities that can be found in web and database servers. We'll also look at how we can use Python to discover details of the social network by looking at the data available from social networking websites. Finally, you'll see how to extract history from PDF files, which opens up new sources of data, and you’ll learn about the ways you can gather data using an Arduino-based sensor device. Style and approach Each chapter will include a background briefing that covers an essential Python technology. After some in-depth exploration of the features, the chapter will conclude with a mission that is a concrete application of the Python tools and techniques covered.
目录展开

Python for Secret Agents Volume II

Table of Contents

Python for Secret Agents Volume II

Credits

About the Author

About the Reviewer

www.PacktPub.com

Support files, eBooks, discount offers, and more

Why subscribe?

Free access for Packt account holders

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. New Missions – New Tools

Background briefing on tools

Doing a Python upgrade

Preliminary mission to upgrade pip

Background briefing: review of the Python language

Using variables to save results

Using the sequence collections: strings

Using other common sequences: tuples and lists

Using the dictionary mapping

Comparing data and using the logic operators

Using some simple statements

Using compound statements for conditions: if

Using compound statements for repetition: for and while

Defining functions

Creating script files

Mission One – upgrade Beautiful Soup

Getting an HTML page

Navigating the HTML structure

Doing other upgrades

Mission to expand our toolkit

Scraping data from PDF files

Sidebar on the ply package

Building our own gadgets

Getting the Arduino IDE

Getting a Python serial interface

Summary

2. Tracks, Trails, and Logs

Background briefing – web servers and logs

Understanding the variety of formats

Getting a web server log

Writing a regular expression for parsing

Introducing some regular expression rules and patterns

Finding a pattern in a file

Using regular expression suffix operators

Capturing characters by name

Looking at the CLF

Reading and understanding the raw data

Reading a gzip compressed file

Reading remote files

Studying a log in more detail

What are they downloading?

Trails of activity

Who is this person?

Using Python to run other programs

Processing whois queries

Breaking a request into stanzas and lines

Alternate stanza-finding algorithm

Making bulk requests

Getting logs from a server with ftplib

Building a more complete solution

Summary

3. Following the Social Network

Background briefing – images and social media

Accessing web services with urllib or http.client

Who's doing the talking?

Starting with someone we know

Finding our followers

What do they seem to be talking about?

What are they posting?

Deep Under Cover – NLTK and language analysis

Summary

4. Dredging up History

Background briefing–Portable Document Format

Extracting PDF content

Using generator expressions

Writing generator functions

Filtering bad data

Writing a context manager

Writing a PDF parser resource manager

Extending the resource manager

Getting text data from a document

Displaying blocks of text

Understanding tables and complex layouts

Writing a content filter

Filtering the page iterator

Exposing the grid

Making some text block recognition tweaks

Emitting CSV output

Summary

5. Data Collection Gadgets

Background briefing: Arduino basics

Organizing a shopping list

Getting it right the first time

Starting with the digital output pins

Designing an external LED

Assembling a working prototype

Mastering the Arduino programming language

Using the arithmetic and comparison operators

Using common processing statements

Hacking and the edit, download, test and break cycle

Seeing a better blinking light

Simple Arduino sensor data feed

Collecting analog data

Collecting bulk data with the Arduino

Controlling data collection

Data modeling and analysis with Python

Collecting data from the serial port

Formatting the collected data

Crunching the numbers

Creating a linear model

Reducing noise with a simple filter

Solving problems adding an audible alarm

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部