
Discover the Python x library for word tasks using Pydocx and overview the course structure with eight sections. Access labs, projects, and Python basics to practice with code.
Explore the Colab environment to run code without installation, using a Google account to create notebooks, connect to a server, and upload data while working with text and code cells.
Explore the Python x library to create, update, and extract information from Word documents. Build templates, write simple documents from scratch, and verify citations against references.
Learn to install python-docx and create a Word document with a header and two paragraphs, then save the file using document.save.
Explore the hierarchical structure of word documents, including document, paragraph, and run, and see how styles like bold create distinct runs within paragraphs.
Explore how Python X builds word documents by composing documents, paragraphs, and runs, and apply formatting with bold and italic runs before saving and opening the file.
Learn to break pages in a Word document using the Python X library by inserting a page break between paragraphs and saving the result.
Add images to a document and resize them with inches, saving a docx file in a Python workflow using Pydocx.
Learn to alter font type and size in a Word document using pydocx, creating runs and paragraphs, applying Calabrese 12 and Algerian 22 fonts across two examples.
Learn to read content from Word documents using python-docx by accessing paragraphs and printing their text, demonstrating how to load, inspect, and iterate over document text.
Learn to edit a document by replacing words with Python string replace, save the updated text, and create text using the Python X library.
Five exercises for this chapter teach word tasks with pydocx, including headers and paragraphs, page breaks, text runs with varied formatting, inserting images, and specific font configurations.
Install the Python docx module, import the document class, create a document object, add a header and two paragraphs, and save the file.
Learn to create a docx with a header and three paragraphs, then insert page breaks between paragraphs using Pydocx in Python to place content on separate pages.
Learn to read paragraph text with the text function and add five runs in a document with styles (none, bold, none, italic, none) using pydocx.
Add two images to a document interspersed with three lines of text using the DocX library, by creating a document, adding paragraphs, inserting pictures, and saving the file.
Explore how to set font type and size in runs using pydocx by creating a document, adding paragraphs, configuring runs with different font names and sizes, and saving the result.
Learn to sort bibliographic references in a Word document with Python and Pydocx, by identifying the references section and applying a Python sort before formatting.
Part 1 explains sorting bibliographic references in a document using a Python library. The session covers uploading the file, locating the bibliographic references, and extracting them for sorting.
In this second part, create a variable named order, sort the bibliographic references using the sorted function on the ref list, and insert the now sorted references into the document.
Learn to shuffle questions and alternatives in a test, reorder questions, and print results in a Word document by building functions to shuffle questions and options and print nested lists.
Define user input for a quiz by setting number of questions and alternatives, building the questions list, and collecting each question's options; the example shows two questions with three alternatives.
Learn how to shuffle multiple choice questions using a Python function, including creating a copy of questions, applying random.shuffle, and returning the shuffled list.
Create a Python function to shuffle the alternatives of each question in a multiple choice test. Use copy.deepcopy for safe nested list copies and random.shuffle to reorder options.
Define a change order control function that wraps two shuffling utilities to optionally shuffle questions and their alternatives.
Create a function to present questions with multiple-choice options and numbers, shuffle both questions and options, and prepare to implement these tasks with the Python-docx library.
Use the pydocx library to create a Word document with shuffled questions and alternatives, then save the document.
Explore extracting citations from academic text with regular expressions in Python X library, covering author-year and et al formats, including parenthetical variants, using Google Colab and Pydocx workflows.
Explore step-by-step regular expressions to identify eight citation styles, including author-year formats and et al, within parentheses, using the pipe operator to combine patterns.
Learn to extract citations from a Word document using the Pydocx library, including installing the Python X library, importing the document, parsing text and references, and printing citations.
Apply a simple compression-based approach to align citations with references, detect citations not present in the reference list, and output a Not Present list in Google Colab.
Implement a Python function to compress citations by extracting author names and years with regular expressions, building a compact token-based data structure for citations and references.
Extract and compress citations from text by splitting the reference list on newlines, cleaning spaces, and computing tokens from the first author and year, then verify citations against the list.
Create and run a function that verifies each citation appears in the reference list and reports any that are not present.
Apply a simple algorithm to ensure every reference is cited in the text by iterating each reference through the citations using a compressed structure.
Develop a function to verify that references appear in the citation list, contrasting with checks for citations in the reference list, and test it on a sample Word document.
Use the pydocx library to extract citations and references from real documents, and verify that all citations appear in the reference list and that each reference is cited.
Explore variables and basic data types in Python, including integers, floats, strings, and booleans; learn assignment syntax, printing variables, and verifying types, with a note on collections and future topics.
Master Python arithmetic, including addition, subtraction, multiplication, division, integer division, remainder, exponentiation, roots, and the math module, with emphasis on operator precedence and parentheses.
Explore Python user inputs, including integer, float, and string data types, using the input function to collect age and name and print results.
Explore strings in Python, including length, conversions between strings and numbers, indexing and slicing, f-strings. Also learn replacement, case changes, substring search, newline characters, membership checks, and numeric tests.
Study relational operators for comparing numbers and logical operators for combining true or false expressions, with examples of greater than, less than, and equal to.
Explore conditional statements with if and elif to execute messages based on numeric conditions, such as the number greater than three or not, including ranges like between one and two.
Explore complex and nested conditions in Python, using and and or to combine criteria such as greater than three and even, and implement nested if statements to handle multiple outcomes.
Explore how to use the for loop to iterate over ranges, lists, and strings, printing numbers, names, and characters, including simple operations like adding three and uppercase transformations.
Explain how while loops perform repetitive tasks by counting from one to ten and iterating over data structures, using pseudo code and a print of it's over.
Explore tuples, the first data structure, storing multiple values in one variable; learn indexing, negative indexing, slicing, membership tests with in, and iterating over elements.
Learn to create Python lists with square brackets, access and slice elements, check membership, find max and min, add and remove items with append and remove, and iterate over lists.
Learn to create and manipulate Python dictionaries, using key-value pairs, accessing values by key, adding and deleting entries, and iterating over keys, values, and items.
Learn to create and manipulate sets in Python, a data structure with no repeated elements; convert lists to sets, add elements, and perform union, intersection, and difference operations.
Develop and call functions in Python by defining function names, parameters, and return values; explore multiple and optional parameters, and apply to calculations such as gravitational potential energy.
Explore global and local variable scope, with nested functions and return values. Learn to use docstrings and the help function to document and inspect a density calculator.
Master the Python math module by importing math and using sqrt, log with bases, e and pi, factorial, floor and ceil, and trig functions sin, cos, and tan.
Import the random module and explore functions like random(), randrange(), and choice to generate numbers, integers from a range, or select elements from a list.
Use the time function from the time module to measure algorithm speed and time list-building with different sizes. Use the sleep function to pause execution for set seconds.
Learn to handle errors and exceptions in Python with try and except, customize messages for invalid input, and control flow with else and break, value errors and zero division error.
Learn to work with txt files in python by opening, reading, and printing file lines, then writing a new text file using the write mode and the open function.
Learn how regular expressions enable powerful text pattern searches, extracting emails, capitalized words, and patterns. Explore meta characters, quantifiers, and groups for flexible matching.
Master Python regular expressions with the re module, focusing on search, match, and find all to locate patterns like phone numbers, emails, and car plates.
H! This course is designed to provide a comprehensive introduction to the Python-docx library, which allows users to create, modify, and extract information from Microsoft Word documents.
Throughout the course, you will learn how to use the library's various functions and classes to perform a wide range of operations, including creating and modifying tables, adding images and charts, and working with styles and templates. You will also learn how to extract information from documents, such as text, headings, and tables, and how to use this information in your Python scripts.
Overall, this course is suitable for beginner to intermediate Python developers who want to learn how to work with Word documents in Python. It covers a wide range of functionality and will give you a good starting point to build more advance tools and scripts.
By the end of the course, we have a module dedicated to basic aspects of the programming language Python, for those that have a beginner-level knowledge on it or those that want to review some concepts of the language.
Here are some elements featured in the course:
1. How to install the library
2. The basic structure of a Word document
3. How to create a document
4. How to save a document
5. How to set font size and type
6. How to add images to a document
7. How to change and add runs to a document
8. Exercises with their respective solutions
9. A miniproject to sort bibliographic references
10. A miniproject to create multiple versions of a multiple-choice text