O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Automate it! - Recipes to upskill your business

Book Description

Put your life on autopilot and make your business processes efficient with the magic and power of Python!

About This Book

  • Learn how to construct Python scripts to scrape data, manipulate files, and access websites' APIs
  • Get to know about the different types of bots, look at how to develop a simple chat bot and how bots can be used to automate business processes
  • This book is written in Python 3.5 syntax to future-proof your automation and you'll get an understanding of how to customize the scripts to meet your future automation needs

Who This Book Is For

Our audience is programmers who know Python but need not be experts. They will however know a lot of the basics of the syntax and some basic experience with the command line. Ultimately, they're people who see themselves as busy and want to find cool hacks to automate all the mundane and time-consuming tasks they find themselves doing on a daily basis.

What You Will Learn

  • Implement file deduplication and how to parse HTML content in Python.
  • Study an example application that will enable you to work with spreadsheets
  • Get acquainted with the Python modules used to work with e-mails
  • Manipulate images using Pillow and schedule tasks with respect to time zones
  • Use XML or JSON as a message format across distributed systems
  • Develop a Python application with logging and see an example of debugging
  • Integrate Python with Mongo and Redis databases
  • Generate reports using Pandas

In Detail

This book gives you a great selection of recipes to automate your business processes with Python, and provides a platform for you to understand how Python is useful to make time consuming and repetitive business tasks more efficient. Python is a mature high level language, has object-oriented programming features, powers various apps, has a huge set of modules, and great community support. Python is extremely easy to use, can help you get complex tasks done efficiently and is an apt choice for our needs.

With a classic problem-solution based approach and real-world examples, you will delve into things that automate your business processes. You will begin by learning about the Python modules to work with Web, Worksheets, Presentations and PDFs. You'll leverage Python recipes to automate processes in HR, Finance and making them efficient and reliable. For instance, company payroll — an integral process in HR will be automated with Python recipes.

A few chapters of this book will also help you gain knowledge on working with bots and computer vision. You will learn how to build bots for automating business use cases by integrating artificial intelligence. You'll also understand how Python is helpful in face detection and building a scanner of your own. You will see how to effectively and easily use Python code to manage SMS and voice notifications, opening a world of possibilities using cloud telephony to solve your business needs. Moving forward, you will learn to work with APIs, Webhooks and Emails to automate Marketing and Customer Support processes. Finally, using the various Python libraries, this book will arm you with knowledge to customize data solutions and generate reports to meet your business needs.

This book will help you up-skill and make your business processes efficient with the various Python recipes covered in this book.

Style and approach

