Record:   Prev Next
Author McNeil, Jeff
Title Python 2.6 Text Processing Beginners Guide : Beginners Guide
Imprint Olton : Packt Publishing, Limited, 2010
©2010
book jacket
Edition 1st ed
Descript 1 online resource (512 pages)
text txt rdacontent
computer c rdamedia
online resource cr rdacarrier
Note Intro -- Python 2.6 Text Processing Beginner's Guide -- Table of Contents -- Python 2.6 Text Processing Beginner's Guide -- 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 -- Time for action - heading -- What just happened? -- Pop Quiz - heading -- Have a go hero - heading -- Reader feedback -- Customer support -- Errata -- Piracy -- Questions -- 1. Getting Started -- Categorizing types of text data -- Providing information through markup -- Meaning through structured formats -- Understanding freeform content -- Ensuring you have Python installed -- Providing support for Python 3 -- Implementing a simple cipher -- Time for action - implementing a ROT13 encoder -- What just happened? -- Have a go hero - more translation work -- Processing structured markup with a filter -- Time for action - processing as a filter -- What just happened? -- Time for action - skipping over markup tags -- What just happened? -- State machines -- Pop Quiz - ROT 13 processing -- Have a go hero - support multiple input channels -- Supporting third-party modules -- Packaging in a nutshell -- Time for action - installing SetupTools -- What just happened? -- Running a virtual environment -- Configuring virtualenv -- Time for action - configuring a virtual environment -- What just happened? -- Have a go hero - install your own environment -- Where to get help? -- Summary -- 2. Working with the IO System -- Parsing web server logs -- Time for action - generating transfer statistics -- What just happened? -- Using objects interchangeably -- Time for action - introducing a new log format -- What just happened?
Have a go hero - creating a new processing class -- Accessing files directly -- Time for action - accessing files directly -- What just happened? -- Context managers -- Handling other file types -- Time for action - handling compressed files -- What just happened? -- Implementing file-like objects -- File object methods -- close -- fileno -- flush -- read -- readline -- readlines -- seek -- tell -- write -- writelines -- Enabling universal newlines -- Accessing multiple files -- Time for action - spell-checking HTML content -- What just happened? -- Simplifying multiple file access -- Inplace filtering -- Pop Quiz - file-like objects -- Accessing remote files -- Time for action - spell-checking live HTML pages -- What just happened? -- Have a go hero - access web logs remotely -- Error handling -- Time for action - handling urllib 2 errors -- What just happened? -- Handling string IO instances -- Understanding IO in Python 3 -- Summary -- 3. Python String Services -- Understanding the basics of string object -- Defining strings -- Time for action - employee management -- What just happened? -- Building non-literal strings -- Pop Quiz - string literals -- String formatting -- Time for action - customizing log processor output -- What just happened? -- Percent (modulo) formatting -- Mapping key -- Conversion flags -- Minimum width -- Precision -- Width -- Conversion type -- Using string special methods -- Have a go hero - make log processing more readable -- Using the format method approach -- Time for action - adding status code data -- What just happened? -- Making use of conversion specifiers -- Fill -- Align -- Sign -- Width -- Precision -- Type -- Have a go hero - updating the file size check to use the format method -- Creating templates -- Time for action - displaying warnings on malformed lines -- What just happened? -- Template syntax
Rendering a template -- Pop Quiz - string formatting -- Calling string object methods -- Time for action - simple manipulation with string methods -- What just happened? -- Aligning text -- Detecting character classes -- Casing -- Searching strings -- Dealing with lists of strings -- Treating strings as sequences -- Have a go hero - dive into the string object -- Summary -- 4. Text Processing Using the Standard Library -- Reading CSV data -- Time for action - processing Excel formats -- What just happened? -- Time for action - CSV and formulas -- What just happened? -- Reading non-Excel data -- Time for action - processing custom CSV formats -- What just happened? -- Writing CSV data -- Time for action - creating a spreadsheet of UNIX users -- What just happened? -- Pop Quiz - CSV handling -- Have a go hero - detecting CSV dialects -- Modifying application configuration files -- Time for action - adding basic configuration read support -- What just happened? -- Using value interpolation -- Time for action - relying on configuration value interpolation -- What just happened? -- Handling default options -- Time for action - configuration defaults -- What just happened? -- Have a go hero - overriding configuration options -- Writing configuration data -- Time for action - generating a configuration file -- What just happened? -- Have a go hero - clearing configuration defaults -- Reconfiguring our source -- A note on Python 3 -- Time for action - creating an egg-based package -- What just happened? -- Understanding the setup.py file -- Have a go hero - building some eggs! -- Working with JSON -- Time for action - writing JSON data -- What just happened? -- Encoding data -- Decoding data -- Pop Quiz - JSON formatting -- Have a go hero - translating strings to integers -- Summary -- 5. Regular Expressions -- Simple string matching
Time for action - testing an HTTP URL -- What just happened? -- Understanding the match function -- Learning basic syntax -- Detecting repetition -- Specifying character sets and classes -- Applying anchors to restrict matches -- Wrapping it up -- Have a go hero - tidying up our URL test -- Advanced pattern matching -- Grouping -- Time for action - regular expression grouping -- What just happened? -- Have a go hero - updating our stats processor to use named groups -- Using greedy versus non-greedy operators -- Assertions -- Performing an 'or' operation -- Pop Quiz - regular expressions -- Implementing Python-specific elements -- Other search functions -- search -- findall and finditer -- split -- sub -- Compiled expression objects -- Dealing with performance issues -- Parser flags -- Unicode regular expressions -- The match object -- Processing bind zone files -- Time for action - reading DNS records -- What just happened? -- Have a go hero - adding support for ORIGIN -- Pop Quiz - understanding the Pythonisms -- Summary -- 6. Structured Markup -- XML data -- SAX processing -- Time for action - event-driven processing -- What just happened? -- Incremental processing -- Time for action - driving incremental processing -- What just happened? -- Building an application -- Time for action - creating a dungeon adventure game -- What just happened? -- Pop Quiz - SAX processing -- Have a go hero - adding gold -- The Document Object Model -- xml.dom.minidom -- Time for action - updating our game to use DOM processing -- What just happened? -- Have a go hero - cleaning up the dungeon a bit -- Creating and modifying documents programmatically -- Have a go hero - adding multiple dungeons -- XPath -- Accessing XML data using ElementTree -- Time for action - using XPath in our adventure -- What just happened? -- Reading HTML
Time for action - displaying links in an HTML page -- What just happened? -- BeautifulSoup -- Have a go hero - updating link extractor to use BeautifulSoup -- Summary -- 7. Creating Templates -- Time for action - installing Mako -- What just happened? -- Basic Mako usage -- Time for action - loading a simple Mako template -- What just happened? -- Generating a template context -- Have a go hero - understanding context internals -- Managing execution with control structures -- Including Python code -- Time for action - reformatting the date with Python code -- What just happened? -- Adding functionality with tags -- Rendering files with %include -- Generating multiline comments with %doc -- Documenting Mako with %text -- Defining functions with %def -- Time for action - defining Mako def tags -- What just happened? -- Have a go hero - formatting whitespace -- Importing %def sections using %namespace -- Time for action - converting mail message to use namespaces -- What just happened? -- Selectively importing def blocks -- Filtering output -- Expression filters -- Filtering the output of %def blocks -- Setting default filters -- Inheriting from base templates -- Time for action - updating base template -- What just happened? -- Growing the inheritance chain -- Time for action - adding another inheritance layer -- What just happened? -- Inheriting attributes -- Pop Quiz - inheriting from templates -- Customizing -- Custom tags -- Time for action - creating custom Mako tags -- What just happened? -- Customizing filters -- Overviewing alternative approaches -- Summary -- 8. Understanding Encodings and i18n -- Understanding basic character encodings -- ASCII -- Limitations of ASCII -- KOI8-R -- Unicode -- Using Unicode with Python 3 -- Understanding Unicode -- Design goals -- Universality -- Efficiency -- Characters, not glyphs -- Semantics -- Plain text
Logical order
The easiest way to learn how to manipulate text with Python
Description based on publisher supplied metadata and other sources
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2020. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries
Link Print version: McNeil, Jeff Python 2.6 Text Processing Beginners Guide : Beginners Guide Olton : Packt Publishing, Limited,c2010 9781849512121
Subject Electronic digital computers -- Design and construction.;Computer software -- Development
Electronic books
Record:   Prev Next