Recipes to automate your life with Python will open your eyes to new ways to automate nearly anything you can achieve with a mouse and keyboard.In it, you'll learn how to construct Python scripts to scrape data, super-charge Excel, manipulate files, access websites APIs and much more. Our recipe-based approach will ensure that you know the purpose of a code block, and the steps you need to take to achieve that are presented in an easily digestible manner.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Automate it!
    1. Automate it!
    2. Credits
    3. About the Author
    4. About the Reviewer
    5. www.PacktPub.com
      1. Why subscribe?
    6. Customer Feedback
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Sections
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. There's more…
        5. See also
      5. Conventions
      6. Reader feedback
      7. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book 
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Working with the Web
      1. Introduction
      2. Making HTTP requests
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      3. A brief look at web scraping
        1. Legality of web scraping
        2. Getting ready
        3. How to do it...
        4. How it works...
        5. There's more...
      4. Parsing and extracting web content
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      5. Downloading content from the Web
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Working with third-party REST APIs
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      7. Asynchronous HTTP server in Python
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      8. Web automation with selenium bindings
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      9. Automating lead generation with web scraping
        1. Legality of web scraping
        2. Getting ready
        3. How to do it...
        4. How it works...
    9. 2. Working with CSV and Excel Worksheets
      1. Introduction
      2. Reading CSV files with reader objects
        1. Getting ready
        2. How to do it...
        3. There's more...
      3. Writing data into CSV files
        1. How to do it...
      4. Developing your own CSV dialects
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Managing employee information in an automated way
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Reading Excel sheets
        1. Getting ready
        2. How to do it...
        3. How it works...
      7. Writing data into worksheets
        1. Getting ready
        2. How to do it...
        3. How it works...
      8. Formatting Excel cells
        1. Getting ready
        2. How to do it...
        3. There's more...
      9. Playing with Excel formulae
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      10. Building charts within Excel sheets
        1. Getting ready
        2. How to do it...
      11. Automating the comparison of company financials
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
    10. 3. Getting Creative with PDF Files and Documents
      1. Introduction
      2. Extracting data from PDF files
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      3. Creating and copying PDF documents
        1. Getting ready
        2. How to do it...
      4. Manipulating PDFs (adding header/footer, merge, split, delete)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      5. Automating generation of payslips for finance department
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      6. Reading Word documents
        1. Getting ready
        2. How to do it...
      7. Writing data into Word documents (adding headings, images, tables)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      8. Generating personalized new hire orientation for HR team in an automated way
        1. Getting ready
        2. How to do it...
        3. How it works...
    11. 4. Playing with SMS and Voice Notifications
      1. Introduction
      2. Registering with a cloud telephony provider
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      3. Sending text messages
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      4. Receiving SMS messages
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      5. SMS workflows for Domino's
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      6. Sending voice messages
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      7. Receiving voice calls
        1. Getting ready
        2. How to do it...
        3. How it works...
      8. Building your own customer service software
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
    12. 5. Fun with E-mails
      1. Introduction
      2. Sending e-mail messages
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      3. E-mail encryption
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      4. Beautifying e-mail messages with MIME
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. E-mail messages with attachments
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Connecting to your inbox
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      7. Fetching and reading e-mail messages
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      8. Marking e-mail messages
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      9. Clearing up e-mail messages from your inbox
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      10. Automating customer support flows with with e-mail responses
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
    13. 6. Presentations and More
      1. Introduction
      2. Reading PowerPoint presentations
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      3. Creating and updating presentations, and adding slides
        1. How to do it...
        2. How it works...
        3. There's more...
      4. Playing with layouts, placeholders, and textboxes
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Working with different shapes and adding tables
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      6. Visual treat with pictures and charts
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      7. Automating weekly sales reports
        1. Getting ready
        2. How to do it...
        3. How it works...
    14. 7. Power of APIs
      1. Introduction
      2. Designing your own REST APIs
        1. How to do it...
        2. How it works...
        3. There's more...
      3. Automating social media marketing with Twitter APIs
        1. Getting ready
        2. How to do it...
        3. How it works...
      4. An introduction to Webhooks
      5. Implementing Webhooks
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      6. Automating lead management with Webhooks
        1. How to do it...
        2. How it works...
    15. 8. Talking to Bots
      1. Introduction
        1. What are bots?
        2. How do bots work?
        3. Why bots now?
      2. Building a moody Telegram bot
        1. How to do it...
        2. How it works...
        3. There's more...
      3. Different types of bots
      4. A smart bot with artificial intelligence
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Automating business processes with bots
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
    16. 9. Imagining Images
      1. Introduction
        1. Image attributes
      2. Converting images
        1. How to do it...
        2. How it works...
        3. There's more...
      3. Resizing, cropping, and generating thumbnails
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      4. Copy-pasting and watermarking images
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Image differences and comparison
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      6. Face detection
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      7. Imaging as a business process
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
    17. 10. Data Analysis and Visualizations
      1. Introduction
        1. Steps to data-based decision making
      2. Reading, selecting, and interpreting data with visualizations
        1. How to do it...
        2. How it works...
      3. Generating insights using data filtering and aggregation
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      4. Automating social media analysis for businesses
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
    18. 11. Time in the Zone
      1. Introduction
      2. Working with time, date, and calendar
        1. How to do it...
        2. How it works...
      3. Comparing and combining the date and time objects, and date arithmetic
        1. Getting ready
        2. How to do it...
        3. How it works...
      4. Formatting and parsing dates
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Dealing with time zone calculations
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Automating invoicing based on user time zone
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...