From af9971071b328a1c942d1852e1f56d72f81f7b78 Mon Sep 17 00:00:00 2001 From: Surya Teja <94suryateja@gmail.com> Date: Sun, 16 Dec 2018 19:08:05 +0530 Subject: [PATCH 001/115] Added windows virtual environment activation command. Closes #942 --- docs/dev/virtualenvs.rst | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 11f924882..4d629d8dc 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -226,23 +226,26 @@ Basic Usage .. code-block:: console $ cd my_project_folder - $ virtualenv my_project + $ virtualenv venv -``virtualenv my_project`` will create a folder in the current directory which will +``virtualenv venv`` will create a folder in the current directory which will contain the Python executable files, and a copy of the ``pip`` library which you can use to install other packages. The name of the virtual environment (in this -case, it was ``my_project``) can be anything; omitting the name will place the files +case, it was ``venv``) can be anything; omitting the name will place the files in the current directory instead. +.. note:: + 'venv' is the general convention used globally. As it is readily available in ignore files (eg: .gitignore') + This creates a copy of Python in whichever directory you ran the command in, -placing it in a folder named :file:`my_project`. +placing it in a folder named :file:`venv`. You can also use the Python interpreter of your choice (like ``python2.7``). .. code-block:: console - $ virtualenv -p /usr/bin/python2.7 my_project + $ virtualenv -p /usr/bin/python2.7 venv or change the interpreter globally with an env variable in ``~/.bashrc``: @@ -254,12 +257,20 @@ or change the interpreter globally with an env variable in ``~/.bashrc``: .. code-block:: console - $ source my_project/bin/activate + $ source venv/bin/activate The name of the current virtual environment will now appear on the left of -the prompt (e.g. ``(my_project)Your-Computer:your_project UserName$)`` to let you know +the prompt (e.g. ``(venv)Your-Computer:your_project UserName$)`` to let you know that it's active. From now on, any package that you install using pip will be -placed in the ``my_project`` folder, isolated from the global Python installation. +placed in the ``venv`` folder, isolated from the global Python installation. + +For windows, same command which is mentioned in step 1 can be used for creation of virtual environment. But, to activate, we use the following command. + +Assuming that, you are in project directory: + +.. code-block:: powershell + + PS C:\Users\suryav> \venv\bin\activate Install packages as usual, for example: @@ -284,6 +295,9 @@ After a while, though, you might end up with a lot of virtual environments littered across your system, and its possible you'll forget their names or where they were placed. +.. note:: + Python has included virtual environment module from 3.3. It works in the simliar way as mentioned above. For details: `venv `_. + Other Notes ~~~~~~~~~~~ From 8a6b1c73bf685f2105682ad032c9c0d3b5f59ad6 Mon Sep 17 00:00:00 2001 From: Harish Kesava Rao Date: Sun, 16 Dec 2018 22:35:35 -0600 Subject: [PATCH 002/115] issue-938: added sections in serialization for simple file, csv, yaml, json --- docs/scenarios/serialization.rst | 142 ++++++++++++++++++++++++++++++- 1 file changed, 141 insertions(+), 1 deletion(-) diff --git a/docs/scenarios/serialization.rst b/docs/scenarios/serialization.rst index 559ad3651..ef4a19325 100644 --- a/docs/scenarios/serialization.rst +++ b/docs/scenarios/serialization.rst @@ -12,10 +12,150 @@ What is data serialization? Data serialization is the concept of converting structured data into a format that allows it to be shared or stored in such a way that its original -structure to be recovered. In some cases, the secondary intention of data +structure can be recovered or reconstructed. In some cases, the secondary intention of data serialization is to minimize the size of the serialized data which then minimizes disk space or bandwidth requirements. +******************** +Flat vs. Nested data +******************** + +Before beginning to serialize data, it is important to identify or decide how the +data needs to be structured during data serialization - flat or nested. +The differences in the two styles are shown in the below examples. + +Flat style: + +.. code-block:: python + + { "Type" : "A", "field1": "value1", "field2": "value2", "field3": "value3" } + + +Nested style: + +.. code-block:: python + + {"A" + { "field1": "value1", "field2": "value2", "field3": "value3" } } + + +For more reading on the two styles, please see the discussion on +`Python mailing list `__, +`IETF mailing list `__ and +`here `__. + +**************** +Serializing Text +**************** + +======================= +Simple file (flat data) +======================= + +If the data to be serialized is located in a file and contains flat data, Python offers two methods to serialize data. + +repr +---- + +The repr method in Python takes a single object parameter and returns a printable representation of the input + +.. code-block:: python + + # input as flat text + a = { "Type" : "A", "field1": "value1", "field2": "value2", "field3": "value3" } + + # the same input can also be read from a file + a = + + # returns a printable representation of the input; + # the output can be written to a file as well + print(repr(a)) + + # write content to files using repr + with open('/tmp/file.py') as f:f.write(repr(a)) + +ast.literal_eval +________________ + +The literal_eval method safely parses and evaluates an expression for a Python datatype. +Supported data types are: strings, numbers, tuples, lists, dicts, booleans and None. + +.. code-block:: python + + with open('/tmp/file.py', 'r') as f: inp = ast.literal_eval(f.read()) + +==================== +CSV file (flat data) +==================== + +The CSV module in Python implements classes to read and write tabular +data in CSV format. + +Simple example for reading: + +.. code-block:: python + + import csv + with open('/tmp/file.csv', newline='') as f: + reader = csv.reader(f) + for row in reader: + print(row) + +Simple example for writing: + +.. code-block:: python + + import csv + with open('/temp/file.csv', 'w', newline='') as f: + writer = csv.writer(f) + writer.writerows(iterable) + + +The module's contents, functions and examples can be found +`here `__. + +================== +YAML (nested data) +================== + +There are many third party modules to parse and read/write YAML file +structures in Python. One such example is below. + +.. code-block:: python + + import yaml + with open('/tmp/file.yaml', 'r', newline='') as f: + try: + print(yaml.load(f)) + except yaml.YAMLError as ymlexcp: + print(ymlexcp) + +Documentation on the third party module can be found +`here `__. + +======================= +JSON file (nested data) +======================= + +Python's JSON module can be used to read and write JSON files. +Example code is below. + +Reading: + +.. code-block:: python + + import json + with open('/tmp/file.json', 'r') as f: + data = json.dump(f) + +Writing: + +.. code-block:: python + + import json + with open('/tmp/file.json', 'w') as f: + json.dump(data, f, sort_keys=True) + ****** Pickle From fd2a8f3e8ff91f5a3098458ea022fcbbaf4527d8 Mon Sep 17 00:00:00 2001 From: Harish Kesava Rao Date: Mon, 17 Dec 2018 21:02:21 -0600 Subject: [PATCH 003/115] Final commit --- docs/scenarios/serialization.rst | 58 +++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/docs/scenarios/serialization.rst b/docs/scenarios/serialization.rst index ef4a19325..5ba84fa60 100644 --- a/docs/scenarios/serialization.rst +++ b/docs/scenarios/serialization.rst @@ -74,8 +74,9 @@ The repr method in Python takes a single object parameter and returns a printabl # write content to files using repr with open('/tmp/file.py') as f:f.write(repr(a)) + ast.literal_eval -________________ +---------------- The literal_eval method safely parses and evaluates an expression for a Python datatype. Supported data types are: strings, numbers, tuples, lists, dicts, booleans and None. @@ -95,6 +96,7 @@ Simple example for reading: .. code-block:: python + # Reading CSV content from a file import csv with open('/tmp/file.csv', newline='') as f: reader = csv.reader(f) @@ -105,6 +107,7 @@ Simple example for writing: .. code-block:: python + # Writing CSV content to a file import csv with open('/temp/file.csv', 'w', newline='') as f: writer = csv.writer(f) @@ -123,6 +126,7 @@ structures in Python. One such example is below. .. code-block:: python + # Reading YAML content from a file using the load method import yaml with open('/tmp/file.yaml', 'r', newline='') as f: try: @@ -144,22 +148,66 @@ Reading: .. code-block:: python + # Reading JSON content from a file import json with open('/tmp/file.json', 'r') as f: - data = json.dump(f) + data = json.load(f) Writing: .. code-block:: python + # writing JSON content to a file using the dump method import json with open('/tmp/file.json', 'w') as f: json.dump(data, f, sort_keys=True) +================= +XML (nested data) +================= + +XML parsing in Python is possible using the `xml` package. + +Example: + +.. code-block:: python + + # reading XML content from a file + import xml.etree.ElementTree as ET + tree = ET.parse('country_data.xml') + root = tree.getroot() + +More documentation on using the `xml.dom` and `xml.sax` packages can be found +`here `__. + + +******* +Binary +******* + +======================= +Numpy Array (flat data) +======================= -****** -Pickle -****** +Python's Numpy array can be used to serialize and deserialize data to and from byte representation. + +Example: + +.. code-block:: python + + import numpy as np + + # Converting Numpy array to byte format + byte_output = np.array([ [1, 2, 3], [4, 5, 6], [7, 8, 9] ]).tobytes() + + # Converting byte format back to Numpy array + array_format = np.frombuffer(byte_output) + + + +==================== +Pickle (nested data) +==================== The native data serialization module for Python is called `Pickle `_. From a622afa235d77488e35b0262a2d1635db10b75c7 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Mon, 17 Dec 2018 18:19:53 -0500 Subject: [PATCH 004/115] More typo, grammar, and style fixes --- CONTRIBUTING.md | 2 +- docs/dev/env.rst | 2 +- docs/intro/documentation.rst | 4 +-- docs/intro/learning.rst | 46 +++++++++++++++++--------------- docs/intro/news.rst | 4 +-- docs/notes/styleguide.rst | 5 ++-- docs/scenarios/admin.rst | 30 ++++++++++----------- docs/scenarios/ci.rst | 19 +++++++------ docs/scenarios/cli.rst | 29 ++++++++++---------- docs/scenarios/clibs.rst | 8 +++--- docs/scenarios/crypto.rst | 14 +++++----- docs/scenarios/db.rst | 18 ++++++------- docs/scenarios/gui.rst | 18 ++++++------- docs/scenarios/imaging.rst | 14 +++++----- docs/scenarios/json.rst | 4 +-- docs/scenarios/ml.rst | 20 +++++++------- docs/scenarios/network.rst | 8 +++--- docs/scenarios/scientific.rst | 24 ++++++++--------- docs/scenarios/scrape.rst | 8 +++--- docs/scenarios/serialization.rst | 2 +- docs/scenarios/speed.rst | 18 ++++++------- docs/scenarios/web.rst | 38 +++++++++++++------------- docs/scenarios/xml.rst | 10 +++---- docs/shipping/freezing.rst | 28 +++++++++---------- docs/shipping/packaging.rst | 30 ++++++++++----------- 25 files changed, 201 insertions(+), 202 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d9f03aa1..fb3abe19b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ pip install --user sphinx Then navigate to the directory of the Makefile and ```make build``` or ```make html```. Sphinx will then generate the HTML in a folder called `_build/html/` -After navigating to this folder, you can then use Python's built in webserver to view your changes locally: +After navigating to this folder, you can then use Python's built in web server to view your changes locally: ``` bash python3 -m http.server diff --git a/docs/dev/env.rst b/docs/dev/env.rst index de67a9ae9..2264a83bd 100644 --- a/docs/dev/env.rst +++ b/docs/dev/env.rst @@ -188,7 +188,7 @@ Spyder `Spyder `_ is an IDE specifically geared toward working with scientific Python libraries (namely -`Scipy `_). It includes integration with pyflakes_, +`SciPy `_). It includes integration with pyflakes_, `pylint `_ and `rope `_. diff --git a/docs/intro/documentation.rst b/docs/intro/documentation.rst index 03e56e3fe..887d0982b 100644 --- a/docs/intro/documentation.rst +++ b/docs/intro/documentation.rst @@ -35,14 +35,14 @@ pydoc :program:`pydoc` is a utility that is installed when you install Python. It allows you to quickly retrieve and search for documentation from your shell. For example, if you needed a quick refresher on the -:mod:`time` module, pulling up documentation would be as simple as +:mod:`time` module, pulling up documentation would be as simple as: .. code-block:: console $ pydoc time The above command is essentially equivalent to opening the Python REPL -and running +and running: .. code-block:: pycon diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst index 2c1f19c01..3b1a5781c 100644 --- a/docs/intro/learning.rst +++ b/docs/intro/learning.rst @@ -37,24 +37,26 @@ pythonbasics.org is an introductiory tutorial for beginners. The tutorial includ Python for Beginners ~~~~~~~~~~~~~~~~~~~~ -thepythonguru.com is a tutorial focuses on beginner programmers. It covers many python concepts -in depth. It also teaches you some advance constructs of python like lambda expression, regular expression. -At last it finishes off with tutorial "How to access MySQL db using python" +thepythonguru.com is a tutorial focused on beginner programmers. It covers many Python concepts +in depth. It also teaches you some advanced constructs of Python like lambda expressions and regular expressions. +And last it finishes off with the tutorial "How to access MySQL db using Python" - - `Python for beginners `_ + `Python for Beginners `_ Learn Python Interactive Tutorial ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Learnpython.org is an easy non-intimidating way to get introduced to Python. The website takes the same approach used on the popular -`Try Ruby `_ website, it has an interactive Python +`Try Ruby `_ website. It has an interactive Python interpreter built into the site that allows you to go through the lessons without having to install Python locally. `Learn Python `_ +Python for You and Me +~~~~~~~~~~~~~~~~~~~~~ + If you want a more traditional book, *Python For You and Me* is an excellent resource for learning all aspects of the language. @@ -71,7 +73,7 @@ Techbeamers.com provides step-by-step tutorials to teach Python. Each tutorial i Online Python Tutor ~~~~~~~~~~~~~~~~~~~ -Online Python Tutor gives you a visual step by step +Online Python Tutor gives you a visual step-by-step representation of how your program runs. Python Tutor helps people overcome a fundamental barrier to learning programming by understanding what happens as the computer @@ -133,7 +135,7 @@ Think Python: How to Think Like a Computer Scientist Think Python attempts to give an introduction to basic concepts in computer science through the use of the Python language. The focus was to create a book -with plenty of exercises, minimal jargon and a section in each chapter devoted +with plenty of exercises, minimal jargon, and a section in each chapter devoted to the subject of debugging. While exploring the various features available in the Python language the @@ -141,7 +143,7 @@ author weaves in various design patterns and best practices. The book also includes several case studies which have the reader explore the topics discussed in the book in greater detail by applying those topics to -real-world examples. Case studies include assignments in GUI and Markov +real-world examples. Case studies include assignments in GUI programming and Markov Analysis. `Think Python `_ @@ -191,7 +193,7 @@ Code the blocks *Code the blocks* provides free and interactive Python tutorials for beginners. It combines Python programming with a 3D environment where you "place blocks" and construct structures. The tutorials teach you -how to use Python to create progressively elaborate 3D structures, +how to use Python to create progressively more elaborate 3D structures, making the process of learning Python fun and engaging. `Code the blocks `_ @@ -204,9 +206,9 @@ Intermediate Python Tricks: The Book ~~~~~~~~~~~~~~~~~~~~~~~ -Discover Python's best practices with simple examples and start writing even more beautiful + Pythonic code. "Python Tricks: The Book" shows you exactly how. +Discover Python's best practices with simple examples and start writing even more beautiful + Pythonic code. *Python Tricks: The Book* shows you exactly how. -You’ll master intermediate and advanced-level features in Python with practical examples and a clear narrative: +You’ll master intermediate and advanced-level features in Python with practical examples and a clear narrative. `Python Tricks: The Book `_ @@ -214,7 +216,7 @@ Effective Python ~~~~~~~~~~~~~~~~ This book contains 59 specific ways to improve writing Pythonic code. At 227 -pages, it is a very brief overview of some of the most commons adapations +pages, it is a very brief overview of some of the most common adapations programmers need to make to become efficient intermediate level Python programmers. @@ -241,13 +243,13 @@ Expert Python Programming deals with best practices in programming Python and is focused on the more advanced crowd. It starts with topics like decorators (with caching, proxy, and context manager -case-studies), method resolution order, using super() and meta-programming, and +case studies), method resolution order, using super() and meta-programming, and general :pep:`8` best practices. It has a detailed, multi-chapter case study on writing and releasing a package and eventually an application, including a chapter on using zc.buildout. Later chapters detail best practices such as writing documentation, test-driven -development, version control, optimization and profiling. +development, version control, optimization, and profiling. `Expert Python Programming `_ @@ -261,7 +263,7 @@ and can make classes and objects behave in different and magical ways. `A Guide to Python's Magic Methods `_ -.. note:: The Rafekettler.com is currently down, you can go to their Github version directly. Here you can find a PDF version: +.. note:: Rafekettler.com is currently down; you can go to their GitHub version directly. Here you can find a PDF version: `A Guide to Python's Magic Methods (repo on GitHub) `_ @@ -317,7 +319,7 @@ Transforming Code into Beautiful, Idiomatic Python Transforming Code into Beautiful, Idiomatic Python is a video by Raymond Hettinger. Learn to take better advantage of Python's best features and improve existing code -through a series of code transformations, "When you see this, do that instead." +through a series of code transformations: "When you see this, do that instead." `Transforming Code into Beautiful, Idiomatic Python `_ @@ -328,7 +330,7 @@ Fullstack Python Fullstack Python offers a complete top-to-bottom resource for web development using Python. -From setting up the webserver, to designing the front-end, choosing a database, +From setting up the web server, to designing the front-end, choosing a database, optimizing/scaling, etc. As the name suggests, it covers everything you need to build and run a complete @@ -353,7 +355,7 @@ Python in a Nutshell ~~~~~~~~~~~~~~~~~~~~ Python in a Nutshell, written by Alex Martelli, covers most cross-platform -Python's usage, from its syntax to built-in libraries to advanced topics such +Python usage, from its syntax to built-in libraries to advanced topics such as writing C extensions. `Python in a Nutshell `_ @@ -361,7 +363,7 @@ as writing C extensions. The Python Language Reference ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This is Python's reference manual, it covers the syntax and the core semantics +This is Python's reference manual. It covers the syntax and the core semantics of the language. `The Python Language Reference `_ @@ -388,7 +390,7 @@ Python Cookbook ~~~~~~~~~~~~~~~ Python Cookbook, written by David Beazley and Brian K. Jones, is packed with -practical recipes. This book covers the core python language as well as tasks +practical recipes. This book covers the core Python language as well as tasks common to a wide variety of application domains. `Python Cookbook `_ @@ -396,7 +398,7 @@ common to a wide variety of application domains. Writing Idiomatic Python ~~~~~~~~~~~~~~~~~~~~~~~~ -"Writing Idiomatic Python", written by Jeff Knupp, contains the most common and +Writing Idiomatic Python, written by Jeff Knupp, contains the most common and important Python idioms in a format that maximizes identification and understanding. Each idiom is presented as a recommendation of a way to write some commonly used piece of code, followed by an explanation of why the idiom diff --git a/docs/intro/news.rst b/docs/intro/news.rst index 1dd89aae1..9f8e9232b 100644 --- a/docs/intro/news.rst +++ b/docs/intro/news.rst @@ -87,7 +87,7 @@ Python News is the news section in the official Python web site Import Python Weekly ******************** -Weekly Python Newsletter containing Python Articles, Projects, Videos, Tweets +Weekly Python Newsletter containing Python Articles, Projects, Videos, and Tweets delivered in your inbox. Keep Your Python Programming Skills Updated. `Import Python Weekly Newsletter `_ @@ -97,6 +97,6 @@ delivered in your inbox. Keep Your Python Programming Skills Updated. Awesome Python Newsletter ************************* -A weekly overview of the most popular Python news, articles and packages. +A weekly overview of the most popular Python news, articles, and packages. `Awesome Python Newsletter `_ diff --git a/docs/notes/styleguide.rst b/docs/notes/styleguide.rst index 2d036b3be..2d4d7055b 100644 --- a/docs/notes/styleguide.rst +++ b/docs/notes/styleguide.rst @@ -135,7 +135,7 @@ Python examples: Externally Linking ****************** -* Prefer labels for well known subjects (ex: proper nouns) when linking: +* Prefer labels for well known subjects (e.g. proper nouns) when linking: .. code-block:: rest @@ -150,7 +150,7 @@ Externally Linking Read the `Sphinx Tutorial `_ -* Avoid using labels such as "click here", "this", etc. preferring +* Avoid using labels such as "click here", "this", etc., preferring descriptive labels (SEO worthy) instead. @@ -209,4 +209,3 @@ documents or large incomplete sections. .. todo:: Learn the Ultimate Answer to the Ultimate Question of Life, The Universe, and Everything - diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index 42d29425f..e275018ae 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -23,7 +23,7 @@ Install Fabric: The following code will create two tasks that we can use: ``memory_usage`` and ``deploy``. The former will output the memory usage on each machine. The -latter will ssh into each server, cd to our project directory, activate the +latter will SSH into each server, cd to our project directory, activate the virtual environment, pull the newest codebase, and restart the application server. @@ -101,7 +101,7 @@ The following command lists all available minion hosts, using the ping module. $ salt '*' test.ping -The host filtering is accomplished by matching the minion id, +The host filtering is accomplished by matching the minion id or using the grains system. The `grains `_ system uses static host information like the operating system version or the @@ -131,7 +131,7 @@ it will install and start the Apache server: - require: - pkg: apache -State files can be written using YAML, the Jinja2 template system or pure Python. +State files can be written using YAML, the Jinja2 template system, or pure Python. `Salt Documentation `_ @@ -141,7 +141,7 @@ Psutil ****** `Psutil `_ is an interface to different -system information (e.g. CPU, memory, disks, network, users and processes). +system information (e.g. CPU, memory, disks, network, users, and processes). Here is an example to be aware of some server overload. If any of the tests (net, CPU) fail, it will send an email. @@ -263,9 +263,9 @@ configures itself and this distributed approach makes Chef a scalable automation Chef works by using custom recipes (configuration elements), implemented in cookbooks. Cookbooks, which are basically packages for infrastructure choices, are usually stored in your Chef server. -Read the `Digital Ocean tutorial series +Read the `DigitalOcean tutorial series `_ -on chef to learn how to create a simple Chef Server. +on Chef to learn how to create a simple Chef Server. To create a simple cookbook the `knife `_ command is used: @@ -299,8 +299,8 @@ Puppet Agents are installed on nodes whose state needs to be monitored or changed. A designated server known as the Puppet Master is responsible for orchestrating the agent nodes. -Agent nodes send basic facts about the system such as to the operating system, -kernel, architecture, ip address, hostname etc. to the Puppet Master. +Agent nodes send basic facts about the system such as the operating system, +kernel, architecture, IP address, hostname, etc. to the Puppet Master. The Puppet Master then compiles a catalog with information provided by the agents on how each node should be configured and sends it to the agent. The agent enforces the change as prescribed in the catalog and sends a report back @@ -320,7 +320,7 @@ your Puppet modules. Ubuntu Writing Modules in Puppet is pretty straight forward. Puppet Manifests together -form Puppet Modules. Puppet manifest end with an extension of ``.pp``. +form Puppet Modules. Puppet manifests end with an extension of ``.pp``. Here is an example of 'Hello World' in Puppet. .. code-block:: puppet @@ -334,7 +334,7 @@ Here is an example of 'Hello World' in Puppet. Here is another example with system based logic. Note how the operating system fact is being used as a variable prepended with the ``$`` sign. Similarly, this holds true for other facts such as hostname which can be referenced by -``$hostname`` +``$hostname``. .. code-block:: puppet @@ -346,10 +346,10 @@ holds true for other facts such as hostname which can be referenced by } There are several resource types for Puppet but the package-file-service -paradigm is all you need for undertaking majority of the configuration +paradigm is all you need for undertaking the majority of the configuration management. The following Puppet code makes sure that the OpenSSH-Server package is installed in a system and the sshd service is notified to restart -everytime the sshd configuration file is changed. +every time the sshd configuration file is changed. .. code-block:: puppet @@ -407,6 +407,6 @@ monitoring framework written in Python. Its main goal is to give users a flexibl architecture for their monitoring system that is designed to scale to large environments. -Shinken is backwards-compatible with the Nagios configuration standard, and -plugins.It works on any operating system, and architecture that supports Python -which includes Windows, GNU/Linux, and FreeBSD. +Shinken is backwards-compatible with the Nagios configuration standard and +plugins. It works on any operating system and architecture that supports Python, +which includes Windows, Linux, and FreeBSD. diff --git a/docs/scenarios/ci.rst b/docs/scenarios/ci.rst index 19f18b37b..ade9148c4 100644 --- a/docs/scenarios/ci.rst +++ b/docs/scenarios/ci.rst @@ -14,7 +14,7 @@ Why? **** Martin Fowler, who first wrote about `Continuous Integration `_ -(short: CI) together with Kent Beck, describes the CI as follows: +(short: CI) together with Kent Beck, describes CI as follows: Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at @@ -29,8 +29,7 @@ Martin Fowler, who first wrote about `Continuous Integration `_ is an extensible continuous integration -engine. Use it. +`Jenkins CI `_ is an extensible Continuous Integration engine. Use it. ******** @@ -46,7 +45,7 @@ Tox *** `tox `_ is an automation tool providing -packaging, testing and deployment of Python software right from the console or +packaging, testing, and deployment of Python software right from the console or CI server. It is a generic virtualenv management and test command line tool which provides the following features: @@ -55,7 +54,7 @@ which provides the following features: * Running tests in each of the environments, configuring your test tool of choice * Acting as a front-end to Continuous Integration servers, reducing boilerplate - and merging CI and shell-based testing. + and merging CI and shell-based testing ********* @@ -66,7 +65,7 @@ Travis-CI tests for open source projects for free. It provides multiple workers to run Python tests on and seamlessly integrates with GitHub. You can even have it comment on your Pull Requests whether this particular changeset breaks the -build or not. So if you are hosting your code on GitHub, travis-ci is a great +build or not. So if you are hosting your code on GitHub, Travis-CI is a great and easy way to get started with Continuous Integration. In order to get started, add a :file:`.travis.yml` file to your repository with @@ -86,12 +85,12 @@ this example content:: This will get your project tested on all the listed Python versions by -running the given script, and will only build the master branch. There are a -lot more options you can enable, like notifications, before and after steps -and much more. The `travis-ci docs `_ +running the given script, and will only build the ``master`` branch. There are a +lot more options you can enable, like notifications, before and after steps, +and much more. The `Travis-CI docs `_ explain all of these options, and are very thorough. -In order to activate testing for your project, go to `the travis-ci site `_ +In order to activate testing for your project, go to `the Travis-CI site `_ and login with your GitHub account. Then activate your project in your profile settings and you're ready to go. From now on, your project's tests will be run on every push to GitHub. diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst index ab2e11925..266223734 100644 --- a/docs/scenarios/cli.rst +++ b/docs/scenarios/cli.rst @@ -15,12 +15,12 @@ switches. Some popular command-line applications include: -* `Grep `_ - A plain-text data search utility +* `grep `_ - A plain-text data search utility * `curl `_ - A tool for data transfer with URL syntax -* `httpie `_ - A command line HTTP +* `httpie `_ - A command-line HTTP client, a user-friendly cURL replacement -* `git `_ - A distributed version control system -* `mercurial `_ - A distributed version control +* `Git `_ - A distributed version control system +* `Mercurial `_ - A distributed version control system primarily written in Python @@ -30,8 +30,8 @@ Clint `clint `_ is a Python module which is filled with very useful tools for developing command-line applications. -It supports features such as; CLI colors and indents, simple and powerful -column printer, iterator based progress bars and implicit argument handling. +It supports features such as: CLI colors and indents, simple and powerful +column printer, iterator based progress bars, and implicit argument handling. ***** @@ -40,7 +40,7 @@ Click `click `_ is a Python package for creating command-line interfaces in a composable way with as little code as -possible. This “Command-line Interface Creation Kit” is highly +possible. This “Command-Line Interface Creation Kit” is highly configurable but comes with good defaults out of the box. @@ -61,8 +61,8 @@ Plac over the Python standard library `argparse `_, which hides most of its complexity by using a declarative interface: the argument parser is inferred rather than written down by imperatively. This -module targets especially unsophisticated users, programmers, sys-admins, -scientists and in general people writing throw-away scripts for themselves, +module targets especially unsophisticated users, programmers, sysadmins, +scientists, and in general people writing throw-away scripts for themselves, who choose to create a command-line interface because it is quick and simple. @@ -73,7 +73,7 @@ Cliff `Cliff `_ is a framework for building command-line programs. It uses setuptools entry points to provide subcommands, output formatters, and other extensions. The framework is meant -to be used to create multi-level commands such as subversion and git, where +to be used to create multi-level commands such as ``svn`` and ``git``, where the main program handles some basic argument parsing and then invokes a sub-command to do the work. @@ -83,11 +83,11 @@ Cement ****** `Cement `_ is an advanced CLI Application Framework. -Its goal is to introduce a standard, and feature-full platform +Its goal is to introduce a standard and feature-full platform for both simple and complex command line applications as well as support rapid development needs without sacrificing quality. -Cement is flexible, and it's use cases span from the simplicity of a micro-framework -to the complexity of a meg-framework. +Cement is flexible, and its use cases span from the simplicity of a micro-framework +to the complexity of a mega-framework. *********** @@ -95,9 +95,8 @@ Python Fire *********** `Python Fire `_ is a library for -automatically generating command line interfaces from absolutely any Python +automatically generating command-line interfaces from absolutely any Python object. It can help debug Python code more easily from the command line, create CLI interfaces to existing code, allow you to interactively explore code in a REPL, and simplify transitioning between Python and Bash (or any other shell). - diff --git a/docs/scenarios/clibs.rst b/docs/scenarios/clibs.rst index 661cddafd..5470576b0 100644 --- a/docs/scenarios/clibs.rst +++ b/docs/scenarios/clibs.rst @@ -36,11 +36,11 @@ ABI Interaction ctypes ****** -`ctypes `_ is the de facto +`ctypes `_ is the de facto standard library for interfacing with C/C++ from CPython, and it provides not only full access to the native C interface of most major operating systems (e.g., kernel32 on Windows, or libc on \*nix), but also provides support for loading -and interfacing with dynamic libraries, such as DLLs or shared objects at +and interfacing with dynamic libraries, such as DLLs or shared objects, at runtime. It does bring along with it a whole host of types for interacting with system APIs, and allows you to rather easily define your own complex types, such as structs and unions, and allows you to modify things such as @@ -82,7 +82,7 @@ large number of scripting languages), is a tool for generating bindings for interpreted languages from C/C++ header files. It is extremely simple to use: the consumer simply needs to define an interface file (detailed in the tutorial and documentations), include the requisite C/C++ headers, and run -the build tool against them. While it does have some limits, (it currently +the build tool against them. While it does have some limits (it currently seems to have issues with a small subset of newer C++ features, and getting template-heavy code to work can be a bit verbose), it provides a great deal of power and exposes lots of features to Python with little effort. @@ -137,5 +137,5 @@ Boost.Python `Boost.Python `_ requires a bit more manual work to expose C++ object functionality, but it is capable of providing all the same features SWIG does and then some, -to include providing wrappers to access PyObjects in C++, extracting SWIG- +to include providing wrappers to access PyObjects in C++, extracting SWIG wrapper objects, and even embedding bits of Python into your C++ code. diff --git a/docs/scenarios/crypto.rst b/docs/scenarios/crypto.rst index e6956d75b..39cf8a3a4 100644 --- a/docs/scenarios/crypto.rst +++ b/docs/scenarios/crypto.rst @@ -7,16 +7,16 @@ Cryptography ************ -Cryptography +cryptography ************ -`Cryptography `_ is an actively developed +`cryptography `_ is an actively developed library that provides cryptographic recipes and primitives. It supports -Python 2.6-2.7, Python 3.3+ and PyPy. +Python 2.6-2.7, Python 3.3+, and PyPy. -Cryptography is divided into two layers of recipes and hazardous materials -(hazmat). The recipes layer provides simple API for proper symmetric +cryptography is divided into two layers of recipes and hazardous materials +(hazmat). The recipes layer provides a simple API for proper symmetric encryption and the hazmat layer provides low-level cryptographic primitives. @@ -46,9 +46,9 @@ Example code using high level symmetric encryption recipe: GPGME bindings ************** -The `GPGME Python bindings `_ provide pythonic access to `GPG Made Easy `_, a C API for the entire GNU Privacy Guard suite of projects, including GPG, libgcrypt and gpgsm (the S/MIME engine). It supports Python 2.6, 2.7, 3.4 and above. Depends on the SWIG C interface for Python as well as the GnuPG software and libraries. +The `GPGME Python bindings `_ provide Pythonic access to `GPG Made Easy `_, a C API for the entire GNU Privacy Guard suite of projects, including GPG, libgcrypt, and gpgsm (the S/MIME engine). It supports Python 2.6, 2.7, 3.4, and above. Depends on the SWIG C interface for Python as well as the GnuPG software and libraries. -A more comprehensive `GPGME Python Bindings HOWTO `_ is available with the source and a HTML version is available `here `_. Python 3 sample scripts from the examples in the HOWTO are also provided with the source and are accessible `here `_. +A more comprehensive `GPGME Python Bindings HOWTO `_ is available with the source, and an HTML version is available `here `_. Python 3 sample scripts from the examples in the HOWTO are also provided with the source and are accessible `here `_. Available under the same terms as the rest of the GnuPG Project: GPLv2 and LGPLv2.1, both with the "or any later version" clause. diff --git a/docs/scenarios/db.rst b/docs/scenarios/db.rst index fc34fbb34..58211e26b 100644 --- a/docs/scenarios/db.rst +++ b/docs/scenarios/db.rst @@ -12,7 +12,7 @@ DB-API The Python Database API (DB-API) defines a standard interface for Python database access modules. It's documented in :pep:`249`. -Nearly all Python database modules such as `sqlite3`, `psycopg` and +Nearly all Python database modules such as `sqlite3`, `psycopg`, and `mysql-python` conform to this interface. Tutorials that explain how to work with modules that conform to this interface can be found @@ -39,7 +39,7 @@ Records `Records `_ is minimalist SQL library, designed for sending raw SQL queries to various databases. Data can be used -programmatically, or exported to a number of useful data formats. +programmatically or exported to a number of useful data formats. .. code-block:: console @@ -73,11 +73,11 @@ peewee `peewee `_ is another ORM with a focus on being lightweight with support for Python 2.6+ and 3.2+ which supports -SQLite, MySQL and Postgres by default. The +SQLite, MySQL, and PostgreSQL by default. The `model layer `_ is similar to that of the Django ORM and it has `SQL-like methods `_ -to query data. While SQLite, MySQL and Postgres are supported out-of-the-box, +to query data. While SQLite, MySQL, and PostgreSQL are supported out-of-the-box, there is a `collection of add-ons `_ available. @@ -88,9 +88,9 @@ PonyORM `PonyORM `_ is an ORM that takes a different approach to querying the database. Instead of writing an SQL-like language or boolean -expressions, Python's generator syntax is used. There's also an graphical +expressions, Python's generator syntax is used. There's also a graphical schema editor that can generate PonyORM entities for you. It supports Python -2.6+ and Python 3.3+ and can connect to SQLite, MySQL, Postgres & Oracle +2.6+ and Python 3.3+ and can connect to SQLite, MySQL, PostgreSQL, and Oracle. ********* @@ -98,8 +98,8 @@ SQLObject ********* `SQLObject `_ is yet another ORM. It supports a wide -variety of databases: Common database systems MySQL, Postgres and SQLite and -more exotic systems like SAP DB, SyBase and MSSQL. It only supports Python 2 +variety of databases: common database systems like MySQL, PostgreSQL, and SQLite and +more exotic systems like SAP DB, SyBase, and Microsoft SQL Server. It only supports Python 2 from Python 2.6 upwards. -.. There's no official information on this on their page, this information was gathered by looking at their source code +.. There's no official information on this on their page; this information was gathered by looking at their source code. diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst index 6825a91ae..e012048bc 100644 --- a/docs/scenarios/gui.rst +++ b/docs/scenarios/gui.rst @@ -14,12 +14,12 @@ Camelot ******* `Camelot `_ provides components for building -applications on top of Python, SQLAlchemy and Qt. It is inspired by +applications on top of Python, SQLAlchemy, and Qt. It is inspired by the Django admin interface. The main resource for information is the website: http://www.python-camelot.com -and the mailing list https://groups.google.com/forum/#!forum/project-camelot +and the mailing list https://groups.google.com/forum/#!forum/project-camelot. ***** @@ -44,7 +44,7 @@ applications be ported from PyGTK to PyGObject. PyGObject aka (PyGi) ******************** -`PyGObject `_ provides Python bindings, which gives access to the entire GNOME software platform. +`PyGObject `_ provides Python bindings which gives access to the entire GNOME software platform. It is fully compatible with GTK+ 3. Here is a tutorial to get started with `Python GTK+ 3 Tutorial `_. `API Reference `_ @@ -59,8 +59,8 @@ enabled media rich applications. The aim is to allow for quick and easy interaction design and rapid prototyping, while making your code reusable and deployable. -Kivy is written in Python, based on OpenGL and supports different input devices -such as: Mouse, Dual Mouse, TUIO, WiiMote, WM_TOUCH, HIDtouch, Apple's products +Kivy is written in Python, based on OpenGL, and supports different input devices +such as: Mouse, Dual Mouse, TUIO, WiiMote, WM_TOUCH, HIDtouch, Apple's products, and so on. Kivy is actively being developed by a community and is free to use. It operates @@ -111,7 +111,7 @@ application source code to be executed as a standalone desktop application. `Python Wiki for PyjamasDesktop `_. -The main website; `pyjs Desktop `_. +The main website: `pyjs Desktop `_. ** @@ -127,13 +127,13 @@ non-GUI applications. PySimpleGUI *********** -`PySimpleGUI `_ is a wrapper for Tkinter and Qt (others on the way). The amount of code required to implement custom GUIs is much shorter using PySimpleGUI than if the same GUI were written directly using tkinter or Qt. PySimpleGUI code can be "ported" between GUI frameworks by changing import statement. +`PySimpleGUI `_ is a wrapper for Tkinter and Qt (others on the way). The amount of code required to implement custom GUIs is much shorter using PySimpleGUI than if the same GUI were written directly using Tkinter or Qt. PySimpleGUI code can be "ported" between GUI frameworks by changing import statements. .. code-block:: console $ pip install pysimplegui -PySimpleGUI is contained in a single PySimpleGUI.py file. Should pip installation be impossible, pasting the PySimpleGUI.py file into a project's folder is all that's required to import and begin using. +PySimpleGUI is contained in a single PySimpleGUI.py file. Should pip installation be impossible, copying the PySimpleGUI.py file into a project's folder is all that's required to import and begin using. **** @@ -145,7 +145,7 @@ native, cross platform GUI toolkit. Toga consists of a library of base components with a shared interface to simplify platform-agnostic GUI development. -Toga is available on Mac OS, Windows, Linux (GTK), and mobile platforms such +Toga is available on mOS, Windows, Linux (GTK), and mobile platforms such as Android and iOS. diff --git a/docs/scenarios/imaging.rst b/docs/scenarios/imaging.rst index a6ba48fde..7b0e71935 100644 --- a/docs/scenarios/imaging.rst +++ b/docs/scenarios/imaging.rst @@ -6,7 +6,7 @@ Image Manipulation .. image:: /_static/photos/34575689432_3de8e9a348_k_d.jpg Most image processing and manipulation techniques can be carried out -effectively using two libraries: Python Imaging Library (PIL) and OpenSource +effectively using two libraries: Python Imaging Library (PIL) and Open Source Computer Vision (OpenCV). A brief description of both is given below. @@ -21,8 +21,8 @@ for short, is one of the core libraries for image manipulation in Python. Unfort its development has stagnated, with its last release in 2009. Luckily for you, there's an actively-developed fork of PIL called -`Pillow `_ - it's easier to install, runs on -all operating systems, and supports Python 3. +`Pillow `_ -- it's easier to install, runs on +all major operating systems, and supports Python 3. Installation ~~~~~~~~~~~~ @@ -65,11 +65,11 @@ There are more examples of the Pillow library in the `Pillow tutorial `_. -************************** -OpenSource Computer Vision -************************** +*************************** +Open Source Computer Vision +*************************** -OpenSource Computer Vision, more commonly known as OpenCV, is a more advanced +Open Source Computer Vision, more commonly known as OpenCV, is a more advanced image manipulation and processing software than PIL. It has been implemented in several languages and is widely used. diff --git a/docs/scenarios/json.rst b/docs/scenarios/json.rst index 6495724af..130ad3031 100644 --- a/docs/scenarios/json.rst +++ b/docs/scenarios/json.rst @@ -52,7 +52,7 @@ You can also convert the following to JSON: simplejson ********** -The JSON library was added to Python in version 2.6. +The json library was added to Python in version 2.6. If you're using an earlier version of Python, the `simplejson `_ library is available via PyPI. @@ -68,5 +68,5 @@ importing simplejson under a different name: import simplejson as json -After importing simplejson as json, the above examples will all work as if you +After importing simplejson as `json`, the above examples will all work as if you were using the standard json library. diff --git a/docs/scenarios/ml.rst b/docs/scenarios/ml.rst index baa0777de..71bdceb2d 100644 --- a/docs/scenarios/ml.rst +++ b/docs/scenarios/ml.rst @@ -6,16 +6,16 @@ Machine Learning .. image:: /_static/photos/34018729885_002ced9b54_k_d.jpg -Python has a vast number of libraries for data analysis, statistics and Machine Learning itself, making it a language of choice for many data scientists. +Python has a vast number of libraries for data analysis, statistics, and Machine Learning itself, making it a language of choice for many data scientists. -Some widely used packages for Machine Learning and other Data Science applications are enlisted below. +Some widely used packages for Machine Learning and other data science applications are listed below. *********** -Scipy Stack +SciPy Stack *********** -The Scipy stack consists of a bunch of core helper packages used in data science, for statistical analysis and visualising data. Because of its huge number of functionalities and ease of use, the Stack is considered a must-have for most data science applications. +The SciPy stack consists of a bunch of core helper packages used in data science for statistical analysis and visualising data. Because of its huge number of functionalities and ease of use, the Stack is considered a must-have for most data science applications. The Stack consists of the following packages (link to documentation given): @@ -41,9 +41,9 @@ For installing the full stack, or individual packages, you can refer to the inst scikit-learn ************ -Scikit is a free and open-source machine learning library for Python. It offers off-the-shelf functions to implement many algorithms like linear regression, classifiers, SVMs, k-means, Neural Networks etc. It also has a few sample datasets which can be directly used for training and testing. +Scikit is a free and open-source machine learning library for Python. It offers off-the-shelf functions to implement many algorithms like linear regression, classifiers, SVMs, k-means, Neural Networks, etc. It also has a few sample datasets which can be directly used for training and testing. -Because of its speed, robustness and easiness to use, it's one of the most widely-used libraries for many Machine Learning applications. +Because of its speed, robustness, and ease of, it's one of the most widely-used libraries for many Machine Learning applications. Installation ~~~~~~~~~~~~ @@ -60,16 +60,16 @@ Through conda: conda install scikit-learn -scikit-learn also comes in shipped with Anaconda (mentioned above). For more installation instructions, refer to `this link `_. +scikit-learn also comes shipped with Anaconda (mentioned above). For more installation instructions, refer to `this link `_. Example ~~~~~~~ For this example, we train a simple classifier on the `Iris dataset `_, which comes bundled in with scikit-learn. -The dataset takes four features of flowers: sepal length, sepal width, petal length and petal width, and classifies them into three flower species (labels): setosa, versicolor or virginica. The labels have been represented as numbers in the dataset: 0 (setosa), 1 (versicolor) and 2 (virginica). +The dataset takes four features of flowers: sepal length, sepal width, petal length, and petal width, and classifies them into three flower species (labels): setosa, versicolor, or virginica. The labels have been represented as numbers in the dataset: 0 (setosa), 1 (versicolor), and 2 (virginica). -We shuffle the Iris dataset, and divide it into separate training and testing sets: keeping the last 10 data points for testing and rest for training. We then train the classifier on the training set, and predict on the testing set. +We shuffle the Iris dataset and divide it into separate training and testing sets, keeping the last 10 data points for testing and rest for training. We then train the classifier on the training set and predict on the testing set. .. code-block:: python @@ -120,6 +120,6 @@ Since we're splitting randomly and the classifier trains on every iteration, the [0 1 1 1 0 2 0 2 2 2] 100.0 -The first line contains the labels (i.e flower species) of the testing data as predicted by our classifier, and the second line contains the actual flower species as given in the dataset. We thus get an accuracy of 100% this time. +The first line contains the labels (i.e. flower species) of the testing data as predicted by our classifier, and the second line contains the actual flower species as given in the dataset. We thus get an accuracy of 100% this time. More on scikit-learn can be read in the `documentation `_. diff --git a/docs/scenarios/network.rst b/docs/scenarios/network.rst index d17eea824..f8306c70a 100644 --- a/docs/scenarios/network.rst +++ b/docs/scenarios/network.rst @@ -12,8 +12,8 @@ Twisted `Twisted `_ is an event-driven networking engine. It can be used to build applications around many different networking -protocols, including http servers and clients, applications using SMTP, POP3, -IMAP or SSH protocols, instant messaging +protocols, including HTTP servers and clients, applications using SMTP, POP3, +IMAP, or SSH protocols, instant messaging, and `much more `_. @@ -30,8 +30,8 @@ message queuing without a message broker. The basic patterns for this are: remote procedure call and task distribution pattern. - publish-subscribe: connects a set of publishers to a set of subscribers. This is a data distribution pattern. -- push-pull (or pipeline): connects nodes in a fan-out / fan-in pattern that - can have multiple steps, and loops. This is a parallel task distribution +- push-pull (or pipeline): connects nodes in a fan-out/fan-in pattern that + can have multiple steps and loops. This is a parallel task distribution and collection pattern. For a quick start, read the `ZeroMQ guide `_. diff --git a/docs/scenarios/scientific.rst b/docs/scenarios/scientific.rst index 6bdb1c9db..6051e4586 100644 --- a/docs/scenarios/scientific.rst +++ b/docs/scenarios/scientific.rst @@ -16,11 +16,11 @@ and performs well. Due to its high performance nature, scientific computing in Python often utilizes external libraries, typically written in faster languages (like C, or -FORTRAN for matrix operations). The main libraries used are `NumPy`_, `SciPy`_ +Fortran for matrix operations). The main libraries used are `NumPy`_, `SciPy`_ and `Matplotlib`_. Going into detail about these libraries is beyond the scope of the Python guide. However, a comprehensive introduction to the scientific Python ecosystem can be found in the `Python Scientific Lecture Notes -`_ +`_. ***** @@ -35,7 +35,7 @@ which provides features of great interest to scientists. The `inline mode` allows graphics and plots to be displayed in the terminal (Qt based version). Moreover, the `notebook` mode supports literate programming and reproducible science generating a web-based Python notebook. This notebook allows you to -store chunks of Python code along side the results and additional comments +store chunks of Python code alongside the results and additional comments (HTML, LaTeX, Markdown). The notebook can then be shared and exported in various file formats. @@ -48,7 +48,7 @@ NumPy ----- `NumPy `_ is a low level library written in C (and -FORTRAN) for high level mathematical functions. NumPy cleverly overcomes the +Fortran) for high level mathematical functions. NumPy cleverly overcomes the problem of running slower algorithms on Python by using multidimensional arrays and functions that operate on arrays. Any algorithm can then be expressed as a function on arrays, allowing the algorithms to be run quickly. @@ -57,7 +57,7 @@ NumPy is part of the SciPy project, and is released as a separate library so people who only need the basic requirements can use it without installing the rest of SciPy. -NumPy is compatible with Python versions 2.4 through to 2.7.2 and 3.1+. +NumPy is compatible with Python versions 2.4 through 2.7.2 and 3.1+. Numba ----- @@ -75,7 +75,7 @@ SciPy functions. SciPy uses NumPy arrays as the basic data structure, and comes with modules for various commonly used tasks in scientific programming, including linear algebra, integration (calculus), ordinary differential equation -solving and signal processing. +solving, and signal processing. Matplotlib ---------- @@ -84,7 +84,7 @@ Matplotlib library for creating interactive 2D and 3D plots that can also be saved as manuscript-quality figures. The API in many ways reflects that of `MATLAB `_, easing transition of MATLAB -users to Python. Many examples, along with the source code to re-create them, +users to Python. Many examples, along with the source code to recreate them, are available in the `matplotlib gallery `_. @@ -92,10 +92,10 @@ Pandas ------ `Pandas `_ is data manipulation library -based on Numpy which provides many useful functions for accessing, -indexing, merging and grouping data easily. The main data structure (DataFrame) +based on NumPy which provides many useful functions for accessing, +indexing, merging, and grouping data easily. The main data structure (DataFrame) is close to what could be found in the R statistical package; that is, -heterogeneous data tables with name indexing, time series operations and +heterogeneous data tables with name indexing, time series operations, and auto-alignment of data. Rpy2 @@ -112,7 +112,7 @@ PsychoPy `PsychoPy `_ is a library for cognitive scientists allowing the creation of cognitive psychology and neuroscience experiments. -The library handles presentation of stimuli, scripting of experimental design +The library handles presentation of stimuli, scripting of experimental design, and data collection. @@ -131,7 +131,7 @@ Unofficial Windows Binaries for Python Extension Packages Many people who do scientific computing are on Windows, yet many of the scientific computing packages are notoriously difficult to build and install on -this platform. `Christoph Gohlke `_ +this platform. `Christoph Gohlke `_, however, has compiled a list of Windows binaries for many useful Python packages. The list of packages has grown from a mainly scientific Python resource to a more general list. If you're on Windows, you may want to check it diff --git a/docs/scenarios/scrape.rst b/docs/scenarios/scrape.rst index bf61b29a7..3c7493f42 100644 --- a/docs/scenarios/scrape.rst +++ b/docs/scenarios/scrape.rst @@ -13,7 +13,7 @@ Web Scraping Web sites are written using HTML, which means that each web page is a structured document. Sometimes it would be great to obtain some data from them and preserve the structure while we're at it. Web sites don't always -provide their data in comfortable formats such as ``csv`` or ``json``. +provide their data in comfortable formats such as CSV or JSON. This is where web scraping comes in. Web scraping is the practice of using a computer program to sift through a web page and gather the data that you need @@ -41,7 +41,7 @@ Let's start with the imports: import requests Next we will use ``requests.get`` to retrieve the web page with our data, -parse it using the ``html`` module and save the results in ``tree``: +parse it using the ``html`` module, and save the results in ``tree``: .. code-block:: python @@ -62,10 +62,10 @@ HTML or XML documents. A good introduction to XPath is on There are also various tools for obtaining the XPath of elements such as FireBug for Firefox or the Chrome Inspector. If you're using Chrome, you can right click an element, choose 'Inspect element', highlight the code, -right click again and choose 'Copy XPath'. +right click again, and choose 'Copy XPath'. After a quick analysis, we see that in our page the data is contained in -two elements - one is a div with title 'buyer-name' and the other is a +two elements -- one is a div with title 'buyer-name' and the other is a span with class 'item-price': .. code-block:: html diff --git a/docs/scenarios/serialization.rst b/docs/scenarios/serialization.rst index 559ad3651..fefd88372 100644 --- a/docs/scenarios/serialization.rst +++ b/docs/scenarios/serialization.rst @@ -12,7 +12,7 @@ What is data serialization? Data serialization is the concept of converting structured data into a format that allows it to be shared or stored in such a way that its original -structure to be recovered. In some cases, the secondary intention of data +structure can be recovered. In some cases, the secondary intention of data serialization is to minimize the size of the serialized data which then minimizes disk space or bandwidth requirements. diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst index 5d087e94c..485872360 100644 --- a/docs/scenarios/speed.rst +++ b/docs/scenarios/speed.rst @@ -200,8 +200,8 @@ These lines both need a remark: The `pyximport` module allows you to import :file:`*.pyx` files (e.g., :file:`primesCy.pyx`) with the Cython-compiled version of the `primes` function. The `pyximport.install()` command allows the Python interpreter to -start the Cython compiler directly to generate C-code, which is automatically -compiled to a :file:`*.so` C-library. Cython is then able to import this +start the Cython compiler directly to generate C code, which is automatically +compiled to a :file:`*.so` C library. Cython is then able to import this library for you in your Python code, easily and efficiently. With the `time.time()` function you are able to compare the time between these 2 different calls to find 500 prime numbers. On a standard notebook (dual core @@ -214,7 +214,7 @@ AMD E-450 1.6 GHz), the measured values are: Python time: 0.0566 seconds -And here the output of an embedded `ARM beaglebone `_ machine: +And here is the output of an embedded `ARM beaglebone `_ machine: .. code-block:: console @@ -253,7 +253,7 @@ available. The ProcessPoolExecutor works in the same way, except instead of using multiple threads for its workers, it will use multiple processes. This makes it possible -to side-step the GIL, however because of the way things are passed to worker +to side-step the GIL; however, because of the way things are passed to worker processes, only picklable objects can be executed and returned. Because of the way the GIL works, a good rule of thumb is to use a @@ -264,7 +264,7 @@ executor when the task is computationally expensive. There are two main ways of executing things in parallel using the two Executors. One way is with the `map(func, iterables)` method. This works almost exactly like the builtin `map()` function, except it will execute -everything in parallel. : +everything in parallel. .. code-block:: python @@ -304,7 +304,7 @@ result() the scheduled callable returns by default. exception() Return the exception raised by the call. If no exception was raised then - this returns `None`. Note that this will block just like `result()`. + this returns None. Note that this will block just like `result()`. add_done_callback(fn) Attach a callback function that will be executed (as `fn(future)`) when the scheduled callable returns. @@ -357,14 +357,14 @@ futures provided have completed. For more information, on using the `concurrent.futures`_ module, consult the official documentation. -Threading +threading --------- The standard library comes with a `threading`_ module that allows a user to work with multiple threads manually. Running a function in another thread is as simple as passing a callable and -it's arguments to `Thread`'s constructor and then calling `start()`: +its arguments to `Thread`'s constructor and then calling `start()`: .. code-block:: python @@ -399,7 +399,7 @@ there might be situations where two or more threads are trying to write to the same resource at the same time or where the output is dependent on the sequence or timing of certain events. This is called a `data race`_ or race condition. When this happens, the output will be garbled or you may encounter problems -which are difficult to debug. A good example is this `stackoverflow post`_. +which are difficult to debug. A good example is this `Stack Overflow post`_. The way this can be avoided is by using a `Lock`_ that each thread needs to acquire before writing to a shared resource. Locks can be acquired and released diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst index 40b6656ce..bf5f1864a 100644 --- a/docs/scenarios/web.rst +++ b/docs/scenarios/web.rst @@ -41,7 +41,7 @@ URL Routing be invoked Request and Response Objects - Encapsulate the information received from or sent to a user's browser + Encapsulates the information received from or sent to a user's browser Template Engine Allows for separating Python code implementing an application's logic from @@ -105,14 +105,14 @@ It is a reliable, high-performance Python web framework for building large-scale app backends and microservices. Falcon encourages the REST architectural style of mapping URIs to resources, trying to do as little as possible while remaining highly effective. -Falcon highlights four main focuses: speed, reliability, flexibility and debuggability. +Falcon highlights four main focuses: speed, reliability, flexibility, and debuggability. It implements HTTP through "responders" such as ``on_get()``, ``on_put()``, etc. These responders receive intuitive request and response objects. Tornado -------- -`Tornado `_ is an asyncronous web framework +`Tornado `_ is an asynchronous web framework for Python that has its own event loop. This allows it to natively support WebSockets, for example. Well-written Tornado applications are known to have excellent performance characteristics. @@ -126,7 +126,7 @@ Pyramid focus on modularity. It comes with a small number of libraries ("batteries") built-in, and encourages users to extend its base functionality. A set of provided cookiecutter templates helps making new project decisions for users. -It poweres one of the most important parts of python infrastucture +It powers one of the most important parts of python infrastucture `PyPI `_. Pyramid does not have a large user base, unlike Django and Flask. It's a @@ -136,11 +136,11 @@ applications today. Masonite -------- -`Masonite `_ is a modern and developer centric, "batteries included", web framework. +`Masonite `_ is a modern and developer centric, "batteries included", web framework. The Masonite framework follows the MVC (Model-View-Controller) architecture pattern and is heavily inspired by frameworks such as Rails and Laravel, so if you are coming to Python from a Ruby or PHP background then you will feel right at home! -Masonite comes with a lot of functionality out of the box including a powerful IOC container with auto resolving dependency injection, craft command line tools and the Orator active record style ORM. +Masonite comes with a lot of functionality out of the box including a powerful IOC container with auto resolving dependency injection, craft command line tools, and the Orator active record style ORM. Masonite is perfect for beginners or experienced developers alike and works hard to be fast and easy from install through to deployment. Try it once and you’ll fall in love. @@ -155,7 +155,7 @@ Nginx ----- `Nginx `_ (pronounced "engine-x") is a web server and -reverse-proxy for HTTP, SMTP and other protocols. It is known for its +reverse-proxy for HTTP, SMTP, and other protocols. It is known for its high performance, relative simplicity, and compatibility with many application servers (like WSGI servers). It also includes handy features like load-balancing, basic authentication, streaming, and others. Designed @@ -177,9 +177,9 @@ servers and provide top performance [3]_. Gunicorn -------- -`Gunicorn `_ (Green Unicorn) is a pure-python WSGI +`Gunicorn `_ (Green Unicorn) is a pure-Python WSGI server used to serve Python applications. Unlike other Python web servers, -it has a thoughtful user-interface, and is extremely easy to use and +it has a thoughtful user interface, and is extremely easy to use and configure. Gunicorn has sane and reasonable defaults for configurations. However, some @@ -192,7 +192,7 @@ Gunicorn is the recommended choice for new Python web applications today. Waitress -------- -`Waitress `_ is a pure-python WSGI server +`Waitress `_ is a pure-Python WSGI server that claims "very acceptable performance". Its documentation is not very detailed, but it does offer some nice functionality that Gunicorn doesn't have (e.g. HTTP request buffering). @@ -207,13 +207,13 @@ uWSGI `uWSGI `_ is a full stack for building hosting services. In addition to process management, process monitoring, and other functionality, uWSGI acts as an application server for various -programming languages and protocols - including Python and WSGI. uWSGI can +programming languages and protocols -- including Python and WSGI. uWSGI can either be run as a stand-alone web router, or be run behind a full web server (such as Nginx or Apache). In the latter case, a web server can configure uWSGI and an application's operation over the `uwsgi protocol `_. uWSGI's web server support allows for dynamically configuring -Python, passing environment variables and further tuning. For full details, +Python, passing environment variables, and further tuning. For full details, see `uWSGI magic variables `_. @@ -275,7 +275,7 @@ Templating ********** Most WSGI applications are responding to HTTP requests to serve content in HTML -or other markup languages. Instead of generating directly textual content from +or other markup languages. Instead of directly generating textual content from Python, the concept of separation of concerns advises us to use templates. A template engine manages a suite of template files, with a system of hierarchy and inclusion to avoid unnecessary repetition, and is in charge of rendering @@ -313,10 +313,10 @@ Jinja2 `Jinja2 `_ is a very well-regarded template engine. It uses a text-based template language and can thus be used to generate any -type markup, not just HTML. It allows customization of filters, tags, tests +type of markup, not just HTML. It allows customization of filters, tags, tests, and globals. It features many improvements over Django's templating system. -Here some important html tags in Jinja2: +Here some important HTML tags in Jinja2: .. code-block:: html @@ -336,7 +336,7 @@ Here some important html tags in Jinja2: {% endfor %} -The next listings is an example of a web site in combination with the Tornado +The next listings are an example of a web site in combination with the Tornado web server. Tornado is not very complicated to use. .. code-block:: python @@ -434,12 +434,12 @@ engine implementation of the `Template Attribute Language (TAL) `_, and `Macro Expansion TAL (Metal) `_ syntaxes. -Chameleon is available for Python 2.5 and up (including 3.x and pypy), and +Chameleon is available for Python 2.5 and up (including 3.x and PyPy), and is commonly used by the `Pyramid Framework `_. Page Templates add within your document structure special element attributes and text markup. Using a set of simple language constructs, you control the -document flow, element repetition, text replacement and translation. Because +document flow, element repetition, text replacement, and translation. Because of the attribute-based syntax, unrendered page templates are valid HTML and can be viewed in a browser and even edited in WYSIWYG editors. This can make round-trip collaboration with designers and prototyping with static files in a @@ -493,7 +493,7 @@ Mako ---- `Mako `_ is a template language that compiles to Python -for maximum performance. Its syntax and api is borrowed from the best parts of other +for maximum performance. Its syntax and API are borrowed from the best parts of other templating languages like Django and Jinja2 templates. It is the default template language included with the `Pylons and Pyramid `_ web frameworks. diff --git a/docs/scenarios/xml.rst b/docs/scenarios/xml.rst index f9840cf92..91cafc5c4 100644 --- a/docs/scenarios/xml.rst +++ b/docs/scenarios/xml.rst @@ -30,13 +30,13 @@ can be loaded like this: import untangle obj = untangle.parse('path/to/file.xml') -and then you can get the child elements name like this: +and then you can get the child element's name attribute like this: .. code-block:: python obj.root.child['name'] -untangle also supports loading XML from a string or an URL. +untangle also supports loading XML from a string or a URL. ********* @@ -69,7 +69,7 @@ can be loaded into a Python dict like this: with open('path/to/file.xml') as fd: doc = xmltodict.parse(fd.read()) -and then you can access elements, attributes and values like this: +and then you can access elements, attributes, and values like this: .. code-block:: python @@ -79,5 +79,5 @@ and then you can access elements, attributes and values like this: doc['mydocument']['plus']['#text'] # == u'element as well' xmltodict also lets you roundtrip back to XML with the unparse function, -has a streaming mode suitable for handling files that don't fit in memory -and supports namespaces. +has a streaming mode suitable for handling files that don't fit in memory, +and supports XML namespaces. diff --git a/docs/shipping/freezing.rst b/docs/shipping/freezing.rst index 5860cb5d4..99dcba293 100644 --- a/docs/shipping/freezing.rst +++ b/docs/shipping/freezing.rst @@ -23,7 +23,7 @@ Besides, end-user software should always be in an executable format. Files ending in ``.py`` are for software engineers and system administrators. One disadvantage of freezing is that it will increase the size of your -distribution by about 2–12MB. Also, you will be responsible for shipping +distribution by about 2–12 MB. Also, you will be responsible for shipping updated versions of your application when security vulnerabilities to Python are patched. @@ -60,12 +60,12 @@ py2app no no yes yes MIT no yes yes .. note:: Freezing Python code on Linux into a Windows executable was only once - supported in PyInstaller `and later dropped. + supported in PyInstaller `and later dropped `_. .. note:: - All solutions need MS Visual C++ dll to be installed on target machine, except py2app. - Only Pyinstaller makes self-executable exe that bundles the dll when + All solutions need a Microsoft Visual C++ to be installed on the target machine, except py2app. + Only PyInstaller makes a self-executable exe that bundles the appropriate DLL when passing ``--onefile`` to :file:`Configure.py`. @@ -97,7 +97,7 @@ Prerequisite is to install :ref:`Python, Setuptools and pywin32 dependency on Wi .. note:: This will work for the most basic one file scripts. For more advanced freezing you will have to provide - include and exclude paths like so + include and exclude paths like so: .. code-block:: python @@ -109,8 +109,8 @@ Prerequisite is to install :ref:`Python, Setuptools and pywin32 dependency on Wi freezer.setIcon('my_awesome_icon.ico') -4. Provide the Microsoft Visual C runtime DLL for the freezer. It might be possible to append your :code:`sys.path` -with Microsoft Visual Studio path but I find it easier to drop :file:`msvcp90.dll` in the same folder where your script +4. Provide the Microsoft Visual C++ runtime DLL for the freezer. It might be possible to append your :code:`sys.path` +with the Microsoft Visual Studio path but I find it easier to drop :file:`msvcp90.dll` in the same folder where your script resides. 5. Freeze! @@ -122,7 +122,7 @@ resides. py2exe ~~~~~~ -Prerequisite is to install :ref:`Python on Windows `. The last release of py2exe is from the year 2014. There is not active development. +Prerequisite is to install :ref:`Python on Windows `. The last release of py2exe is from the year 2014. There is not active development. 1. Download and install http://sourceforge.net/projects/py2exe/files/py2exe/ @@ -147,7 +147,7 @@ Prerequisite is to install :ref:`Python on Windows `. The last $ python setup.py py2exe -6. Provide the Microsoft Visual C runtime DLL. Two options: `globally install dll on target machine `_ or `distribute dll alongside with .exe `_. +6. Provide the Microsoft Visual C++ runtime DLL. Two options: `globally install dll on target machine `_ or `distribute dll alongside with .exe `_. PyInstaller ~~~~~~~~~~~ @@ -183,19 +183,19 @@ To create a standard Unix executable, from say :code:`script.py`, use: $ pyinstaller script.py -This creates, +This creates: - a :code:`script.spec` file, analogous to a :code:`make` file - a :code:`build` folder, that holds some log files -- a :code:`dist` folder, that holds the main executable :code:`script`, and some dependent Python libraries, +- a :code:`dist` folder, that holds the main executable :code:`script`, and some dependent Python libraries all in the same folder as :code:`script.py`. PyInstaller puts all the Python libraries used in :code:`script.py` into the :code:`dist` folder, so when distributing the executable, distribute the whole :code:`dist` folder. -The :code:`script.spec` file can be edited to `customise the build `_, with options such as +The :code:`script.spec` file can be edited to `customise the build `_, with options such as: - bundling data files with the executable - including run-time libraries (:code:`.dll` or :code:`.so` files) that PyInstaller can't infer automatically -- adding Python run-time options to the executable, +- adding Python run-time options to the executable Now :code:`script.spec` can be run with :code:`pyinstaller` (instead of using :code:`script.py` again): @@ -203,7 +203,7 @@ Now :code:`script.spec` can be run with :code:`pyinstaller` (instead of using :c $ pyinstaller script.spec -To create a standalone windowed OS X application, use the :code:`--windowed` option +To create a standalone windowed OS X application, use the :code:`--windowed` option: .. code-block:: console diff --git a/docs/shipping/packaging.rst b/docs/shipping/packaging.rst index 9239184d4..0f0ff04d1 100644 --- a/docs/shipping/packaging.rst +++ b/docs/shipping/packaging.rst @@ -7,7 +7,7 @@ Packaging Your Code .. image:: /_static/photos/36137234682_be6898bf57_k_d.jpg -Package your code to share it with other developers. For example +Package your code to share it with other developers. For example, to share a library for other developers to use in their application, or for development tools like 'py.test'. @@ -18,7 +18,7 @@ large, professional systems. It is a well-established convention for Python code to be shared this way. If your code isn't packaged on PyPI, then it will be harder -for other developers to find it, and to use it as part of their existing +for other developers to find it and to use it as part of their existing process. They will regard such projects with substantial suspicion of being either badly managed or abandoned. @@ -57,14 +57,14 @@ Pip vs. easy_install -------------------- Use `pip `_. More details -`here `_ +`here `_. Personal PyPI ------------- -If you want to install packages from a source other than PyPI, (say, if -your packages are *proprietary*), you can do it by hosting a simple http +If you want to install packages from a source other than PyPI (say, if +your packages are *proprietary*), you can do it by hosting a simple HTTP server, running from the directory which holds those packages which need to be installed. @@ -85,9 +85,9 @@ Go to your command prompt and type: $ cd archive $ python -m SimpleHTTPServer 9000 -This runs a simple http server running on port 9000 and will list all packages +This runs a simple HTTP server running on port 9000 and will list all packages (like **MyPackage**). Now you can install **MyPackage** using any Python -package installer. Using Pip, you would do it like: +package installer. Using pip, you would do it like: .. code-block:: console @@ -95,7 +95,7 @@ package installer. Using Pip, you would do it like: Having a folder with the same name as the package name is **crucial** here. I got fooled by that, one time. But if you feel that creating a folder called -:file:`MyPackage` and keeping :file:`MyPackage.tar.gz` inside that, is +:file:`MyPackage` and keeping :file:`MyPackage.tar.gz` inside that is *redundant*, you can still install MyPackage using: .. code-block:: console @@ -105,7 +105,7 @@ I got fooled by that, one time. But if you feel that creating a folder called pypiserver ++++++++++ -`Pypiserver `_ is a minimal PyPI +`pypiserver `_ is a minimal PyPI compatible server. It can be used to serve a set of packages to easy_install or pip. It includes helpful features like an administrative command (``-U``) which will update all its packages to their latest versions @@ -115,7 +115,7 @@ found on PyPI. S3-Hosted PyPi ++++++++++++++ -One simple option for a personal PyPi server is to use Amazon S3. A +One simple option for a personal PyPI server is to use Amazon S3. A prerequisite for this is that you have an Amazon AWS account with an S3 bucket. 1. **Install all your requirements from PyPi or another source** @@ -130,8 +130,8 @@ prerequisite for this is that you have an Amazon AWS account with an S3 bucket. 4. **Upload the new files** -* Use a client like Cyberduck to sync the entire :file:`packages` folder to your s3 bucket -* Make sure you upload :code:`packages/simple/index.html` as well as all new files and directories +* Use a client like Cyberduck to sync the entire :file:`packages` folder to your s3 bucket. +* Make sure you upload :code:`packages/simple/index.html` as well as all new files and directories. 5. **Fix new file permissions** @@ -141,7 +141,7 @@ prerequisite for this is that you have an Amazon AWS account with an S3 bucket. 6. **All done** -* You can now install your package with :code:`pip install --index-url=http://your-s3-bucket/packages/simple/ YourPackage` +* You can now install your package with :code:`pip install --index-url=http://your-s3-bucket/packages/simple/ YourPackage`. .. _packaging-for-linux-distributions-ref: @@ -154,7 +154,7 @@ Creating a Linux distro package is arguably the "right way" to distribute code on Linux. Because a distribution package doesn't include the Python interpreter, it -makes the download and install about 2MB smaller than +makes the download and install about 2-12 MB smaller than :ref:`freezing your application `. Also, if a distribution releases a new security update for Python, then your @@ -165,7 +165,7 @@ for use by distributions like Red Hat or SuSE trivially easy. However, creating and maintaining the different configurations required for each distribution's format (e.g. .deb for Debian/Ubuntu, .rpm for Red -Hat/Fedora, etc) is a fair amount of work. If your code is an application that +Hat/Fedora, etc.) is a fair amount of work. If your code is an application that you plan to distribute on other platforms, then you'll also have to create and maintain the separate config required to freeze your application for Windows and OS X. It would be much less work to simply create and maintain a single From c902b8c6288d76ac9559862076bb1a413bcc2f90 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Tue, 18 Dec 2018 00:51:46 -0500 Subject: [PATCH 005/115] Use `console` lexer, not `bash`, for shell sessions --- docs/dev/virtualenvs.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 11f924882..99be16751 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -25,7 +25,7 @@ Make sure you've got Python & pip Before you go any further, make sure you have Python and that it's available from your command line. You can check this by simply running: -.. code-block:: bash +.. code-block:: console $ python --version @@ -50,7 +50,7 @@ install the latest 3.x version from `python.org`_ or refer to the Additionally, you'll need to make sure you have `pip`_ available. You can check this by running: -.. code-block:: bash +.. code-block:: console $ pip --version @@ -116,7 +116,7 @@ Pipenv manages dependencies on a per-project basis. To install packages, change into your project's directory (or just an empty directory for this tutorial) and run: -.. code-block:: bash +.. code-block:: console $ cd myproject $ pipenv install requests @@ -175,7 +175,7 @@ use it: Then you can run this script using ``pipenv run``: -.. code-block:: bash +.. code-block:: console $ pipenv run python main.py From 9ae7b69a625f811cc9158cea876f57dd3ba3ee6d Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Tue, 18 Dec 2018 01:02:58 -0500 Subject: [PATCH 006/115] Don't qualify OS X version when saying what Python version it ships with --- docs/starting/install/osx.rst | 2 +- docs/starting/install3/osx.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst index df39fe66e..654e9bb2d 100644 --- a/docs/starting/install/osx.rst +++ b/docs/starting/install/osx.rst @@ -10,7 +10,7 @@ Installing Python 2 on Mac OS X .. note:: Check out our :ref:`guide for installing Python 3 on OS X`. -The latest version of Mac OS X, High Sierra, **comes with Python 2.7 out of the box**. +**Mac OS X comes with Python 2.7 out of the box.** You do not need to install or configure anything else to use Python. Having said that, I would strongly recommend that you install the tools and libraries diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst index 82b534932..52e0b75ce 100644 --- a/docs/starting/install3/osx.rst +++ b/docs/starting/install3/osx.rst @@ -9,7 +9,7 @@ Installing Python 3 on Mac OS X .. image:: /_static/photos/34435689480_2e6f358510_k_d.jpg -The latest version of Mac OS X, High Sierra, **comes with Python 2.7 out of the box**. +**Mac OS X comes with Python 2.7 out of the box.** You do not need to install or configure anything else to use Python 2. These instructions document the installation of Python 3. From a2555b98528213c000576671b0e35e0859d65e52 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Tue, 18 Dec 2018 02:32:06 -0500 Subject: [PATCH 007/115] Standardize on American English for the Guide --- docs/dev/env.rst | 2 +- docs/intro/learning.rst | 4 ++-- docs/notes/styleguide.rst | 3 ++- docs/writing/documentation.rst | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/dev/env.rst b/docs/dev/env.rst index de67a9ae9..9b75d25b5 100644 --- a/docs/dev/env.rst +++ b/docs/dev/env.rst @@ -252,7 +252,7 @@ pyenv of the Python interpreter to be installed at the same time. This solves the problem of having different projects requiring different versions of Python. For example, it becomes very easy to install Python 2.7 for compatibility in -one project, whilst still using Python 3.4 as the default interpreter. +one project, while still using Python 3.4 as the default interpreter. pyenv isn't just limited to the CPython versions - it will also install PyPy, anaconda, miniconda, stackless, jython, and ironpython interpreters. diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst index 2c1f19c01..1ba837264 100644 --- a/docs/intro/learning.rst +++ b/docs/intro/learning.rst @@ -151,7 +151,7 @@ Python Koans ~~~~~~~~~~~~ Python Koans is a port of Edgecase's Ruby Koans. It uses a test-driven -approach, q.v. TEST DRIVEN DESIGN SECTION to provide an interactive tutorial +approach to provide an interactive tutorial teaching basic Python concepts. By fixing assertion statements that fail in a test script, this provides sequential steps to learning Python. @@ -179,7 +179,7 @@ no previous programming experience. Learn to Program in Python with Codeacademy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -A Codeacademy course for the absolute Python beginner. This free and interactive course provides and teaches the basics (and beyond) of Python programming whilst testing the user's knowledge in between progress. +A Codeacademy course for the absolute Python beginner. This free and interactive course provides and teaches the basics (and beyond) of Python programming while testing the user's knowledge in between progress. This course also features a built-in interpreter for receiving instant feedback on your learning. `Learn to Program in Python with Codeacademy `_ diff --git a/docs/notes/styleguide.rst b/docs/notes/styleguide.rst index 2d036b3be..8e32fd29d 100644 --- a/docs/notes/styleguide.rst +++ b/docs/notes/styleguide.rst @@ -84,6 +84,8 @@ Wrap text lines at 78 characters. Where necessary, lines may exceed 78 characters, especially if wrapping would make the source text more difficult to read. +Use Standard American English, not British English. + Use of the `serial comma `_ (also known as the Oxford comma) is 100% non-optional. Any attempt to submit content with a missing serial comma will result in permanent banishment @@ -209,4 +211,3 @@ documents or large incomplete sections. .. todo:: Learn the Ultimate Answer to the Ultimate Question of Life, The Universe, and Everything - diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst index 34fc57582..892dac100 100644 --- a/docs/writing/documentation.rst +++ b/docs/writing/documentation.rst @@ -182,7 +182,7 @@ comment block is a programmer's note. The docstring describes the Unlike block comments, docstrings are built into the Python language itself. This means you can use all of Python's powerful introspection capabilities to -access docstrings at runtime, compared with comments which are optimised out. +access docstrings at runtime, compared with comments which are optimized out. Docstrings are accessible from both the `__doc__` dunder attribute for almost every Python object, as well as with the built in `help()` function. From 3cf750bea1f12cb80f879e73982ee364ebcbcacb Mon Sep 17 00:00:00 2001 From: Harish Kesava Rao Date: Tue, 18 Dec 2018 07:01:38 -0600 Subject: [PATCH 008/115] Incorporated changes from style suggestions --- docs/scenarios/serialization.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/scenarios/serialization.rst b/docs/scenarios/serialization.rst index 5ba84fa60..408b59f95 100644 --- a/docs/scenarios/serialization.rst +++ b/docs/scenarios/serialization.rst @@ -21,7 +21,7 @@ Flat vs. Nested data ******************** Before beginning to serialize data, it is important to identify or decide how the -data needs to be structured during data serialization - flat or nested. +data should to be structured during data serialization - flat or nested. The differences in the two styles are shown in the below examples. Flat style: @@ -42,7 +42,7 @@ Nested style: For more reading on the two styles, please see the discussion on `Python mailing list `__, `IETF mailing list `__ and -`here `__. +`in stackexchange `__. **************** Serializing Text @@ -57,7 +57,7 @@ If the data to be serialized is located in a file and contains flat data, Python repr ---- -The repr method in Python takes a single object parameter and returns a printable representation of the input +The repr method in Python takes a single object parameter and returns a printable representation of the input: .. code-block:: python @@ -79,7 +79,7 @@ ast.literal_eval ---------------- The literal_eval method safely parses and evaluates an expression for a Python datatype. -Supported data types are: strings, numbers, tuples, lists, dicts, booleans and None. +Supported data types are: strings, numbers, tuples, lists, dicts, booleans, and None. .. code-block:: python @@ -114,8 +114,8 @@ Simple example for writing: writer.writerows(iterable) -The module's contents, functions and examples can be found -`here `__. +The module's contents, functions, and examples can be found +`in the Python documentation `__. ================== YAML (nested data) @@ -178,7 +178,7 @@ Example: root = tree.getroot() More documentation on using the `xml.dom` and `xml.sax` packages can be found -`here `__. +`in the Python XML library documentation `__. ******* @@ -186,21 +186,21 @@ Binary ******* ======================= -Numpy Array (flat data) +NumPy Array (flat data) ======================= -Python's Numpy array can be used to serialize and deserialize data to and from byte representation. +Python's NumPy array can be used to serialize and deserialize data to and from byte representation. Example: .. code-block:: python - import numpy as np + import NumPy as np - # Converting Numpy array to byte format + # Converting NumPy array to byte format byte_output = np.array([ [1, 2, 3], [4, 5, 6], [7, 8, 9] ]).tobytes() - # Converting byte format back to Numpy array + # Converting byte format back to NumPy array array_format = np.frombuffer(byte_output) From 7022a9faef9b49e5b08a59ddd87b212b76f4fadf Mon Sep 17 00:00:00 2001 From: Surya Teja Reddy Valluri Date: Tue, 18 Dec 2018 22:32:01 +0530 Subject: [PATCH 009/115] Fixed typos/grammer --- docs/dev/virtualenvs.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 4d629d8dc..fede45589 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -264,9 +264,9 @@ the prompt (e.g. ``(venv)Your-Computer:your_project UserName$)`` to let you know that it's active. From now on, any package that you install using pip will be placed in the ``venv`` folder, isolated from the global Python installation. -For windows, same command which is mentioned in step 1 can be used for creation of virtual environment. But, to activate, we use the following command. +For Windows, same command which is mentioned in step 1 can be used for creation of virtual environment. But, to activate, we use the following command. -Assuming that, you are in project directory: +Assuming that you are in project directory: .. code-block:: powershell @@ -296,7 +296,7 @@ littered across your system, and its possible you'll forget their names or where they were placed. .. note:: - Python has included virtual environment module from 3.3. It works in the simliar way as mentioned above. For details: `venv `_. + Python has included venv module from 3.3. For more details: `venv `_. Other Notes ~~~~~~~~~~~ From 179493d96ca18487f4596143aa02002bdc891030 Mon Sep 17 00:00:00 2001 From: Surya Teja Reddy Valluri Date: Tue, 18 Dec 2018 22:33:59 +0530 Subject: [PATCH 010/115] small typo --- docs/dev/virtualenvs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index fede45589..1919332b1 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -296,7 +296,7 @@ littered across your system, and its possible you'll forget their names or where they were placed. .. note:: - Python has included venv module from 3.3. For more details: `venv `_. + Python has included venv module from version 3.3. For more details: `venv `_. Other Notes ~~~~~~~~~~~ From 9633848acf2d172be6984e35205a13e04195dfaf Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Tue, 18 Dec 2018 13:42:36 -0500 Subject: [PATCH 011/115] Add a Publishing Your Code section about GitHub --- docs/contents.rst.inc | 8 ++--- docs/shipping/publishing.rst | 66 ++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 docs/shipping/publishing.rst diff --git a/docs/contents.rst.inc b/docs/contents.rst.inc index 76049aab6..014f73675 100644 --- a/docs/contents.rst.inc +++ b/docs/contents.rst.inc @@ -97,11 +97,12 @@ different scenarios. Shipping Great Python Code -------------------------- -This part of the guide focuses on deploying your Python code. +This part of the guide focuses on sharing and deploying your Python code. .. toctree:: :maxdepth: 2 + shipping/publishing shipping/packaging shipping/freezing @@ -137,8 +138,3 @@ Contribution notes and legal information (for those interested). notes/contribute notes/license notes/styleguide - - - - - diff --git a/docs/shipping/publishing.rst b/docs/shipping/publishing.rst new file mode 100644 index 000000000..90df2a799 --- /dev/null +++ b/docs/shipping/publishing.rst @@ -0,0 +1,66 @@ +.. _publishing-your-code-ref: + + +#################### +Publishing Your Code +#################### + +.. todo:: Replace this kitten with the photo we want. + +.. image:: http://placekitten.com/800/600 + +A healthy open source project needs a place to publish its code and project +management stuff so other developers can collaborate with you. This lets your +users gain a better understanding of your code, keep up with new developments, +report bugs, and contribute code. + +This development web site should include the source code history itself, a bug +tracker, a patch submission (aka "Pull Request") queue, and possibly additional +developer-oriented documentation. + +There are several free open source project hosting sites (aka "forges"). These +include GitHub, SourceForge, Bitbucket, and GitLab. GitHub is currently the best. +Use GitHub. + + +********************************* +Creating a Project Repo on GitHub +********************************* + +To publish your Python project on GitHub: + +1. Create a GitHub account if you don't already have one. + +2. Create a new repo for your project. + + 1. Click on the "+" menu next to your avatar in the upper right of the page and choose "New repository". + + 2. Name it after your project and give it an SEO-friendly description. + + 3. If you don't have an existing project repo, choose the settings to add a + README, `.gitignore`, and license. Use the Python `.gitignore` option. + +3. On the newly created repo page, click "Manage topics" and add the tags "python" and "python3" and/or "python2" as appropriate. + +4. Include a link to your new GitHub repo in your project's README file so people who just have the project distribution know where to find it. + +If this is a brand new repo, clone it to your local machine and start working: + +.. code-block:: console + + $ git clone https://github.com// + +Or, if you already have a project Git repo, add your new GitHub repo as a remote: + +.. code-block:: console + + $ cd + $ git remote add origin https://github.com// + $ git push --tags + +*********************** +When Your Project Grows +*********************** + +For more information about managing an open source software project, see the book +`Producing Open Source Software `_. From 249f031fbb10f2f6249000c090a25e8bae09e173 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Tue, 18 Dec 2018 13:57:40 -0500 Subject: [PATCH 012/115] Fix sphinx build warnings --- docs/404.rst | 1 + docs/conf.py | 2 +- docs/scenarios/crypto.rst | 2 +- docs/scenarios/web.rst | 8 +++----- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/404.rst b/docs/404.rst index ffef38e93..f4fc9fcc1 100644 --- a/docs/404.rst +++ b/docs/404.rst @@ -1,3 +1,4 @@ +:orphan: ################# 404 — Not Found diff --git a/docs/conf.py b/docs/conf.py index 81fcc6f91..974736fd6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -279,5 +279,5 @@ todo_include_todos = True intersphinx_mapping = { - 'python': ('http://docs.python.org/', None), + 'python': ('https://docs.python.org/3', None), } diff --git a/docs/scenarios/crypto.rst b/docs/scenarios/crypto.rst index e6956d75b..55cad28f6 100644 --- a/docs/scenarios/crypto.rst +++ b/docs/scenarios/crypto.rst @@ -48,7 +48,7 @@ GPGME bindings The `GPGME Python bindings `_ provide pythonic access to `GPG Made Easy `_, a C API for the entire GNU Privacy Guard suite of projects, including GPG, libgcrypt and gpgsm (the S/MIME engine). It supports Python 2.6, 2.7, 3.4 and above. Depends on the SWIG C interface for Python as well as the GnuPG software and libraries. -A more comprehensive `GPGME Python Bindings HOWTO `_ is available with the source and a HTML version is available `here `_. Python 3 sample scripts from the examples in the HOWTO are also provided with the source and are accessible `here `_. +A more comprehensive `GPGME Python Bindings HOWTO `_ is available with the source, and a HTML version is available `on http://files.au.adversary.org `_. Python 3 sample scripts from the examples in the HOWTO are also provided with the source and are accessible `on gnupg.org `_. Available under the same terms as the rest of the GnuPG Project: GPLv2 and LGPLv2.1, both with the "or any later version" clause. diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst index 40b6656ce..b83ac0bb3 100644 --- a/docs/scenarios/web.rst +++ b/docs/scenarios/web.rst @@ -136,7 +136,7 @@ applications today. Masonite -------- -`Masonite `_ is a modern and developer centric, "batteries included", web framework. +`Masonite `_ is a modern and developer centric, "batteries included", web framework. The Masonite framework follows the MVC (Model-View-Controller) architecture pattern and is heavily inspired by frameworks such as Rails and Laravel, so if you are coming to Python from a Ruby or PHP background then you will feel right at home! @@ -170,7 +170,7 @@ WSGI Servers ************ Stand-alone WSGI servers typically use less resources than traditional web -servers and provide top performance [3]_. +servers and provide top performance [1]_. .. _gunicorn-ref: @@ -531,6 +531,4 @@ Mako is well respected within the Python web community. .. rubric:: References -.. [1] `The mod_python project is now officially dead `_ -.. [2] `mod_wsgi vs mod_python `_ -.. [3] `Benchmark of Python WSGI Servers `_ +.. [1] `Benchmark of Python WSGI Servers `_ From 97679865ac4848812c074be2094347588f887123 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Tue, 18 Dec 2018 14:01:35 -0500 Subject: [PATCH 013/115] Fix "WARNING: Title level inconsistent" --- docs/dev/virtualenvs.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 11f924882..9f52ab2bd 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -219,7 +219,7 @@ Test your installation $ virtualenv --version Basic Usage -~~~~~~~~~~~ +----------- 1. Create a virtual environment for a project: @@ -285,7 +285,7 @@ littered across your system, and its possible you'll forget their names or where they were placed. Other Notes -~~~~~~~~~~~ +----------- Running ``virtualenv`` with the option ``--no-site-packages`` will not include the packages that are installed globally. This can be useful From dc85a33f3ac46f1c54183fbf52189004e27104f6 Mon Sep 17 00:00:00 2001 From: Surya Teja Reddy Valluri Date: Thu, 20 Dec 2018 21:34:46 +0530 Subject: [PATCH 014/115] Fixed Scripts issue --- docs/dev/virtualenvs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index e779e0e3a..ad929d9a2 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -270,7 +270,7 @@ Assuming that you are in project directory: .. code-block:: powershell - PS C:\Users\suryav> \venv\bin\activate + PS C:\Users\suryav> \venv\Scripts\activate Install packages as usual, for example: From 4e09d8aae016ed84abd36196563ef629022a8836 Mon Sep 17 00:00:00 2001 From: Harish Kesava Rao Date: Thu, 20 Dec 2018 20:05:01 -0600 Subject: [PATCH 015/115] Implemented feedback and suggestions from code review --- docs/scenarios/serialization.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/scenarios/serialization.rst b/docs/scenarios/serialization.rst index 408b59f95..312327bd7 100644 --- a/docs/scenarios/serialization.rst +++ b/docs/scenarios/serialization.rst @@ -10,9 +10,9 @@ Data Serialization What is data serialization? *************************** -Data serialization is the concept of converting structured data into a format +Data serialization is the process of converting structured data into a format that allows it to be shared or stored in such a way that its original -structure can be recovered or reconstructed. In some cases, the secondary intention of data +structure should be recovered or reconstructed. In some cases, the secondary intention of data serialization is to minimize the size of the serialized data which then minimizes disk space or bandwidth requirements. @@ -21,7 +21,7 @@ Flat vs. Nested data ******************** Before beginning to serialize data, it is important to identify or decide how the -data should to be structured during data serialization - flat or nested. +data should be structured during data serialization - flat or nested. The differences in the two styles are shown in the below examples. Flat style: @@ -65,7 +65,7 @@ The repr method in Python takes a single object parameter and returns a printabl a = { "Type" : "A", "field1": "value1", "field2": "value2", "field3": "value3" } # the same input can also be read from a file - a = + a = open('/tmp/file.py', 'r') # returns a printable representation of the input; # the output can be written to a file as well @@ -135,7 +135,7 @@ structures in Python. One such example is below. print(ymlexcp) Documentation on the third party module can be found -`here `__. +`in the PyYAML Documentation `__. ======================= JSON file (nested data) @@ -157,7 +157,7 @@ Writing: .. code-block:: python - # writing JSON content to a file using the dump method + # Writing JSON content to a file using the dump method import json with open('/tmp/file.json', 'w') as f: json.dump(data, f, sort_keys=True) From 8b7f86b857233433e5a7fbb6f04c80813208bfd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 22 Dec 2018 20:07:05 +0400 Subject: [PATCH 016/115] Add FastAPI to the web frameworks section --- docs/scenarios/web.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst index e68d403bf..7e5808eb1 100644 --- a/docs/scenarios/web.rst +++ b/docs/scenarios/web.rst @@ -144,6 +144,24 @@ Masonite comes with a lot of functionality out of the box including a powerful I Masonite is perfect for beginners or experienced developers alike and works hard to be fast and easy from install through to deployment. Try it once and you’ll fall in love. +FastAPI +------- + +`FastAPI `_ is a modern web framework for building +APIs with Python 3.6+. + +It has very high performance as it is based on `Starlette `_ +and `Pydantic `_. + +FastAPI takes advantage of standard Python type declarations in function parameters +to declare request parameters and bodies, perform data conversion (serialization, +parsing), data valdiation, and automatic API documentation with **OpenAPI 3** +(including **JSON Schema**). + +It includes tools and utilities for security and authentication (including OAuth2 with JWT +tokens), a dependency injection system, 2 alternative web user interfaces for automatic, +interactive, API documentation, and other features. + *********** Web Servers From 0ee8f8d40b40cf3dc36963bc3b5c3f0f3d1c9926 Mon Sep 17 00:00:00 2001 From: Marc Poulin Date: Thu, 27 Dec 2018 08:28:38 -0700 Subject: [PATCH 017/115] Update H1 to H4 heading styles Updated heading formats in style guide. --- docs/notes/styleguide.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/notes/styleguide.rst b/docs/notes/styleguide.rst index 01088e385..d38fc22ef 100644 --- a/docs/notes/styleguide.rst +++ b/docs/notes/styleguide.rst @@ -57,23 +57,23 @@ Page title: .. code-block:: rest - =================== + ******************* Time is an Illusion - =================== + ******************* Section headings: .. code-block:: rest Lunchtime Doubly So - ------------------- + =================== Sub section headings: .. code-block:: rest Very Deep - ~~~~~~~~~ + --------- ***** From d012a66ed6bf9e8bcc1157144f7755882c926e87 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Mon, 17 Dec 2018 14:25:42 -0500 Subject: [PATCH 018/115] Use "local" instead of "global" to describe where imports go --- docs/writing/structure.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst index 663605fb0..9160a04d4 100644 --- a/docs/writing/structure.rst +++ b/docs/writing/structure.rst @@ -441,8 +441,8 @@ bad practice. **Using** ``import *`` **makes code harder to read and makes dependencies less compartmentalized**. Using ``from modu import func`` is a way to pinpoint the function you want to -import and put it in the global namespace. While much less harmful than ``import -*`` because it shows explicitly what is imported in the global namespace, its +import and put it in the local namespace. While much less harmful than ``import +*`` because it shows explicitly what is imported in the local namespace, its only advantage over a simpler ``import modu`` is that it will save a little typing. From 124d9ef00c9344083fe34b1846505e66d2ac5047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 4 Jan 2019 23:59:38 +0400 Subject: [PATCH 019/115] Update FastAPI section from code review --- docs/scenarios/web.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst index 7e5808eb1..c80b97ca5 100644 --- a/docs/scenarios/web.rst +++ b/docs/scenarios/web.rst @@ -159,8 +159,8 @@ parsing), data valdiation, and automatic API documentation with **OpenAPI 3** (including **JSON Schema**). It includes tools and utilities for security and authentication (including OAuth2 with JWT -tokens), a dependency injection system, 2 alternative web user interfaces for automatic, -interactive, API documentation, and other features. +tokens), a dependency injection system, automatic generation of interactive API +documentation, and other features. *********** From 2bcf5e9a82a6b369a60a7997f8a5de8d58cfeeef Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Thu, 10 Jan 2019 11:38:36 -0600 Subject: [PATCH 020/115] Fix grammar mistake No comma before "and": https://www.grammarly.com/blog/comma-before-and/ --- docs/writing/tests.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst index 3b8f6e32f..141c92971 100644 --- a/docs/writing/tests.rst +++ b/docs/writing/tests.rst @@ -225,7 +225,7 @@ minimal example of each bug (distinguished exception type and location): xs=[1.7976321109618856e+308, 6.102390043022755e+303] ) -Hypothesis is practical as well as very powerful, and will often find bugs +Hypothesis is practical as well as very powerful and will often find bugs that escaped all other forms of testing. It integrates well with py.test, and has a strong focus on usability in both simple and advanced scenarios. From c84165588c42b2983ce572c8c1edce5cf284785a Mon Sep 17 00:00:00 2001 From: zachvalenta Date: Thu, 10 Jan 2019 14:58:49 -0500 Subject: [PATCH 021/115] remove reference to Clint --- docs/scenarios/cli.rst | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst index 266223734..44feade42 100644 --- a/docs/scenarios/cli.rst +++ b/docs/scenarios/cli.rst @@ -24,16 +24,6 @@ Some popular command-line applications include: system primarily written in Python -***** -Clint -***** - -`clint `_ is a Python module which is -filled with very useful tools for developing command-line applications. -It supports features such as: CLI colors and indents, simple and powerful -column printer, iterator based progress bars, and implicit argument handling. - - ***** Click ***** From 90af77a52641d66e0378fa8f69c4daa882003c81 Mon Sep 17 00:00:00 2001 From: George Brova Date: Tue, 15 Jan 2019 00:57:22 +0100 Subject: [PATCH 022/115] Remove explicit recommendation to use map and filter over list comprehensions --- docs/writing/structure.rst | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst index d9c61b491..842a44dd4 100644 --- a/docs/writing/structure.rst +++ b/docs/writing/structure.rst @@ -809,16 +809,12 @@ and can be used as a key for a dictionary. One peculiarity of Python that can surprise beginners is that strings are immutable. This means that when constructing a string from -its parts, it is much more efficient to accumulate the parts in a list, -which is mutable, and then glue ('join') the parts together when the -full string is needed. One thing to notice, however, is that list -comprehensions are better and faster than constructing a list in a loop -with calls to ``append()``. - -One other option is using the map function, which can 'map' a function -('str') to an iterable ('range(20)'). This results in a map object, -which you can then ('join') together just like the other examples. -The map function can be even faster than a list comprehension in some cases. +its parts, appending each part to the string is inefficient because +the entirety of the string is copied on each append. +Instead, it is much more efficient to accumulate the parts in a list, +which is mutable, and then glue (``join``) the parts together when the +full string is needed. List comprehensions are usually the fastest and +most idiomatic way to do this. **Bad** @@ -830,7 +826,7 @@ The map function can be even faster than a list comprehension in some cases. nums += str(n) # slow and inefficient print nums -**Good** +**Better** .. code-block:: python @@ -840,20 +836,12 @@ The map function can be even faster than a list comprehension in some cases. nums.append(str(n)) print "".join(nums) # much more efficient -**Better** - -.. code-block:: python - - # create a concatenated string from 0 to 19 (e.g. "012..1819") - nums = [str(n) for n in range(20)] - print "".join(nums) - **Best** .. code-block:: python # create a concatenated string from 0 to 19 (e.g. "012..1819") - nums = map(str, range(20)) + nums = [str(n) for n in range(20)] print "".join(nums) One final thing to mention about strings is that using ``join()`` is not always From c283dbdf9b1f6d95894ade96e843ea522d123dad Mon Sep 17 00:00:00 2001 From: George Brova Date: Tue, 15 Jan 2019 01:00:13 +0100 Subject: [PATCH 023/115] Reword the discussion on short ways to manipulate lists - Remove emphasis on map and filter, in favor of generator expressions. - Move list comprehensions and generator expressions under "Short ways to manipulate lists" rather than "Filtering a list". - Add some examples. --- docs/writing/style.rst | 117 +++++++++++++++++++++++------------------ 1 file changed, 66 insertions(+), 51 deletions(-) diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 33ed1ad01..8f15a1b02 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -521,7 +521,7 @@ Conventions Here are some conventions you should follow to make your code easier to read. Check if a variable equals a constant -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You don't need to explicitly compare a value to True, or None, or 0 -- you can just add it to the if statement. See `Truth Value Testing @@ -588,80 +588,104 @@ Short Ways to Manipulate Lists `List comprehensions `_ -provide a powerful, concise way to work with lists. Also, the :py:func:`map` and -:py:func:`filter` functions can perform operations on lists using a different, -more concise syntax. +provide a powerful, concise way to work with lists. -Filtering a list -~~~~~~~~~~~~~~~~ +`Generator expressions +`_ +follow almost the same syntax as list comprehensions but return a generator +instead of a list. -**Bad**: +Creating a new list requires more work and uses more memory. If you are just going +to loop through the new list, prefer using an iterator instead. -Never remove items from a list while you are iterating through it. +**Bad**: .. code-block:: python - # Filter elements greater than 4 - a = [3, 4, 5] - for i in a: - if i > 4: - a.remove(i) + # needlessly allocates a list of all (gpa, name) entires in memory + valedictorian = max([(student.gpa, student.name) for student in graduates]) -Don't make multiple passes through the list. +**Good**: .. code-block:: python - while i in a: - a.remove(i) + valedictorian = max((student.gpa, student.name) for student in graduates) + + +Use list comprehensions when you really need to create a second list, for +example if you need to use the result multiple times. + + +If your logic is too complicated for a short list comprehension or generator +expression, consider using a generator function instead of returning a list. **Good**: -Python has a few standard ways of filtering lists. -The approach you use depends on: +.. code-block:: python + + def make_batches(items, batch_size): + """ + >>> list(make_batches([1, 2, 3, 4, 5], batch_size=3)) + [[1, 2, 3], [4, 5]] + """ + current_batch = [] + for item in items: + current_batch.append(item) + if len(current_batch) == batch_size: + yield current_batch + current_batch = [] + yield current_batch -* Python 2.x vs. 3.x -* Lists vs. iterators -* Possible side effects of modifying the original list -Python 2.x vs. 3.x -:::::::::::::::::: +Never use a list comprehension just for its side effects. -Starting with Python 3.0, the :py:func:`filter` function returns an iterator instead of a list. -Wrap it in :py:func:`list` if you truly need a list. +**Bad**: .. code-block:: python - list(filter(...)) + [print(x) for x in seqeunce] -List comprehensions and generator expressions work the same in both 2.x and 3.x (except that comprehensions in 2.x "leak" variables into the enclosing namespace): +**Good**: - * Comprehensions create a new list object. - * Generators iterate over the original list. +.. code-block:: python -The :py:func:`filter` function: + for x in sequence: + print(x) - * in 2.x returns a list (use itertools.ifilter if you want an iterator) - * in 3.x returns an iterator -Lists vs. iterators -::::::::::::::::::: +Filtering a list +~~~~~~~~~~~~~~~~ + +**Bad**: + +Never remove items from a list while you are iterating through it. + +.. code-block:: python + + # Filter elements greater than 4 + a = [3, 4, 5] + for i in a: + if i > 4: + a.remove(i) + +Don't make multiple passes through the list. + +.. code-block:: python + + while i in a: + a.remove(i) + +**Good**: -Creating a new list requires more work and uses more memory. If you a just going to loop through the new list, consider using an iterator instead. +Use a list comprehension or generator expression. .. code-block:: python # comprehensions create a new list object filtered_values = [value for value in sequence if value != x] - # Or (2.x) - filtered_values = filter(lambda i: i != x, sequence) # generators don't create another list filtered_values = (value for value in sequence if value != x) - # Or (3.x) - filtered_values = filter(lambda i: i != x, sequence) - # Or (2.x) - filtered_values = itertools.ifilter(lambda i: i != x, sequence) - Possible side effects of modifying the original list @@ -673,10 +697,6 @@ Modifying the original list can be risky if there are other variables referencin # replace the contents of the original list sequence[::] = [value for value in sequence if value != x] - # Or - sequence[::] = (value for value in sequence if value != x) - # Or - sequence[::] = filter(lambda value: value != x, sequence) Modifying the values in a list @@ -705,11 +725,6 @@ It's safer to create a new list object and leave the original alone. # assign the variable "a" to a new list without changing "b" a = [i + 3 for i in a] - # Or (Python 2.x): - a = map(lambda i: i + 3, a) - # Or (Python 3.x) - a = list(map(lambda i: i + 3, a)) - Use :py:func:`enumerate` keep a count of your place in the list. From 6749edc80a07d39fd4c5ab9d6607a720e1f0f39c Mon Sep 17 00:00:00 2001 From: Kevin D Barbour Date: Thu, 7 Feb 2019 08:45:55 -0500 Subject: [PATCH 024/115] Fix broken link to python-requests.org (http only) --- docs/dev/virtualenvs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 9f0390ad8..538bfdf11 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -156,7 +156,7 @@ when you share your project with others. You should get output similar to this Adding requests to Pipfile's [packages]... P.S. You have excellent taste! ✨ 🍰 ✨ -.. _Requests: https://python-requests.org +.. _Requests: http://python-requests.org Using installed packages From 507281032e2a4bff921691aa424c20c541dae305 Mon Sep 17 00:00:00 2001 From: Marc Poulin Date: Fri, 8 Feb 2019 14:54:07 -0700 Subject: [PATCH 025/115] python-requests.org redirect Before, http://python-requests.org would redirect to http://docs.python-requests.org/en/master/ Now, page links to http://docs.python-requests.org/en/master/ directly. --- docs/dev/virtualenvs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 538bfdf11..be9bd5803 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -156,7 +156,7 @@ when you share your project with others. You should get output similar to this Adding requests to Pipfile's [packages]... P.S. You have excellent taste! ✨ 🍰 ✨ -.. _Requests: http://python-requests.org +.. _Requests: http://docs.python-requests.org/en/master/ Using installed packages From ff05d2f76c85b5c13d5c01884f331a58251de402 Mon Sep 17 00:00:00 2001 From: Christopher Snow Date: Fri, 8 Feb 2019 21:35:06 -0500 Subject: [PATCH 026/115] Fix inconsistency with virtualenv project folder naming, and a couple grammar checks. --- docs/dev/virtualenvs.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index be9bd5803..3b6a25eb9 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -118,7 +118,7 @@ tutorial) and run: .. code-block:: console - $ cd myproject + $ cd project_folder $ pipenv install requests Pipenv will install the excellent `Requests`_ library and create a ``Pipfile`` @@ -225,7 +225,7 @@ Basic Usage .. code-block:: console - $ cd my_project_folder + $ cd project_folder $ virtualenv venv ``virtualenv venv`` will create a folder in the current directory which will @@ -260,19 +260,19 @@ or change the interpreter globally with an env variable in ``~/.bashrc``: $ source venv/bin/activate The name of the current virtual environment will now appear on the left of -the prompt (e.g. ``(venv)Your-Computer:your_project UserName$)`` to let you know +the prompt (e.g. ``(venv)Your-Computer:project_folder UserName$)`` to let you know that it's active. From now on, any package that you install using pip will be placed in the ``venv`` folder, isolated from the global Python installation. -For Windows, same command which is mentioned in step 1 can be used for creation of virtual environment. But, to activate, we use the following command. +For Windows, the same command mentioned in step 1 can be used to create a virtual environment. However, activating the environment requires a slightly different command. -Assuming that you are in project directory: +Assuming that you are in your project directory: -.. code-block:: powershell +.. code-block:: console - PS C:\Users\suryav> \venv\Scripts\activate + C:\Users\SomeUser\project_folder> venv\Scripts\activate -Install packages as usual, for example: +Install packages using the ``pip`` command: .. code-block:: console @@ -283,13 +283,13 @@ Install packages as usual, for example: .. code-block:: console - $ deactivate + $ deactivate This puts you back to the system's default Python interpreter with all its installed libraries. To delete a virtual environment, just delete its folder. (In this case, -it would be ``rm -rf my_project``.) +it would be ``rm -rf project_folder``.) After a while, though, you might end up with a lot of virtual environments littered across your system, and it's possible you'll forget their names or @@ -366,23 +366,23 @@ Basic Usage .. code-block:: console - $ mkvirtualenv my_project + $ mkvirtualenv project_folder -This creates the :file:`my_project` folder inside :file:`~/Envs`. +This creates the :file:`project_folder` folder inside :file:`~/Envs`. 2. Work on a virtual environment: .. code-block:: console - $ workon my_project + $ workon project_folder Alternatively, you can make a project, which creates the virtual environment, and also a project directory inside ``$WORKON_HOME``, which is ``cd``-ed into -when you ``workon myproject``. +when you ``workon project_folder``. .. code-block:: console - $ mkproject myproject + $ mkproject project_folder **virtualenvwrapper** provides tab-completion on environment names. It really helps when you have a lot of environments and have trouble remembering their From 696d7293190ea1ba3817c90183b6997d8bcb498e Mon Sep 17 00:00:00 2001 From: Mario Kostelac Date: Sat, 9 Feb 2019 21:08:24 +0000 Subject: [PATCH 027/115] Add link to the original essey --- docs/writing/structure.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst index 842a44dd4..26b39b94a 100644 --- a/docs/writing/structure.rst +++ b/docs/writing/structure.rst @@ -60,7 +60,7 @@ it is important. Sample Repository ::::::::::::::::: -**tl;dr**: This is what `Kenneth Reitz `_ recommends. +**tl;dr**: This is what `Kenneth Reitz recommended in 2013`. This repository is `available on GitHub `__. From 92c70b865a4bd95efcea15180848b4d2c597ca86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Dam=C3=A1zio?= Date: Sun, 10 Feb 2019 17:58:44 -0200 Subject: [PATCH 028/115] Adding instructions for bbFreeze and PyInstaller in Linux stubs in Freezing Your Code. --- docs/shipping/freezing.rst | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/docs/shipping/freezing.rst b/docs/shipping/freezing.rst index 99dcba293..4f39c6f6a 100644 --- a/docs/shipping/freezing.rst +++ b/docs/shipping/freezing.rst @@ -221,6 +221,45 @@ Linux bbFreeze ~~~~~~~~ +.. warning:: bbFreeze will ONLY work in Python 2.x environment, since it's no longer being maintained as stated by it's former maintainer. If you're interested in it, check the repository in `here `_. + +bbFreeze can be used with all distributions that has Python installed along with pip2 and/or easy_install. + +For pip2, use the following: + +.. code-block:: console + + $ pip2 install bbfreeze + +Or, for easy_install: + +.. code-block:: console + + $ easy_install bbfreeze + +With bbFreeze installed, you're ready to freeze your applications. + +Let's assume you have a script, say, "hello.py" and a module called "module.py" and you have a function in it that's being used in your script. +No need to worry, you can just ask to freeze the main entrypoint of your script and it should freeze entirely: + +.. code-block:: console + + $ bbfreeze script.py + +With this, it creates a folder called dist/, of which contains the executable of the script and required .so (shared objects) files linked against libraries used within the Python script. + +Alternatively, you can create a script that does the freezing for you. An API for the freezer is available from the library within: + +.. code-block:: python + + from bbfreeze import Freezer + + freezer = Freezer(distdir='dist') + freezer.addScript('script.py', gui_only=True) # Enable gui_only kwarg for app that uses GUI packages. + freezer() PyInstaller ~~~~~~~~~~~ +PyInstaller can be used in a similar fashion as in OS X. The installation goes in the same manner as shown in the OS X section. + +Don't forget to have dependencies such as Python and pip installed for usage. From bd742f7bb6be7576f8e59e3349a339bbcae54236 Mon Sep 17 00:00:00 2001 From: Tom Nicholas <35968931+TomNicholas@users.noreply.github.com> Date: Mon, 11 Feb 2019 10:53:52 +0000 Subject: [PATCH 029/115] Add xarray to scientific.rst --- docs/scenarios/scientific.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/scenarios/scientific.rst b/docs/scenarios/scientific.rst index 3461bb353..cca234225 100644 --- a/docs/scenarios/scientific.rst +++ b/docs/scenarios/scientific.rst @@ -91,13 +91,24 @@ are available in the `matplotlib gallery Pandas ------ -`Pandas `_ is data manipulation library +`Pandas `_ is a data manipulation library based on NumPy which provides many useful functions for accessing, indexing, merging, and grouping data easily. The main data structure (DataFrame) is close to what could be found in the R statistical package; that is, heterogeneous data tables with name indexing, time series operations, and auto-alignment of data. +xarray +------ + +`xarray `_ is similar to Pandas, but it +is intended for wrapping multidimensional scientific data. By labelling the +data with dimensions, coordinates, and attributes, it makes complex +multidimensional operations clearer and more intuitive. It also wraps +matplotlib for quick plotting, and can apply most operations in parallel using +`dask `_. + + Rpy2 ---- From 7013647d927f0dc514bc5d1267515b0310060526 Mon Sep 17 00:00:00 2001 From: Anton Kochkov Date: Mon, 25 Feb 2019 16:39:54 +0800 Subject: [PATCH 030/115] Don't recommend Python 2 Library Switch the Further Reading section to Python 3 link --- docs/writing/structure.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst index 842a44dd4..b536b5941 100644 --- a/docs/writing/structure.rst +++ b/docs/writing/structure.rst @@ -675,7 +675,7 @@ by the ``with`` statement. CustomOpen is first instantiated and then its is finished executing, the ``__exit__`` method is then called. And now the generator approach using Python's own -`contextlib `_: +`contextlib `_: .. code-block:: python @@ -890,5 +890,5 @@ Runners Further Reading *************** -- http://docs.python.org/2/library/ +- http://docs.python.org/3/library/ - http://www.diveintopython.net/toc/index.html From 907d9a7b8223eed22c6515c676fc81fe6d5cc871 Mon Sep 17 00:00:00 2001 From: Dave Mackey Date: Mon, 25 Feb 2019 21:42:38 -0500 Subject: [PATCH 031/115] Removed extraneous "by" and unnecessary "especially" from cli.rst --- docs/scenarios/cli.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst index 44feade42..08e80468a 100644 --- a/docs/scenarios/cli.rst +++ b/docs/scenarios/cli.rst @@ -50,8 +50,8 @@ Plac `Plac `_ is a simple wrapper over the Python standard library `argparse `_, which hides most of its complexity by using a declarative interface: the -argument parser is inferred rather than written down by imperatively. This -module targets especially unsophisticated users, programmers, sysadmins, +argument parser is inferred rather than written down imperatively. This +module targets unsophisticated users, programmers, sysadmins, scientists, and in general people writing throw-away scripts for themselves, who choose to create a command-line interface because it is quick and simple. From 188e336732943bb039a345fd1c2f7adaad74f4f5 Mon Sep 17 00:00:00 2001 From: Dave Mackey Date: Mon, 25 Feb 2019 22:09:07 -0500 Subject: [PATCH 032/115] - Changing PyGTk to be less verbose, formatted as note. - Updated PyjamasDesktop to Pyjs Desktop, streamlined description -- Removed link to Python wiki entry, content outdated - Updated link for wxPython, it had changed --- docs/scenarios/gui.rst | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst index e012048bc..ed9e2a55a 100644 --- a/docs/scenarios/gui.rst +++ b/docs/scenarios/gui.rst @@ -33,11 +33,7 @@ Cocoa GTk *** -PyGTK provides Python bindings for the GTK+ toolkit. Like the GTK+ library -itself, it is currently licensed under the GNU LGPL. It is worth noting that -PyGTK only currently supports the Gtk-2.X API (NOT Gtk-3.0). It is currently -recommended that PyGTK not be used for new projects and that existing -applications be ported from PyGTK to PyGObject. +.. note:: PyGTK provides Python bindings for the GTK+ toolkit. However, it has been superseded by PyGObject. PyGTK should not be used for new projects and existing projects should be ported to PyGObject. ******************** @@ -101,17 +97,14 @@ http://www.riverbankcomputing.co.uk/software/pyqt/download ***************************** -PyjamasDesktop (pyjs Desktop) +Pyjs Desktop (formerly Pyjamas Desktop) ***************************** -PyjamasDesktop is a port of Pyjamas. PyjamasDesktop is application widget set -for desktop and a cross-platform framework. (After release v0.6 PyjamasDesktop -is a part of Pyjamas (Pyjs)). Briefly, it allows the exact same Python web +Pyjs Desktop is a application widget set for desktop and a cross-platform framework. It allows the exact same Python web application source code to be executed as a standalone desktop application. -`Python Wiki for PyjamasDesktop `_. -The main website: `pyjs Desktop `_. +The main website: `pyjs `_. ** @@ -177,5 +170,5 @@ extension module (native code) that wraps the popular wxWidgets cross platform GUI library, which is written in C++. **Install (Stable) wxPython** -*go to http://www.wxpython.org/download.php#stable and download the appropriate +*go to https://www.wxpython.org/pages/downloads/ and download the appropriate package for your OS.* From 554fb163d9857d8c7c57c710f9859e07e261e8b6 Mon Sep 17 00:00:00 2001 From: Dave Mackey Date: Mon, 25 Feb 2019 22:29:18 -0500 Subject: [PATCH 033/115] - Reformatting first paragraph of cli to conform to 78 character width. -- Same for Click, Cement. - In gui, similarly for Camelot, PyGObject, Kivy, Pyjs Desktop, Qt -- PySimpleGUI, Toga, TkInterwxPython --- docs/scenarios/cli.rst | 31 +++++++++++----------- docs/scenarios/gui.rst | 60 ++++++++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 42 deletions(-) diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst index 08e80468a..f90010eca 100644 --- a/docs/scenarios/cli.rst +++ b/docs/scenarios/cli.rst @@ -5,13 +5,12 @@ Command-line Applications .. image:: /_static/photos/34435690330_11930b5987_k_d.jpg -Command-line applications, also referred to as -`Console Applications `_, -are computer programs designed to be used from a text interface, such as a -`shell `_. Command-line -applications usually accept various inputs as arguments, often referred to as -parameters or sub-commands, as well as options, often referred to as flags or -switches. +Command-line applications, also referred to as `Console Applications +`_, are computer programs +designed to be used from a text interface, such as a `shell +`_. Command-line applications +usually accept various inputs as arguments, often referred to as parameters or +sub-commands, as well as options, often referred to as flags or switches. Some popular command-line applications include: @@ -29,9 +28,9 @@ Click ***** `click `_ is a Python package for creating -command-line interfaces in a composable way with as little code as -possible. This “Command-Line Interface Creation Kit” is highly -configurable but comes with good defaults out of the box. +command-line interfaces in a composable way with as little code as possible. +This “Command-Line Interface Creation Kit” is highly configurable but comes +with good defaults out of the box. ****** @@ -72,12 +71,12 @@ sub-command to do the work. Cement ****** -`Cement `_ is an advanced CLI Application Framework. -Its goal is to introduce a standard and feature-full platform -for both simple and complex command line applications as well -as support rapid development needs without sacrificing quality. -Cement is flexible, and its use cases span from the simplicity of a micro-framework -to the complexity of a mega-framework. +`Cement `_ is an advanced CLI Application +Framework. Its goal is to introduce a standard and feature-full platform for +both simple and complex command line applications as well as support rapid +development needs without sacrificing quality. Cement is flexible, and its use +cases span from the simplicity of a micro-framework to the complexity of a +mega-framework. *********** diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst index ed9e2a55a..520b3dea7 100644 --- a/docs/scenarios/gui.rst +++ b/docs/scenarios/gui.rst @@ -14,8 +14,8 @@ Camelot ******* `Camelot `_ provides components for building -applications on top of Python, SQLAlchemy, and Qt. It is inspired by -the Django admin interface. +applications on top of Python, SQLAlchemy, and Qt. It is inspired by the Django +admin interface. The main resource for information is the website: http://www.python-camelot.com @@ -40,8 +40,10 @@ GTk PyGObject aka (PyGi) ******************** -`PyGObject `_ provides Python bindings which gives access to the entire GNOME software platform. -It is fully compatible with GTK+ 3. Here is a tutorial to get started with `Python GTK+ 3 Tutorial `_. +`PyGObject `_ provides Python +bindings which gives access to the entire GNOME software platform. It is fully +compatible with GTK+ 3. Here is a tutorial to get started with `Python GTK+ 3 +Tutorial `_. `API Reference `_ @@ -52,8 +54,8 @@ Kivy `Kivy `_ is a Python library for development of multi-touch enabled media rich applications. The aim is to allow for quick and easy -interaction design and rapid prototyping, while making your code reusable -and deployable. +interaction design and rapid prototyping, while making your code reusable and +deployable. Kivy is written in Python, based on OpenGL, and supports different input devices such as: Mouse, Dual Mouse, TUIO, WiiMote, WM_TOUCH, HIDtouch, Apple's products, @@ -100,8 +102,9 @@ http://www.riverbankcomputing.co.uk/software/pyqt/download Pyjs Desktop (formerly Pyjamas Desktop) ***************************** -Pyjs Desktop is a application widget set for desktop and a cross-platform framework. It allows the exact same Python web -application source code to be executed as a standalone desktop application. +Pyjs Desktop is a application widget set for desktop and a cross-platform +framework. It allows the exact same Python web application source code to be +executed as a standalone desktop application. The main website: `pyjs `_. @@ -111,35 +114,40 @@ The main website: `pyjs `_. Qt ** -`Qt `_ is a cross-platform application framework that -is widely used for developing software with a GUI but can also be used for -non-GUI applications. +`Qt `_ is a cross-platform application framework that is +widely used for developing software with a GUI but can also be used for non-GUI +applications. *********** PySimpleGUI *********** -`PySimpleGUI `_ is a wrapper for Tkinter and Qt (others on the way). The amount of code required to implement custom GUIs is much shorter using PySimpleGUI than if the same GUI were written directly using Tkinter or Qt. PySimpleGUI code can be "ported" between GUI frameworks by changing import statements. +`PySimpleGUI `_ is a wrapper for Tkinter +and Qt (others on the way). The amount of code required to implement custom +GUIs is much shorter using PySimpleGUI than if the same GUI were written +directly using Tkinter or Qt. PySimpleGUI code can be "ported" between GUI +frameworks by changing import statements. .. code-block:: console $ pip install pysimplegui -PySimpleGUI is contained in a single PySimpleGUI.py file. Should pip installation be impossible, copying the PySimpleGUI.py file into a project's folder is all that's required to import and begin using. +PySimpleGUI is contained in a single PySimpleGUI.py file. Should pip +installation be impossible, copying the PySimpleGUI.py file into a project's +folder is all that's required to import and begin using. **** Toga **** -`Toga `_ is a Python native, OS -native, cross platform GUI toolkit. Toga consists of a library of base -components with a shared interface to simplify platform-agnostic GUI -development. +`Toga `_ is a Python native, OS native, +cross platform GUI toolkit. Toga consists of a library of base components with a +shared interface to simplify platform-agnostic GUI development. -Toga is available on mOS, Windows, Linux (GTK), and mobile platforms such -as Android and iOS. +Toga is available on mOS, Windows, Linux (GTK), and mobile platforms such as +Android and iOS. ** @@ -154,8 +162,8 @@ Both Tk and Tkinter are available on most Unix platforms, as well as on Windows and Macintosh systems. Starting with the 8.0 release, Tk offers native look and feel on all platforms. -There's a good multi-language Tk tutorial with Python examples at -`TkDocs `_. There's more information +There's a good multi-language Tk tutorial with Python examples at `TkDocs +`_. There's more information available on the `Python Wiki `_. @@ -163,11 +171,11 @@ available on the `Python Wiki `_. wxPython ******** -wxPython is a GUI toolkit for the Python programming language. It allows -Python programmers to create programs with a robust, highly functional -graphical user interface, simply and easily. It is implemented as a Python -extension module (native code) that wraps the popular wxWidgets cross platform -GUI library, which is written in C++. +wxPython is a GUI toolkit for the Python programming language. It allows Python +programmers to create programs with a robust, highly functional graphical user +interface, simply and easily. It is implemented as a Python extension module +(native code) that wraps the popular wxWidgets cross platform GUI library, which +is written in C++. **Install (Stable) wxPython** *go to https://www.wxpython.org/pages/downloads/ and download the appropriate From 8c7e00814751dc5b048dc9c235fc72e2b91496c7 Mon Sep 17 00:00:00 2001 From: Dave Mackey Date: Tue, 26 Feb 2019 08:26:03 -0500 Subject: [PATCH 034/115] - Updating link to Dive Into Python --- docs/writing/structure.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst index b536b5941..3cf38fca5 100644 --- a/docs/writing/structure.rst +++ b/docs/writing/structure.rst @@ -891,4 +891,4 @@ Further Reading *************** - http://docs.python.org/3/library/ -- http://www.diveintopython.net/toc/index.html +- https://www.diveinto.org/python3/ From 011423c6514d202c7e5d7d503b094bac6232de52 Mon Sep 17 00:00:00 2001 From: Dave Mackey Date: Thu, 28 Feb 2019 09:02:27 -0500 Subject: [PATCH 035/115] - In scenarios/admin.rst, adding a StackOverflow link to explain eggs - In scenarios/clibs.rst, adding StackOverflow link to explain ABI -- In same, adding Microsoft Doc link to explain LoadLibrary -- Minor grammar changes -- Updating struct documentation link to use /3/ instead of /3.5/ --- docs/scenarios/admin.rst | 9 +++++---- docs/scenarios/clibs.rst | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index e275018ae..826906af0 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -392,10 +392,11 @@ Buildout `Buildout `_ is an open source software build tool. Buildout is created using the Python programming language. It implements a -principle of separation of configuration from the scripts that do the setting up. -Buildout is primarily used to download and set up dependencies in Python eggs -format of the software being developed or deployed. Recipes for build tasks in any -environment can be created, and many are already available. +principle of separation of configuration from the scripts that do the setting +up. Buildout is primarily used to download and set up dependencies in `Python +eggs `_ +format of the software being developed or deployed. Recipes for build tasks in +any environment can be created, and many are already available. ******* diff --git a/docs/scenarios/clibs.rst b/docs/scenarios/clibs.rst index 5470576b0..13c9e4802 100644 --- a/docs/scenarios/clibs.rst +++ b/docs/scenarios/clibs.rst @@ -12,9 +12,9 @@ C Foreign Function Interface `CFFI `_ provides a simple to use mechanism for interfacing with C from both CPython and PyPy. It supports two -modes: an inline ABI compatibility mode (example provided below), which allows +modes: an inline `ABI `_ compatibility mode (example provided below), which allows you to dynamically load and run functions from executable modules (essentially -exposing the same functionality as LoadLibrary or dlopen), and an API mode, +exposing the same functionality as `LoadLibrary `_ or `dlopen `_), and an API mode, which allows you to build C extension modules. ABI Interaction @@ -41,13 +41,13 @@ library for interfacing with C/C++ from CPython, and it provides not only full access to the native C interface of most major operating systems (e.g., kernel32 on Windows, or libc on \*nix), but also provides support for loading and interfacing with dynamic libraries, such as DLLs or shared objects, at -runtime. It does bring along with it a whole host of types for interacting +runtime. It brings along with it a whole host of types for interacting with system APIs, and allows you to rather easily define your own complex types, such as structs and unions, and allows you to modify things such as padding and alignment, if needed. It can be a bit crufty to use, but in -conjunction with the `struct `_ +conjunction with the `struct `_ module, you are essentially provided full control over how your data types get -translated into something usable by a pure C(++) method. +translated into something usable by a pure C/C++ method. Struct Equivalents ~~~~~~~~~~~~~~~~~~ From 808eb3a28655c478fb7374436eb4c91c7a422555 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Tue, 18 Dec 2018 02:05:53 -0500 Subject: [PATCH 036/115] Fix redirected and broken links --- docs/_templates/sidebarintro.html | 10 ++++----- docs/conf.py | 2 +- docs/dev/env.rst | 34 ++++++++++++++--------------- docs/dev/virtualenvs.rst | 2 +- docs/intro/duction.rst | 6 +++--- docs/intro/learning.rst | 36 ++++++++++++++++--------------- docs/intro/news.rst | 8 +++---- docs/notes/contribute.rst | 2 +- docs/scenarios/cli.rst | 2 +- docs/scenarios/client.rst | 2 +- docs/scenarios/db.rst | 2 +- docs/scenarios/network.rst | 8 +++---- docs/scenarios/scientific.rst | 2 +- docs/scenarios/speed.rst | 8 +++---- docs/scenarios/xml.rst | 2 +- docs/shipping/freezing.rst | 4 ++-- docs/shipping/packaging.rst | 8 +++---- docs/starting/install/linux.rst | 5 ++--- docs/starting/install/osx.rst | 8 +++---- docs/starting/install/win.rst | 6 +++--- docs/starting/install3/linux.rst | 5 ++--- docs/starting/install3/osx.rst | 8 +++---- docs/starting/install3/win.rst | 4 ++-- docs/writing/logging.rst | 14 ++++++------ docs/writing/style.rst | 6 +++--- docs/writing/tests.rst | 2 +- 26 files changed, 98 insertions(+), 98 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 17527253f..98284ec67 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -59,8 +59,8 @@

Contributors

Useful Links

@@ -69,8 +69,8 @@

Translations

  • English
  • French
  • Chinese
  • -
  • Japanese
  • +
  • Japanese
  • Korean
  • -
  • Filipino
  • -
  • Brazilian Portuguese
  • +
  • Filipino
  • +
  • Brazilian Portuguese
  • diff --git a/docs/conf.py b/docs/conf.py index 974736fd6..64e78e4f8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,7 +46,7 @@ # General information about the project. project = u'pythonguide' -copyright = u'2011–2018 Kenneth Reitz & Real Python. CC BY-NC-SA 3.0' +copyright = u'2011–2018 Kenneth Reitz & Real Python. CC BY-NC-SA 3.0' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/docs/dev/env.rst b/docs/dev/env.rst index 042d42dce..bc754e49b 100644 --- a/docs/dev/env.rst +++ b/docs/dev/env.rst @@ -87,10 +87,10 @@ using ```` key or any other customized keys. .. _indent: http://www.vim.org/scripts/script.php?script_id=974 .. _syntax: http://www.vim.org/scripts/script.php?script_id=790 -.. _Pyflakes: http://pypi.python.org/pypi/pyflakes/ -.. _pycodestyle: https://pypi.python.org/pypi/pycodestyle/ -.. _syntastic: https://github.com/scrooloose/syntastic -.. _Python-mode: https://github.com/klen/python-mode +.. _Pyflakes: http://pypi.org/project/pyflakes/ +.. _pycodestyle: https://pypi.org/project/pycodestyle/ +.. _syntastic: https://github.com/vim-syntastic/syntastic +.. _Python-mode: https://github.com/python-mode/python-mode .. _SuperTab: http://www.vim.org/scripts/script.php?script_id=1643 .. _vim-flake8: https://github.com/nvie/vim-flake8 @@ -103,7 +103,7 @@ Emacs user is `Python Programming in Emacs`_ at EmacsWiki. 1. Emacs itself comes with a Python mode. -.. _Python Programming in Emacs: http://emacswiki.org/emacs/PythonProgrammingInEmacs +.. _Python Programming in Emacs: https://www.emacswiki.org/emacs/PythonProgrammingInEmacs TextMate -------- @@ -135,7 +135,7 @@ Atom Atom is web native (HTML, CSS, JS), focusing on modular design and easy plugin development. It comes with native package control and a plethora of packages. Recommended for Python development is -`Linter `_ combined with +`Linter `_ combined with `linter-flake8 `_. @@ -163,7 +163,7 @@ MIT licensed. Enthought Canopy ---------------- -`Enthought Canopy `_ is a Python +`Enthought Canopy `_ is a Python IDE which is focused towards Scientists and Engineers as it provides pre installed libraries for data analysis. @@ -171,13 +171,13 @@ Eclipse ------- The most popular Eclipse plugin for Python development is Aptana's -`PyDev `_. +`PyDev `_. Komodo IDE ---------- -`Komodo IDE `_ is developed by +`Komodo IDE `_ is developed by ActiveState and is a commercial IDE for Windows, Mac, and Linux. `KomodoEdit `_ is the open source alternative. @@ -188,8 +188,8 @@ Spyder `Spyder `_ is an IDE specifically geared toward working with scientific Python libraries (namely -`SciPy `_). It includes integration with pyflakes_, -`pylint `_ and +`SciPy `_). It includes integration with pyflakes_, +`pylint `_ and `rope `_. Spyder is open source (free), offers code completion, syntax highlighting, @@ -242,13 +242,13 @@ Virtual Environments Virtual Environments provide a powerful way to isolate project package dependencies. This means that you can use packages particular to a Python project without installing them system wide and thus avoiding potential version conflicts. To start using and see more information: -`Virtual Environments `_ docs. +`Virtual Environments `_ docs. pyenv ----- -`pyenv `_ is a tool to allow multiple versions +`pyenv `_ is a tool to allow multiple versions of the Python interpreter to be installed at the same time. This solves the problem of having different projects requiring different versions of Python. For example, it becomes very easy to install Python 2.7 for compatibility in @@ -264,7 +264,7 @@ pyenv. pyenv then works out which version of Python should be run based on environment variables, ``.python-version`` files, and the global default. pyenv isn't a tool for managing virtual environments, but there is the plugin -`pyenv-virtualenv `_ which automates +`pyenv-virtualenv `_ which automates the creation of different environments, and also makes it possible to use the existing pyenv tools to switch to different environments based on environment variables or ``.python-version`` files. @@ -314,7 +314,7 @@ To download and install IPython with all its optional dependencies for the noteb BPython ------- -`bpython `_ is an alternative interface to the +`bpython `_ is an alternative interface to the Python interpreter for Unix-like operating systems. It has the following features: @@ -334,8 +334,8 @@ features: ptpython -------- -`ptpython `_ is a REPL build -on top of the `prompt_toolkit `_ +`ptpython `_ is a REPL build +on top of the `prompt_toolkit `_ library. It is considered to be an alternative to BPython_. Features include: * Syntax highlighting diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index be9bd5803..dfb23b424 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -200,7 +200,7 @@ Congratulations, you now know how to install and use Python packages! ✨ 🍰 Lower level: virtualenv ======================= -`virtualenv `_ is a tool to create +`virtualenv `_ is a tool to create isolated Python environments. virtualenv creates a folder which contains all the necessary executables to use the packages that a Python project would need. diff --git a/docs/intro/duction.rst b/docs/intro/duction.rst index 7619002d6..16baebc0d 100644 --- a/docs/intro/duction.rst +++ b/docs/intro/duction.rst @@ -28,11 +28,11 @@ include: object serialization, and much more. Additionally, the - `Python Package Index `_ is available + `Python Package Index `_ is available for users to submit their packages for widespread use, similar to - Perl's `CPAN `_. There is a thriving community + Perl's `CPAN `_. There is a thriving community of very powerful Python frameworks and tools like - the `Django `_ web framework and the + the `Django `_ web framework and the `NumPy `_ set of math routines. * **integration with other systems** diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst index 6e2d0ea41..e06e64da3 100644 --- a/docs/intro/learning.rst +++ b/docs/intro/learning.rst @@ -41,14 +41,14 @@ thepythonguru.com is a tutorial focused on beginner programmers. It covers many in depth. It also teaches you some advanced constructs of Python like lambda expressions and regular expressions. And last it finishes off with the tutorial "How to access MySQL db using Python" - `Python for Beginners `_ + `Python for Beginners `_ Learn Python Interactive Tutorial ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Learnpython.org is an easy non-intimidating way to get introduced to Python. The website takes the same approach used on the popular -`Try Ruby `_ website. It has an interactive Python +`Try Ruby `_ website. It has an interactive Python interpreter built into the site that allows you to go through the lessons without having to install Python locally. @@ -65,9 +65,9 @@ resource for learning all aspects of the language. Learn Python Step by Step ~~~~~~~~~~~~~~~~~~~~~~~~~ -Techbeamers.com provides step-by-step tutorials to teach Python. Each tutorial is supplemented with logically added coding snippets and equips with a follow-up quiz on the subject learned. There is a section for `Python interview questions `_ to help job seekers. You can also read essential `Python tips `_ and learn `best coding practices `_ for writing quality code. Here, you'll get the right platform to learn Python quickly. +Techbeamers.com provides step-by-step tutorials to teach Python. Each tutorial is supplemented with logically added coding snippets and equips with a follow-up quiz on the subject learned. There is a section for `Python interview questions `_ to help job seekers. You can also read essential `Python tips `_ and learn `best coding practices `_ for writing quality code. Here, you'll get the right platform to learn Python quickly. -`Learn Python Basic to Advanced `_ +`Learn Python Basic to Advanced `_ Online Python Tutor @@ -108,7 +108,7 @@ Learn Python the Hard Way This is an excellent beginner programmer's guide to Python. It covers "hello world" from the console to the web. - `Learn Python the Hard Way `_ + `Learn Python the Hard Way `_ Crash into Python @@ -117,7 +117,7 @@ Crash into Python Also known as *Python for Programmers with 3 Hours*, this guide gives experienced developers from other languages a crash course on Python. - `Crash into Python `_ + `Crash into Python `_ Dive Into Python 3 @@ -161,11 +161,11 @@ For those used to languages and figuring out puzzles on their own, this can be a fun, attractive option. For those new to Python and programming, having an additional resource or reference will be helpful. - `Python Koans `_ + `Python Koans `_ More information about test driven development can be found at these resources: - `Test Driven Development `_ + `Test Driven Development `_ A Byte of Python @@ -178,13 +178,15 @@ no previous programming experience. `A Byte of Python for Python 3.x `_ -Learn to Program in Python with Codeacademy +Computer Science Path on Codecademy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -A Codeacademy course for the absolute Python beginner. This free and interactive course provides and teaches the basics (and beyond) of Python programming while testing the user's knowledge in between progress. +A Codeacademy course for the absolute Python beginner. This free and interactive +course provides and teaches the basics (and beyond) of Python programming while +testing the user's knowledge in between progress. This course also features a built-in interpreter for receiving instant feedback on your learning. - `Learn to Program in Python with Codeacademy `_ + `Computer Science Path on Codecademy `_ Code the blocks @@ -220,7 +222,7 @@ pages, it is a very brief overview of some of the most common adapations programmers need to make to become efficient intermediate level Python programmers. - `Effective Python `_ + `Effective Python `_ ******** @@ -251,7 +253,7 @@ and eventually an application, including a chapter on using zc.buildout. Later chapters detail best practices such as writing documentation, test-driven development, version control, optimization, and profiling. - `Expert Python Programming `_ + `Expert Python Programming `_ A Guide to Python's Magic Methods @@ -278,7 +280,7 @@ A Primer on Scientific Programming with Python, written by Hans Petter Langtangen, mainly covers Python's usage in the scientific field. In the book, examples are chosen from mathematics and the natural sciences. - `A Primer on Scientific Programming with Python `_ + `A Primer on Scientific Programming with Python `_ Numerical Methods in Engineering with Python ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -286,7 +288,7 @@ Numerical Methods in Engineering with Python Numerical Methods in Engineering with Python, written by Jaan Kiusalaas, puts the emphasis on numerical methods and how to implement them in Python. - `Numerical Methods in Engineering with Python `_ + `Numerical Methods in Engineering with Python `_ ******************** @@ -405,6 +407,6 @@ some commonly used piece of code, followed by an explanation of why the idiom is important. It also contains two code samples for each idiom: the "Harmful" way to write it and the "Idiomatic" way. - `For Python 2.7.3+ `_ + `For Python 2.7.3+ `_ - `For Python 3.3+ `_ + `For Python 3.3+ `_ diff --git a/docs/intro/news.rst b/docs/intro/news.rst index 9f8e9232b..d1cda93be 100644 --- a/docs/intro/news.rst +++ b/docs/intro/news.rst @@ -32,7 +32,7 @@ Planet Python This is an aggregate of Python news from a growing number of developers. - `Planet Python `_ + `Planet Python `_ ********* @@ -42,7 +42,7 @@ This is an aggregate of Python news from a growing number of developers. /r/python is the Reddit Python community where users contribute and vote on Python-related news. - `/r/python `_ + `/r/python `_ ******************* @@ -70,7 +70,7 @@ Python Weekly Python Weekly is a free weekly newsletter featuring curated news, articles, new releases, jobs, etc. related to Python. - `Python Weekly `_ + `Python Weekly `_ *********** @@ -80,7 +80,7 @@ Python News Python News is the news section in the official Python web site (www.python.org). It briefly highlights the news from the Python community. - `Python News `_ + `Python News `_ ******************** diff --git a/docs/notes/contribute.rst b/docs/notes/contribute.rst index d82fb76da..b6c72bb4f 100644 --- a/docs/notes/contribute.rst +++ b/docs/notes/contribute.rst @@ -30,5 +30,5 @@ If you'd like to contribute, there's plenty to do. Here's a short todo_ list. .. include:: ../../TODO.rst -.. _GitHub: http://github.com/kennethreitz/python-guide/ +.. _GitHub: https://github.com/kennethreitz/python-guide/ .. _todo: https://github.com/kennethreitz/python-guide/blob/master/TODO.rst diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst index f90010eca..1bf810e0e 100644 --- a/docs/scenarios/cli.rst +++ b/docs/scenarios/cli.rst @@ -46,7 +46,7 @@ POSIX-style usage instructions. Plac **** -`Plac `_ is a simple wrapper +`Plac `_ is a simple wrapper over the Python standard library `argparse `_, which hides most of its complexity by using a declarative interface: the argument parser is inferred rather than written down imperatively. This diff --git a/docs/scenarios/client.rst b/docs/scenarios/client.rst index a10f1db38..1457fa479 100644 --- a/docs/scenarios/client.rst +++ b/docs/scenarios/client.rst @@ -29,7 +29,7 @@ pooling are 100% automatic, powered by urllib3, which is embedded within Requests. - `Documentation `_ -- `PyPi `_ +- `PyPi `_ - `GitHub `_ diff --git a/docs/scenarios/db.rst b/docs/scenarios/db.rst index 58211e26b..ecdb83008 100644 --- a/docs/scenarios/db.rst +++ b/docs/scenarios/db.rst @@ -52,7 +52,7 @@ Also included is a command-line tool for exporting SQL data. Django ORM ********** -The Django ORM is the interface used by `Django `_ +The Django ORM is the interface used by `Django `_ to provide database access. It's based on the idea of diff --git a/docs/scenarios/network.rst b/docs/scenarios/network.rst index f8306c70a..bb751b78e 100644 --- a/docs/scenarios/network.rst +++ b/docs/scenarios/network.rst @@ -10,19 +10,19 @@ Networking Twisted ******* -`Twisted `_ is an event-driven networking +`Twisted `_ is an event-driven networking engine. It can be used to build applications around many different networking protocols, including HTTP servers and clients, applications using SMTP, POP3, IMAP, or SSH protocols, instant messaging, -and `much more `_. +and `much more `_. ***** PyZMQ ***** -`PyZMQ `_ is the Python binding for -`ZeroMQ `_, which is a high-performance asynchronous +`PyZMQ `_ is the Python binding for +`ZeroMQ `_, which is a high-performance asynchronous messaging library. One great advantage of ZeroMQ is that it can be used for message queuing without a message broker. The basic patterns for this are: diff --git a/docs/scenarios/scientific.rst b/docs/scenarios/scientific.rst index cca234225..bb0547323 100644 --- a/docs/scenarios/scientific.rst +++ b/docs/scenarios/scientific.rst @@ -160,7 +160,7 @@ add-ons are available for academics and researchers. Canopy ------ -`Canopy `_ is another scientific +`Canopy `_ is another scientific Python distribution, produced by `Enthought `_. A limited 'Canopy Express' variant is available for free, but Enthought charges for the full distribution. Free licenses are available for academics. diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst index 485872360..1ac16b02e 100644 --- a/docs/scenarios/speed.rst +++ b/docs/scenarios/speed.rst @@ -76,7 +76,7 @@ C Extensions Cython ------ -`Cython `_ implements a superset of the Python language +`Cython `_ implements a superset of the Python language with which you are able to write C and C++ modules for Python. Cython also allows you to call functions from compiled C libraries. Using Cython allows you to take advantage of Python's strong typing of variables and operations. @@ -448,14 +448,14 @@ Multiprocessing .. _`PyPy`: http://pypy.org -.. _`The GIL`: http://wiki.python.org/moin/GlobalInterpreterLock +.. _`The GIL`: https://wiki.python.org/moin/GlobalInterpreterLock .. _`guide`: http://www.dabeaz.com/python/UnderstandingGIL.pdf .. _`New GIL`: http://www.dabeaz.com/python/NewGIL.pdf -.. _`Special care`: http://docs.python.org/c-api/init.html#threads +.. _`Special care`: https://docs.python.org/c-api/init.html#threads .. _`David Beazley's`: http://www.dabeaz.com/GIL/gilvis/measure2.py .. _`concurrent.futures`: https://docs.python.org/3/library/concurrent.futures.html .. _`Future`: https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Future .. _`threading`: https://docs.python.org/3/library/threading.html -.. _`stackoverflow post`: http://stackoverflow.com/questions/26688424/python-threads-are-printing-at-the-same-time-messing-up-the-text-output +.. _`stackoverflow post`: https://stackoverflow.com/questions/26688424/python-threads-are-printing-at-the-same-time-messing-up-the-text-output .. _`data race`: https://en.wikipedia.org/wiki/Race_condition .. _`Lock`: https://docs.python.org/3/library/threading.html#lock-objects diff --git a/docs/scenarios/xml.rst b/docs/scenarios/xml.rst index 91cafc5c4..3bdf15b6c 100644 --- a/docs/scenarios/xml.rst +++ b/docs/scenarios/xml.rst @@ -43,7 +43,7 @@ untangle also supports loading XML from a string or a URL. xmltodict ********* -`xmltodict `_ is another simple +`xmltodict `_ is another simple library that aims at making XML feel like working with JSON. An XML file like this: diff --git a/docs/shipping/freezing.rst b/docs/shipping/freezing.rst index 99dcba293..1b614f378 100644 --- a/docs/shipping/freezing.rst +++ b/docs/shipping/freezing.rst @@ -61,7 +61,7 @@ py2app no no yes yes MIT no yes yes .. note:: Freezing Python code on Linux into a Windows executable was only once supported in PyInstaller `and later dropped - `_. + `_. .. note:: All solutions need a Microsoft Visual C++ to be installed on the target machine, except py2app. @@ -139,7 +139,7 @@ Prerequisite is to install :ref:`Python on Windows `. The last 3. (Optionally) `include icon `_ -4. (Optionally) `one-file mode `_ +4. (Optionally) `one-file mode `_ 5. Generate :file:`.exe` into :file:`dist` directory: diff --git a/docs/shipping/packaging.rst b/docs/shipping/packaging.rst index 0f0ff04d1..9a8be8c1d 100644 --- a/docs/shipping/packaging.rst +++ b/docs/shipping/packaging.rst @@ -48,7 +48,7 @@ On Linux, you may also want to consider For Python Developers ********************* -If you're writing an open source Python module, `PyPI `_ +If you're writing an open source Python module, `PyPI `_ , more properly known as *The Cheeseshop*, is the place to host it. @@ -56,8 +56,8 @@ If you're writing an open source Python module, `PyPI `_ Pip vs. easy_install -------------------- -Use `pip `_. More details -`here `_. +Use `pip `_. More details +`here `_. Personal PyPI @@ -105,7 +105,7 @@ I got fooled by that, one time. But if you feel that creating a folder called pypiserver ++++++++++ -`pypiserver `_ is a minimal PyPI +`pypiserver `_ is a minimal PyPI compatible server. It can be used to serve a set of packages to easy_install or pip. It includes helpful features like an administrative command (``-U``) which will update all its packages to their latest versions diff --git a/docs/starting/install/linux.rst b/docs/starting/install/linux.rst index f0dc63950..4198be8be 100644 --- a/docs/starting/install/linux.rst +++ b/docs/starting/install/linux.rst @@ -38,7 +38,7 @@ it makes it much easier for you to use other third-party Python libraries. Setuptools & Pip **************** -The two most crucial third-party Python packages are `setuptools `_ and `pip `_. +The two most crucial third-party Python packages are `setuptools `_ and `pip `_. Once installed, you can download, install and uninstall any compliant Python software product with a single command. It also enables you to add this network installation @@ -75,6 +75,5 @@ manage your virtual environments. -------------------------------- -This page is a remixed version of `another guide `_, +This page is a remixed version of `another guide `_, which is available under the same license. - diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst index 48e5bdfe9..d0aa601aa 100644 --- a/docs/starting/install/osx.rst +++ b/docs/starting/install/osx.rst @@ -33,7 +33,7 @@ Let's install a real version of Python. Before installing Python, you'll need to install a C compiler. The fastest way is to install the Xcode Command Line Tools by running ``xcode-select --install``. You can also download the full version of -`Xcode `_ from the Mac App Store, or the +`Xcode `_ from the Mac App Store, or the minimal but unofficial `OSX-GCC-Installer `_ package. @@ -50,9 +50,9 @@ package. While OS X comes with a large number of Unix utilities, those familiar with Linux systems will notice one key component missing: a decent package manager. -`Homebrew `_ fills this void. +`Homebrew `_ fills this void. -To `install Homebrew `_, open :file:`Terminal` or +To `install Homebrew `_, open :file:`Terminal` or your favorite OS X terminal emulator and run .. code-block:: console @@ -129,5 +129,5 @@ To start using this and see more information: :ref:`Virtual Environments `_, +This page is a remixed version of `another guide `_, which is available under the same license. diff --git a/docs/starting/install/win.rst b/docs/starting/install/win.rst index e22837c8f..ac304aec1 100644 --- a/docs/starting/install/win.rst +++ b/docs/starting/install/win.rst @@ -13,7 +13,7 @@ Installing Python 2 on Windows First, download the `latest version `_ of Python 2.7 from the official website. If you want to be sure you are installing a fully up-to-date version, click the Downloads > Windows link from the home page of the -`Python.org web site `_ . +`Python.org web site `_ . The Windows version is provided as an MSI package. To install it manually, just double-click the file. The MSI package format allows Windows administrators to @@ -57,7 +57,7 @@ makes it much easier for you to use other third-party Python libraries. Setuptools + Pip **************** -The two most crucial third-party Python packages are `setuptools `_ and `pip `_. +The two most crucial third-party Python packages are `setuptools `_ and `pip `_. Once installed, you can download, install and uninstall any compliant Python software product with a single command. It also enables you to add this network installation @@ -92,5 +92,5 @@ To start using this and see more information: :ref:`Virtual Environments `_, +This page is a remixed version of `another guide `_, which is available under the same license. diff --git a/docs/starting/install3/linux.rst b/docs/starting/install3/linux.rst index 36b439ec2..47765c43f 100644 --- a/docs/starting/install3/linux.rst +++ b/docs/starting/install3/linux.rst @@ -67,7 +67,7 @@ This will launch the Python 3 interpreter. Setuptools & Pip **************** -The two most crucial third-party Python packages are `setuptools `_ and `pip `_. +The two most crucial third-party Python packages are `setuptools `_ and `pip `_. Once installed, you can download, install and uninstall any compliant Python software product with a single command. It also enables you to add this network installation @@ -113,6 +113,5 @@ So, onward! To the :ref:`Pipenv & Virtual Environments -------------------------------- -This page is a remixed version of `another guide `_, +This page is a remixed version of `another guide `_, which is available under the same license. - diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst index 9ffe20225..654cca115 100644 --- a/docs/starting/install3/osx.rst +++ b/docs/starting/install3/osx.rst @@ -27,7 +27,7 @@ Doing it Right Let's install a real version of Python. Before installing Python, you'll need to install GCC. GCC can be obtained -by downloading `Xcode `_, the smaller +by downloading `Xcode `_, the smaller `Command Line Tools `_ (must have an Apple account) or the even smaller `OSX-GCC-Installer `_ package. @@ -43,9 +43,9 @@ package. While OS X comes with a large number of Unix utilities, those familiar with Linux systems will notice one key component missing: a package manager. -`Homebrew `_ fills this void. +`Homebrew `_ fills this void. -To `install Homebrew `_, open :file:`Terminal` or +To `install Homebrew `_, open :file:`Terminal` or your favorite OS X terminal emulator and run .. code-block:: console @@ -139,5 +139,5 @@ So, onward! To the :ref:`Pipenv & Virtual Environments -------------------------------- -This page is a remixed version of `another guide `_, +This page is a remixed version of `another guide `_, which is available under the same license. diff --git a/docs/starting/install3/win.rst b/docs/starting/install3/win.rst index 588d1ccb0..2e259ac0f 100644 --- a/docs/starting/install3/win.rst +++ b/docs/starting/install3/win.rst @@ -24,7 +24,7 @@ Once you've run this command, you should be able to launch Python directly from Setuptools + Pip **************** -The two most crucial third-party Python packages are `setuptools `_ and `pip `_, +The two most crucial third-party Python packages are `setuptools `_ and `pip `_, which let you download, install and uninstall any compliant Python software product with a single command. It also enables you to add this network installation capability to your own Python software with very little work. @@ -52,5 +52,5 @@ So, onward! To the :ref:`Pipenv & Virtual Environments -------------------------------- -This page is a remixed version of `another guide `_, +This page is a remixed version of `another guide `_, which is available under the same license. diff --git a/docs/writing/logging.rst b/docs/writing/logging.rst index 5ea058efc..d21838838 100644 --- a/docs/writing/logging.rst +++ b/docs/writing/logging.rst @@ -70,9 +70,9 @@ this in your ``__init__.py``: Logging in an Application ************************* -The `twelve factor app `_, an authoritative reference +The `twelve factor app `_, an authoritative reference for good practice in application development, contains a section on -`logging best practice `_. It emphatically +`logging best practice `_. It emphatically advocates for treating log events as an event stream, and for sending that event stream to standard output to be handled by the application environment. @@ -192,9 +192,9 @@ Example Configuration Directly in Code logger.debug('often makes a very good meal of %s', 'visiting tourists') -.. _basic logging tutorial: http://docs.python.org/howto/logging.html#logging-basic-tutorial -.. _logging configuration: https://docs.python.org/howto/logging.html#configuring-logging -.. _logging tutorial: http://docs.python.org/howto/logging.html -.. _configuring logging for a library: https://docs.python.org/howto/logging.html#configuring-logging-for-a-library -.. _log record: https://docs.python.org/library/logging.html#logrecord-attributes +.. _basic logging tutorial: http://docs.python.org/3/howto/logging.html#logging-basic-tutorial +.. _logging configuration: https://docs.python.org/3/howto/logging.html#configuring-logging +.. _logging tutorial: http://docs.python.org/3/howto/logging.html +.. _configuring logging for a library: https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library +.. _log record: https://docs.python.org/3/library/logging.html#logrecord-attributes .. _requests source: https://github.com/kennethreitz/requests diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 8f15a1b02..56f108603 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -271,7 +271,7 @@ Idioms A programming idiom, put simply, is a *way* to write code. The notion of programming idioms is discussed amply at `c2 `_ -and at `Stack Overflow `_. +and at `Stack Overflow `_. Idiomatic Python code is often referred to as being *Pythonic*. @@ -403,7 +403,7 @@ hand, the hash of the item will tell Python where in the set to look for a matching item. As a result, the search can be done quickly, even if the set is large. Searching in dictionaries works the same way. For more information see this -`StackOverflow `_ +`StackOverflow `_ page. For detailed information on the amount of time various common operations take on each of these data structures, see `this page `_. @@ -496,7 +496,7 @@ Then run it on a file or series of files to get a report of any violations. optparse.py:472:29: E221 multiple spaces before operator optparse.py:544:21: W601 .has_key() is deprecated, use 'in' -The program `autopep8 `_ can be used to +The program `autopep8 `_ can be used to automatically reformat code in the PEP 8 style. Install the program with: .. code-block:: console diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst index 141c92971..0cf20f7ee 100644 --- a/docs/writing/tests.rst +++ b/docs/writing/tests.rst @@ -274,7 +274,7 @@ This way if you ever switch to a newer Python version and no longer need the unittest2 module, you can simply change the import in your test module without the need to change any other code. - `unittest2 `_ + `unittest2 `_ mock From d200bf04f8d7b4f192625e63cb233793a9152940 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Tue, 18 Dec 2018 00:48:19 -0500 Subject: [PATCH 037/115] Format Windows console examples with doscon or powershell --- docs/notes/styleguide.rst | 5 ++++- docs/starting/install/win.rst | 8 ++++---- docs/starting/install3/win.rst | 6 ++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/notes/styleguide.rst b/docs/notes/styleguide.rst index d38fc22ef..fdd7c1884 100644 --- a/docs/notes/styleguide.rst +++ b/docs/notes/styleguide.rst @@ -109,7 +109,10 @@ Command line examples: $ run command --help $ ls .. -Be sure to include the ``$`` prefix before each line. +Be sure to include the ``$`` prefix before each line for Unix console examples. + +For Windows console examples, use ``doscon`` or ``powershell`` instead of +``console``, and omit the ``$`` prefix. Python interpreter examples: diff --git a/docs/starting/install/win.rst b/docs/starting/install/win.rst index e22837c8f..7b98ddb06 100644 --- a/docs/starting/install/win.rst +++ b/docs/starting/install/win.rst @@ -32,13 +32,13 @@ tedious, so add the directories for your default Python version to the :envvar:` Assuming that your Python installation is in :file:`C:\\Python27\\`, add this to your :envvar:`PATH`: -.. code-block:: console +.. code-block:: doscon C:\Python27\;C:\Python27\Scripts\ You can do this easily by running the following in ``powershell``: -.. code-block:: console +.. code-block:: powershell [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User") @@ -68,9 +68,9 @@ pip by default. To see if pip is installed, open a command prompt and run -.. code-block:: console +.. code-block:: doscon - $ command -v pip + command -v pip To install pip, `follow the official pip installation guide `_ - this will automatically install the latest version of setuptools. diff --git a/docs/starting/install3/win.rst b/docs/starting/install3/win.rst index 588d1ccb0..51ec7ab7a 100644 --- a/docs/starting/install3/win.rst +++ b/docs/starting/install3/win.rst @@ -12,7 +12,7 @@ It's a community system packager manager for Windows 7+. (It's very much like Ho Once done, installing Python 3 is very simple, because Chocolatey pushes Python 3 as the default. -.. code-block:: console +.. code-block:: doscon choco install python @@ -29,7 +29,9 @@ which let you download, install and uninstall any compliant Python software product with a single command. It also enables you to add this network installation capability to your own Python software with very little work. -All supported versions of Python 3 include pip, so just make sure it's up to date:: +All supported versions of Python 3 include pip, so just make sure it's up to date: + +.. code-block:: doscon python -m pip install -U pip From 972b2df51c055559f290425ab7f395a58cdc29b5 Mon Sep 17 00:00:00 2001 From: Gourav Chawla Date: Mon, 18 Feb 2019 18:41:35 +0530 Subject: [PATCH 038/115] Update copyright to be dynamic - Updated the copyright to be dynamic. - Made changes in import to adhere to PEP8 --- docs/conf.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 64e78e4f8..6277fe430 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,7 +11,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import datetime +import os +import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -45,8 +47,11 @@ master_doc = 'index' # General information about the project. +current_year = datetime.datetime.now().year project = u'pythonguide' -copyright = u'2011–2018 Kenneth Reitz & Real Python. CC BY-NC-SA 3.0' +copyright = (u'2011-{} Kenneth Reitz' + ' & Real Python.' + ' CC BY-NC-SA 3.0').format(current_year) # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -241,7 +246,7 @@ epub_title = u'pythonguide' epub_author = u'Kenneth Reitz' epub_publisher = u'Kenneth Reitz' -epub_copyright = u'2011–2018, Kenneth Reitz & Real Python' +epub_copyright = u'2011–{}, Kenneth Reitz & Real Python'.format(current_year) # The language of the text. It defaults to the language option # or en if the language is not set. From 34e6410f25e7c75102ec18c0a215101bfcc452b7 Mon Sep 17 00:00:00 2001 From: Harry Moreno Date: Sun, 24 Mar 2019 15:47:51 -0400 Subject: [PATCH 039/115] Removing virtualenv should delete venv directory --- docs/dev/virtualenvs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 310db9d40..b1ca871b1 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -289,7 +289,7 @@ This puts you back to the system's default Python interpreter with all its installed libraries. To delete a virtual environment, just delete its folder. (In this case, -it would be ``rm -rf project_folder``.) +it would be ``rm -rf venv``.) After a while, though, you might end up with a lot of virtual environments littered across your system, and it's possible you'll forget their names or From fe7c85b26e348e9cb28a4058cea5c95895b7834c Mon Sep 17 00:00:00 2001 From: Harry Moreno Date: Sun, 24 Mar 2019 16:24:29 -0400 Subject: [PATCH 040/115] Replace Autoenv with direnv * Autoenv has been locked, use direnv as recommended by Autoenv --- docs/dev/virtualenvs.rst | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 310db9d40..7fc4d7dd9 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -427,20 +427,15 @@ virtualenv-burrito With `virtualenv-burrito `_, you can have a working virtualenv + virtualenvwrapper environment in a single command. -autoenv +direnv ------- -When you ``cd`` into a directory containing a :file:`.env`, `autoenv `_ +When you ``cd`` into a directory containing a :file:`.env`, `direnv `_ automagically activates the environment. Install it on Mac OS X using ``brew``: .. code-block:: console - $ brew install autoenv + $ brew install direnv -And on Linux: - -.. code-block:: console - - $ git clone git://github.com/kennethreitz/autoenv.git ~/.autoenv - $ echo 'source ~/.autoenv/activate.sh' >> ~/.bashrc +On Linux follow the instructions at `direnv.net ` From 9523ee5debeabc73f28151240e3a88f54777d793 Mon Sep 17 00:00:00 2001 From: julien tayon Date: Fri, 29 Mar 2019 19:42:43 +0100 Subject: [PATCH 041/115] you don't let friends use pycrypto Unmaintained package with CVE might not be a good help https://www.cvedetails.com/product/22441/Dlitz-Pycrypto.html?vendor_id=11993 I also share the opinion of the author that pycrypto and its fork may promote insecure usage (like AES::ECB) https://theartofmachinery.com/2017/02/02/dont_use_pycrypto.html --- docs/scenarios/crypto.rst | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/docs/scenarios/crypto.rst b/docs/scenarios/crypto.rst index a5c3d7737..262337204 100644 --- a/docs/scenarios/crypto.rst +++ b/docs/scenarios/crypto.rst @@ -89,34 +89,3 @@ Example print("Hang on ... did you say *all* of GnuPG? Yep.") else: pass - - - -******** -PyCrypto -******** - -`PyCrypto `_ is another library, -which provides secure hash functions and various encryption algorithms. It -supports Python version 2.1 through 3.3. - -Installation -~~~~~~~~~~~~ - -.. code-block:: console - - $ pip install pycrypto - -Example -~~~~~~~ - -.. code-block:: python - - from Crypto.Cipher import AES - # Encryption - encryption_suite = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456') - cipher_text = encryption_suite.encrypt("A really secret message. Not for prying eyes.") - - # Decryption - decryption_suite = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456') - plain_text = decryption_suite.decrypt(cipher_text) From 22e11f45f4c1bcbea426b21ec9a627e87ea3ca2e Mon Sep 17 00:00:00 2001 From: zachvalenta Date: Sun, 31 Mar 2019 06:35:40 -0400 Subject: [PATCH 042/115] add paragraph on loguru to logging section --- docs/writing/logging.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/writing/logging.rst b/docs/writing/logging.rst index d21838838..b609dc721 100644 --- a/docs/writing/logging.rst +++ b/docs/writing/logging.rst @@ -10,6 +10,8 @@ The :mod:`logging` module has been a part of Python's Standard Library since version 2.3. It is succinctly described in :pep:`282`. The documentation is notoriously hard to read, except for the `basic logging tutorial`_. +As an alternative, `loguru `_ provides an approach to logging nearly as simple as using a simple ``print`` statement. + Logging serves two purposes: - **Diagnostic logging** records events related to the application's From b08cf0cb8b6d5100611b81ea1a0eabafbaa30e01 Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 23 Apr 2019 14:01:32 +0200 Subject: [PATCH 043/115] feat: enhance search to the main introduction page --- docs/_templates/sidebarintro.html | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 98284ec67..9e2d92c2a 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -20,16 +20,13 @@ height: 100%; } - - - - + +

    This opinionated guide exists to provide both novice and expert Python developers a best practice handbook to the installation, configuration, and usage of Python on a daily basis. From f43eff5fd452533ff0bb5fa3c156abdc5bc496f6 Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 23 Apr 2019 14:02:09 +0200 Subject: [PATCH 044/115] feat: add search to every documentation pages --- docs/_templates/sidebarlogo.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 363663f1b..540b92a48 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -6,6 +6,28 @@

    + + + + +

    This opinionated guide exists to provide both novice and expert Python developers a best practice handbook to the installation, configuration, and usage of Python on a daily basis.

    From e113bad35b6ebec51ac17f15567cfc0b61d57f52 Mon Sep 17 00:00:00 2001 From: Dan Bader Date: Tue, 30 Apr 2019 08:41:37 -0700 Subject: [PATCH 045/115] Update Readme.rst --- Readme.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Readme.rst b/Readme.rst index d7d26dfb1..f35c71225 100644 --- a/Readme.rst +++ b/Readme.rst @@ -3,6 +3,8 @@ Hitchhiker's Guide to Python **Python Best Practices Guidebook** +→ Read the free guide at: `docs.python-guide.org `_ + .. image:: https://farm1.staticflickr.com/628/33173824932_58add34581_k_d.jpg ----------- From 2a9ac95853cbf81714654a13dedae8f353e6d87d Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Sun, 12 May 2019 23:05:05 +0800 Subject: [PATCH 046/115] Fix broken reference to Stack Overflow post This fixes the following build warning: python-guide/docs/scenarios/speed.rst:397: WARNING: Unknown target name: "stack overflow post". --- docs/scenarios/speed.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst index 1ac16b02e..e99b18f4e 100644 --- a/docs/scenarios/speed.rst +++ b/docs/scenarios/speed.rst @@ -456,6 +456,6 @@ Multiprocessing .. _`concurrent.futures`: https://docs.python.org/3/library/concurrent.futures.html .. _`Future`: https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Future .. _`threading`: https://docs.python.org/3/library/threading.html -.. _`stackoverflow post`: https://stackoverflow.com/questions/26688424/python-threads-are-printing-at-the-same-time-messing-up-the-text-output +.. _`Stack Overflow post`: https://stackoverflow.com/questions/26688424/python-threads-are-printing-at-the-same-time-messing-up-the-text-output .. _`data race`: https://en.wikipedia.org/wiki/Race_condition .. _`Lock`: https://docs.python.org/3/library/threading.html#lock-objects From 69277aa1f57d3766484fb1c0c2ae4fdf93fa877a Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Mon, 13 May 2019 15:49:04 +0800 Subject: [PATCH 047/115] Fix some typos --- docs/intro/learning.rst | 6 +++--- docs/scenarios/gui.rst | 2 +- docs/scenarios/web.rst | 6 +++--- docs/writing/style.rst | 2 +- docs/writing/tests.rst | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst index e06e64da3..9def6f459 100644 --- a/docs/intro/learning.rst +++ b/docs/intro/learning.rst @@ -30,7 +30,7 @@ Real Python is a repository of free and in-depth Python tutorials created by a d Python Basics ~~~~~~~~~~~~~ -pythonbasics.org is an introductiory tutorial for beginners. The tutorial includes exercises. It covers the basics and there are also in-depth lessons like object oriented programming and regular expressions. +pythonbasics.org is an introductory tutorial for beginners. The tutorial includes exercises. It covers the basics and there are also in-depth lessons like object oriented programming and regular expressions. `Python basics `_ @@ -181,7 +181,7 @@ no previous programming experience. Computer Science Path on Codecademy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -A Codeacademy course for the absolute Python beginner. This free and interactive +A Codecademy course for the absolute Python beginner. This free and interactive course provides and teaches the basics (and beyond) of Python programming while testing the user's knowledge in between progress. This course also features a built-in interpreter for receiving instant feedback on your learning. @@ -218,7 +218,7 @@ Effective Python ~~~~~~~~~~~~~~~~ This book contains 59 specific ways to improve writing Pythonic code. At 227 -pages, it is a very brief overview of some of the most common adapations +pages, it is a very brief overview of some of the most common adaptations programmers need to make to become efficient intermediate level Python programmers. diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst index 520b3dea7..62cf0d11f 100644 --- a/docs/scenarios/gui.rst +++ b/docs/scenarios/gui.rst @@ -146,7 +146,7 @@ Toga cross platform GUI toolkit. Toga consists of a library of base components with a shared interface to simplify platform-agnostic GUI development. -Toga is available on mOS, Windows, Linux (GTK), and mobile platforms such as +Toga is available on macOS, Windows, Linux (GTK), and mobile platforms such as Android and iOS. diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst index c80b97ca5..22e78def1 100644 --- a/docs/scenarios/web.rst +++ b/docs/scenarios/web.rst @@ -126,7 +126,7 @@ Pyramid focus on modularity. It comes with a small number of libraries ("batteries") built-in, and encourages users to extend its base functionality. A set of provided cookiecutter templates helps making new project decisions for users. -It powers one of the most important parts of python infrastucture +It powers one of the most important parts of python infrastructure `PyPI `_. Pyramid does not have a large user base, unlike Django and Flask. It's a @@ -155,7 +155,7 @@ and `Pydantic `_. FastAPI takes advantage of standard Python type declarations in function parameters to declare request parameters and bodies, perform data conversion (serialization, -parsing), data valdiation, and automatic API documentation with **OpenAPI 3** +parsing), data validation, and automatic API documentation with **OpenAPI 3** (including **JSON Schema**). It includes tools and utilities for security and authentication (including OAuth2 with JWT @@ -283,7 +283,7 @@ Heroku is the recommended PaaS for deploying Python web applications today. Eldarion -------- -`Eldarion `_ (formely known as Gondor) is a PaaS powered +`Eldarion `_ (formerly known as Gondor) is a PaaS powered by Kubernetes, CoreOS, and Docker. They support any WSGI application and have a guide on deploying `Django projects `_. diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 56f108603..bbe77f5b2 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -643,7 +643,7 @@ Never use a list comprehension just for its side effects. .. code-block:: python - [print(x) for x in seqeunce] + [print(x) for x in sequence] **Good**: diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst index 0cf20f7ee..ccfc93892 100644 --- a/docs/writing/tests.rst +++ b/docs/writing/tests.rst @@ -201,7 +201,7 @@ the unittest module! Hypothesis ---------- -Hypothesis is a library which lets you write tests that are parametrized by +Hypothesis is a library which lets you write tests that are parameterized by a source of examples. It then generates simple and comprehensible examples that make your tests fail, letting you find more bugs with less work. From 20f0c9c2b7b08e5c9bc008c5029b36bc29a5700c Mon Sep 17 00:00:00 2001 From: Mr-Io Date: Thu, 16 May 2019 10:03:22 +0200 Subject: [PATCH 048/115] use windows environment variable when indicating default path for pip.ini Replace %HOME% with %USERPROFILE% when referencing commands line in windows. This is already done in other part of the guide such as in virtualenvwrapper. --- docs/dev/pip-virtualenv.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/dev/pip-virtualenv.rst b/docs/dev/pip-virtualenv.rst index 61a777aff..ee223078e 100644 --- a/docs/dev/pip-virtualenv.rst +++ b/docs/dev/pip-virtualenv.rst @@ -51,7 +51,7 @@ can be found at: .. code-block:: console - %HOME%\pip\pip.ini + %USERPROFILE%\pip\pip.ini If you don't have a :file:`pip.conf` or :file:`pip.ini` file at these locations, you can create a new file with the correct name for your operating system. @@ -122,7 +122,7 @@ add the following line to your :file:`pip.ini` file under ``[global]`` settings: .. code-block:: console - download-cache = %HOME%\pip\cache + download-cache = %USERPROFILE%\pip\cache Similarly, on Unix systems you should simply add the following line to your :file:`pip.conf` file under ``[global]`` settings: From adbbc9b60da2fe925cebd813d0bdd871db8b3cd6 Mon Sep 17 00:00:00 2001 From: Dan McKinley Date: Wed, 29 May 2019 18:02:33 -0700 Subject: [PATCH 049/115] adding pugsql --- docs/scenarios/db.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/scenarios/db.rst b/docs/scenarios/db.rst index ecdb83008..21217477a 100644 --- a/docs/scenarios/db.rst +++ b/docs/scenarios/db.rst @@ -48,6 +48,19 @@ programmatically or exported to a number of useful data formats. Also included is a command-line tool for exporting SQL data. +****** +PugSQL +****** + +`PugSQL `_ is a simple Python interface for organizing +and using parameterized, handwritten SQL. It is an anti-ORM that is +philosophically lo-fi, but it still presents a clean interface in Python. + +.. code-block:: console + + $ pip install pugsql + + ********** Django ORM ********** From d6d39ce69bf1299c3662699fd7cc36008315aead Mon Sep 17 00:00:00 2001 From: Dan Bader Date: Fri, 31 May 2019 11:26:44 -0700 Subject: [PATCH 050/115] Fix mixed content warning (HTTPS) --- docs/shipping/publishing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shipping/publishing.rst b/docs/shipping/publishing.rst index 90df2a799..4b480f801 100644 --- a/docs/shipping/publishing.rst +++ b/docs/shipping/publishing.rst @@ -7,7 +7,7 @@ Publishing Your Code .. todo:: Replace this kitten with the photo we want. -.. image:: http://placekitten.com/800/600 +.. image:: https://placekitten.com/800/600 A healthy open source project needs a place to publish its code and project management stuff so other developers can collaborate with you. This lets your From 6140459d2c2a144265ec05b70cc658051475252f Mon Sep 17 00:00:00 2001 From: Dan Bader Date: Sun, 9 Jun 2019 20:05:12 -0700 Subject: [PATCH 051/115] Update ads.txt --- docs/_extra/ads.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/docs/_extra/ads.txt b/docs/_extra/ads.txt index fca0f39b3..f6bcdcddc 100644 --- a/docs/_extra/ads.txt +++ b/docs/_extra/ads.txt @@ -103,3 +103,43 @@ smaato.com, 1100033117, RESELLER spotx.tv, 147949, RESELLER, 7842df1d2fe2db34 spotxchange.com, 147949, RESELLER, 7842df1d2fe2db34 springserve.com, 686, DIRECT, a24eb641fc82e93d + +33across.com, 0010b00002Mpn7AAAR, DIRECT, bbea06d9c4d2853c +rubiconproject.com, 16414, RESELLER, 0bfd66d529a55807 +pubmatic.com, 156423, RESELLER, 5d62403b186f2ace +appnexus.com, 10239, RESELLER, f5ab79cb980f11d1 +openx.com, 537120563, RESELLER, 6a698e2ec38604c6 +rhythmone.com, 2439829435, RESELLER, a670c89d4a324e47 +emxdgt.com, 326, RESELLER, 1e1d41537f7cad7f +gumgum.com, 13318, RESELLER, ffdef49475d318a9 +adtech.com, 12094, RESELLER +advangelists.com, 8d3bba7425e7c98c50f52ca1b52d3735, RESELLER, 60d26397ec060f98 +EMXDGT.com, 1133, DIRECT, 1e1d41537f7cad7f +Appnexus.com, 1356, RESELLER, f5ab79cb980f11d1 +Google.com, pub-5995202563537249, RESELLER, f08c47fec0942fa0 +sharethrough.com, 3a0f657b, DIRECT, d53b998a7bd4ecd2 +spotxchange.com, 212457, RESELLER +spotx.tv, 212457, RESELLER +pubmatic.com, 156557, RESELLER +rubiconproject.com, 18694, RESELLER, 0bfd66d529a55807 +openx.com, 540274407, RESELLER, 6a698e2ec38604c6 +appnexus.com, 2530, RESELLER +appnexus.com, 3153, DIRECT +advertising.com, 11602, RESELLER +vertamedia.com, 287605, DIRECT, 7de89dc7742b5b11 +vertamedia.com, 287605, RESELLER, 7de89dc7742b5b11 +appnexus.com, 9393, DIRECT +adtech.com, 11095, RESELLER +coxmt.com, 2000067907202, RESELLER +openx.com, 537143344, RESELLER +indexexchange.com, 175407, RESELLER +districtm.io, 100808, DIRECT +appnexus.com, 7944, RESELLER +appnexus.com, 1908, RESELLER +openx.com, 537127577, RESELLER, 6a698e2ec38604c6 +openx.com, 540337213, RESELLER, 6a698e2ec38604c6 +rhythmone.com, 1114124056, RESELLER, a670c89d4a324e47 +rhythmone.com, 2241341073, RESELLER, a670c89d4a324e47 +rtk.io, 819, DIRECT +rubiconproject.com, 17790, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 17792, RESELLER, 0bfd66d529a55807 From e4ca32a36ceed274d5a90a6855322a5db8ae9cbc Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Sat, 13 Jul 2019 05:12:18 +0200 Subject: [PATCH 052/115] Use PY3 http.server instead of SimpleHTTPServer --- docs/shipping/packaging.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shipping/packaging.rst b/docs/shipping/packaging.rst index 9a8be8c1d..b2e6a698e 100644 --- a/docs/shipping/packaging.rst +++ b/docs/shipping/packaging.rst @@ -83,7 +83,7 @@ Go to your command prompt and type: .. code-block:: console $ cd archive - $ python -m SimpleHTTPServer 9000 + $ python -m http.server 9000 This runs a simple HTTP server running on port 9000 and will list all packages (like **MyPackage**). Now you can install **MyPackage** using any Python From 90cbdc8e2003a0fcdc4ee41d5908fe1d990c7f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E4=B9=9D=E9=BC=8E?= <109224573@qq.com> Date: Tue, 16 Jul 2019 11:40:10 +0800 Subject: [PATCH 053/115] Trivial fix --- docs/dev/virtualenvs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 874fd5c76..3ddd8613a 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -260,7 +260,7 @@ or change the interpreter globally with an env variable in ``~/.bashrc``: $ source venv/bin/activate The name of the current virtual environment will now appear on the left of -the prompt (e.g. ``(venv)Your-Computer:project_folder UserName$)`` to let you know +the prompt (e.g. ``(venv)Your-Computer:project_folder UserName$``) to let you know that it's active. From now on, any package that you install using pip will be placed in the ``venv`` folder, isolated from the global Python installation. From d4c46386d5bbd8b19ca46c9579a53f9fec3ff379 Mon Sep 17 00:00:00 2001 From: Dan Bader Date: Mon, 16 Sep 2019 10:24:21 -0600 Subject: [PATCH 054/115] Update --- docs/_extra/ads.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/_extra/ads.txt b/docs/_extra/ads.txt index f6bcdcddc..fa98d5b91 100644 --- a/docs/_extra/ads.txt +++ b/docs/_extra/ads.txt @@ -143,3 +143,8 @@ rhythmone.com, 2241341073, RESELLER, a670c89d4a324e47 rtk.io, 819, DIRECT rubiconproject.com, 17790, RESELLER, 0bfd66d529a55807 rubiconproject.com, 17792, RESELLER, 0bfd66d529a55807 + +triplelift.com, 7205, DIRECT, 6c33edb13117fd86 +appnexus.com, 1314, RESELLER +spotxchange.com, 228454, RESELLER, 7842df1d2fe2db34 +spotx.tv, 228454, RESELLER, 7842df1d2fe2db34 From ec308a99c5f4be1b2b8b0c6aa1f57d2d35b111e8 Mon Sep 17 00:00:00 2001 From: Giuliano Oliveira Date: Sat, 5 Oct 2019 16:00:26 -0400 Subject: [PATCH 055/115] entry Latest release date added to comparassion of features table --- docs/shipping/freezing.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/shipping/freezing.rst b/docs/shipping/freezing.rst index dcb89c7c6..841fa2040 100644 --- a/docs/shipping/freezing.rst +++ b/docs/shipping/freezing.rst @@ -46,17 +46,18 @@ On Linux, an alternative to freezing is to Comparison of Freezing Tools **************************** +Date of this writing: Oct 5, 2019 Solutions and platforms/features supported: -=========== ======= ===== ==== ======== ======= ============= ============== ==== ===================== -Solution Windows Linux OS X Python 3 License One-file mode Zipfile import Eggs pkg_resources support -=========== ======= ===== ==== ======== ======= ============= ============== ==== ===================== -bbFreeze yes yes yes no MIT no yes yes yes -py2exe yes no no yes MIT yes yes no no -pyInstaller yes yes yes yes GPL yes no yes no -cx_Freeze yes yes yes yes PSF no yes yes no -py2app no no yes yes MIT no yes yes yes -=========== ======= ===== ==== ======== ======= ============= ============== ==== ===================== +=========== ======= ===== ==== ======== ======= ============= ============== ==== ===================== ===================== +Solution Windows Linux OS X Python 3 License One-file mode Zipfile import Eggs pkg_resources support Latest release date +=========== ======= ===== ==== ======== ======= ============= ============== ==== ===================== ===================== +bbFreeze yes yes yes no MIT no yes yes yes Jan 20, 2014 +py2exe yes no no yes MIT yes yes no no Oct 21, 2014 +pyInstaller yes yes yes yes GPL yes no yes no Jul 9, 2019 +cx_Freeze yes yes yes yes PSF no yes yes no Aug 29, 2019 +py2app no no yes yes MIT no yes yes yes Mar 25, 2019 +=========== ======= ===== ==== ======== ======= ============= ============== ==== ===================== ===================== .. note:: Freezing Python code on Linux into a Windows executable was only once From a00b6a31c14cdeb8adb1ad9ee7a674a4f1878607 Mon Sep 17 00:00:00 2001 From: azzamsa Date: Fri, 11 Oct 2019 07:36:27 +0700 Subject: [PATCH 056/115] Fix broken link to Kenneth Reitz homepage --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 6277fe430..d732ac29f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -49,7 +49,7 @@ # General information about the project. current_year = datetime.datetime.now().year project = u'pythonguide' -copyright = (u'2011-{} Kenneth Reitz' +copyright = (u'2011-{} Kenneth Reitz' ' & Real Python.' ' CC BY-NC-SA 3.0').format(current_year) From 1eedf3a2f298843d01fe77f7dc344cc324a54748 Mon Sep 17 00:00:00 2001 From: Nishant Singh Date: Tue, 29 Oct 2019 16:55:37 +0530 Subject: [PATCH 057/115] Fixed broken link to Pipenv documentation Changed `https://docs.pipenv.org/` -> `https://pipenv.kennethreitz.org/` --- docs/dev/virtualenvs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 3ddd8613a..326b6e288 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -101,7 +101,7 @@ Use ``pip`` to install Pipenv: user ``PATH`` permanently in the `Control Panel`_. You may need to log out for the ``PATH`` changes to take effect. -.. _Pipenv: https://docs.pipenv.org/ +.. _Pipenv: https://pipenv.kennethreitz.org/ .. _npm: https://www.npmjs.com/ .. _bundler: http://bundler.io/ .. _user base: https://docs.python.org/3/library/site.html#site.USER_BASE From 71d69ee7ea1861982b6f2b1d189ccb3811e0b97f Mon Sep 17 00:00:00 2001 From: "BRIGANTI Raffaele (EXT)" Date: Mon, 11 Nov 2019 23:08:05 +0100 Subject: [PATCH 058/115] Fixed link to pep20_by_example.pdf. Now the link is the github repo of the author. --- docs/writing/style.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing/style.rst b/docs/writing/style.rst index bbe77f5b2..91f089374 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -455,7 +455,7 @@ Also known as :pep:`20`, the guiding principles for Python's design. Namespaces are one honking great idea -- let's do more of those! For some examples of good Python style, see `these slides from a Python user -group `_. +group `_. ***** From b353da298427215ddbda829fbc18951ae06b5c2e Mon Sep 17 00:00:00 2001 From: pierreluctg Date: Fri, 15 Nov 2019 14:57:16 -0500 Subject: [PATCH 059/115] Correcting pyenv url --- docs/dev/env.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/env.rst b/docs/dev/env.rst index bc754e49b..8c0aeef96 100644 --- a/docs/dev/env.rst +++ b/docs/dev/env.rst @@ -248,7 +248,7 @@ To start using and see more information: pyenv ----- -`pyenv `_ is a tool to allow multiple versions +`pyenv `_ is a tool to allow multiple versions of the Python interpreter to be installed at the same time. This solves the problem of having different projects requiring different versions of Python. For example, it becomes very easy to install Python 2.7 for compatibility in From 56c6f2ef69437faf9ce5ca1cbffde6929a9d9b7f Mon Sep 17 00:00:00 2001 From: angellmethod <23619763+angellmethod@users.noreply.github.com> Date: Wed, 27 Nov 2019 12:34:07 -0600 Subject: [PATCH 060/115] Update diveinto link The diveinto.org link is broken when I try it. I found that https://diveinto.org/python3/table-of-contents.html works but the https://diveintopython3.net/ is shorter and appears less broken to someone reading the url for the first time. The table of content at this updated address looks the same as what I found on the web.archive.org for the diveinto.org link. --- docs/writing/structure.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst index 87353e608..7f1baef6b 100644 --- a/docs/writing/structure.rst +++ b/docs/writing/structure.rst @@ -891,4 +891,4 @@ Further Reading *************** - http://docs.python.org/3/library/ -- https://www.diveinto.org/python3/ +- https://diveintopython3.net/ From bccf4501323648b84d603de6fc3c8f1aa578bca6 Mon Sep 17 00:00:00 2001 From: Carlos Hernandez-Vaquero Date: Sun, 8 Dec 2019 17:34:52 +0100 Subject: [PATCH 061/115] Moved VS Code to Text Editor --- docs/dev/env.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/dev/env.rst b/docs/dev/env.rst index 8c0aeef96..331104da2 100644 --- a/docs/dev/env.rst +++ b/docs/dev/env.rst @@ -138,6 +138,14 @@ Recommended for Python development is `Linter `_ combined with `linter-flake8 `_. +Python (on Visual Studio Code) +------------------------------ + +`Python for Visual Studio `_ is an extension for the `Visual Studio Code `_. +This is a free, lightweight, open source code editor, with support for Mac, Windows, and Linux. +Built using open source technologies such as Node.js and Python, with compelling features such as Intellisense (autocompletion), local and remote debugging, linting, and the like. + +MIT licensed. IDEs :::: @@ -152,14 +160,6 @@ features can be brought to IntelliJ with the free versions of PyCharm: Professional Edition (Free 30-day trial) and Community Edition (Apache 2.0 License) with fewer features. -Python (on Visual Studio Code) ------------------------------- - -`Python for Visual Studio `_ is an extension for the `Visual Studio Code IDE `_. -This is a free, lightweight, open source IDE, with support for Mac, Windows, and Linux. -Built using open source technologies such as Node.js and Python, with compelling features such as Intellisense (autocompletion), local and remote debugging, linting, and the like. - -MIT licensed. Enthought Canopy ---------------- From f93e747876d5341523d25559f25e5e508f683e30 Mon Sep 17 00:00:00 2001 From: davidwales <55477181+davidwales@users.noreply.github.com> Date: Thu, 12 Dec 2019 14:20:13 +1100 Subject: [PATCH 062/115] Fix broken Sphinx link --- docs/writing/documentation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst index c0d93d86c..4d72a544d 100644 --- a/docs/writing/documentation.rst +++ b/docs/writing/documentation.rst @@ -85,7 +85,7 @@ structured and easily readable documentation for your project. for general project documentation. This Guide is built with Sphinx_ and is hosted on `Read The Docs`_ -.. _Sphinx: http://sphinx.pocoo.org +.. _Sphinx: https://www.sphinx-doc.org .. _Read The Docs: http://readthedocs.org .. _restructuredtext-ref: @@ -100,7 +100,7 @@ The `reStructuredText Primer`_ and the `reStructuredText Quick Reference`_ should help you familiarize yourself with its syntax. .. _reStructuredText: http://docutils.sourceforge.net/rst.html -.. _reStructuredText Primer: http://sphinx.pocoo.org/rest.html +.. _reStructuredText Primer: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html .. _reStructuredText Quick Reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html From 5292e8c587360bcead1266e32a39191f697e63c3 Mon Sep 17 00:00:00 2001 From: davidwales <55477181+davidwales@users.noreply.github.com> Date: Thu, 12 Dec 2019 14:40:06 +1100 Subject: [PATCH 063/115] Fix broken Sphinx links --- docs/notes/styleguide.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/notes/styleguide.rst b/docs/notes/styleguide.rst index fdd7c1884..5a715332e 100644 --- a/docs/notes/styleguide.rst +++ b/docs/notes/styleguide.rst @@ -31,7 +31,7 @@ Strive to keep any contributions relevant to the :ref:`purpose of The Guide relate to Python development. * Prefer to link to other sources if the information is already out there. Be sure to describe what and why you are linking. -* `Cite `_ +* `Cite `_ references where needed. * If a subject isn't directly relevant to Python, but useful in conjunction with Python (e.g., Git, GitHub, Databases), reference by linking to useful @@ -146,14 +146,14 @@ Externally Linking Sphinx_ is used to document Python. - .. _Sphinx: http://sphinx.pocoo.org + .. _Sphinx: https://www.sphinx-doc.org * Prefer to use descriptive labels with inline links instead of leaving bare links: .. code-block:: rest - Read the `Sphinx Tutorial `_ + Read the `Sphinx Tutorial `_ * Avoid using labels such as "click here", "this", etc., preferring descriptive labels (SEO worthy) instead. @@ -164,7 +164,7 @@ Linking to Sections in The Guide ******************************** To cross-reference other parts of this documentation, use the `:ref: -`_ +`_ keyword and labels. To make reference labels more clear and unique, always add a ``-ref`` suffix: @@ -182,7 +182,7 @@ Notes and Warnings ****************** Make use of the appropriate `admonitions directives -`_ when making notes. +`_ when making notes. Notes: @@ -205,7 +205,7 @@ TODOs ***** Please mark any incomplete areas of The Guide with a `todo directive -`_. To +`_. To avoid cluttering the :ref:`todo-list-ref`, use a single ``todo`` for stub documents or large incomplete sections. From 131e43a4f609a5633fdb4c2e426f27fd13430e3c Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 14 Jan 2020 07:41:24 +0100 Subject: [PATCH 064/115] Setup Python 3.8 on Ubuntu --- docs/starting/install3/linux.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/starting/install3/linux.rst b/docs/starting/install3/linux.rst index 47765c43f..ddd6a6086 100644 --- a/docs/starting/install3/linux.rst +++ b/docs/starting/install3/linux.rst @@ -7,7 +7,7 @@ Installing Python 3 on Linux .. image:: /_static/photos/34435689480_2e6f358510_k_d.jpg -This document describes how to install Python 3.6 on Ubuntu Linux machines. +This document describes how to install Python 3.6 or 3.8 on Ubuntu Linux machines. To see which version of Python 3 you have installed, open a command prompt and run @@ -20,12 +20,12 @@ If you are using Ubuntu 16.10 or newer, then you can easily install Python 3.6 w $ sudo apt-get update $ sudo apt-get install python3.6 -If you're using another version of Ubuntu (e.g. the latest LTS release), we recommend using the `deadsnakes PPA `_ to install Python 3.6:: +If you're using another version of Ubuntu (e.g. the latest LTS release) or you want to use a more current Python, we recommend using the `deadsnakes PPA `_ to install Python 3.8:: $ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:deadsnakes/ppa $ sudo apt-get update - $ sudo apt-get install python3.6 + $ sudo apt-get install python3.8 If you are using other Linux distribution, chances are you already have Python 3 pre-installed as well. If not, use your distribution's package manager. From cfec971a97750f7315f8b02d4298b0bb32fd9b9d Mon Sep 17 00:00:00 2001 From: Dan Bader Date: Thu, 16 Jan 2020 16:04:28 +0100 Subject: [PATCH 065/115] Update ads.txt --- docs/_extra/ads.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/_extra/ads.txt b/docs/_extra/ads.txt index fa98d5b91..535a7d27c 100644 --- a/docs/_extra/ads.txt +++ b/docs/_extra/ads.txt @@ -148,3 +148,6 @@ triplelift.com, 7205, DIRECT, 6c33edb13117fd86 appnexus.com, 1314, RESELLER spotxchange.com, 228454, RESELLER, 7842df1d2fe2db34 spotx.tv, 228454, RESELLER, 7842df1d2fe2db34 + +google.com, pub-4641608711979091, DIRECT, f08c47fec0942fa0 +Newormedia.com, 2169, DIRECT From ea9da28c6db10ab60e202177075e7c0ce5a46c70 Mon Sep 17 00:00:00 2001 From: Niko Wenselowski Date: Mon, 3 Feb 2020 23:02:46 +0100 Subject: [PATCH 066/115] The GitHub repo is much more uptodate. It has a working Python 3 version with fixed and updated tests. --- docs/intro/learning.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst index 9def6f459..dfdff63ee 100644 --- a/docs/intro/learning.rst +++ b/docs/intro/learning.rst @@ -161,7 +161,7 @@ For those used to languages and figuring out puzzles on their own, this can be a fun, attractive option. For those new to Python and programming, having an additional resource or reference will be helpful. - `Python Koans `_ + `Python Koans `_ More information about test driven development can be found at these resources: From 967f7d08d1005e2b52d0c968558355f20a89cadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hermann?= Date: Fri, 7 Feb 2020 12:57:02 +0100 Subject: [PATCH 067/115] =?UTF-8?q?Broken=20deep=20link=20=E2=87=92=20maki?= =?UTF-8?q?ng=20it=20a=20more=20robust=20root=20one?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/shipping/packaging.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/shipping/packaging.rst b/docs/shipping/packaging.rst index b2e6a698e..34674cff2 100644 --- a/docs/shipping/packaging.rst +++ b/docs/shipping/packaging.rst @@ -193,4 +193,4 @@ Useful Tools - `fpm `_ - `alien `_ -- `dh-virtualenv `_ (for APT/DEB omnibus packaging) +- `dh-virtualenv `_ (for APT/DEB omnibus packaging) From 6e55eb1a3d3dbc946835d5b11e4df7bf7526b489 Mon Sep 17 00:00:00 2001 From: Kaycee <57104700+KayceeIngram@users.noreply.github.com> Date: Sun, 9 Feb 2020 14:04:56 -0600 Subject: [PATCH 068/115] Update cli.rst --- docs/scenarios/cli.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst index 1bf810e0e..59f311e83 100644 --- a/docs/scenarios/cli.rst +++ b/docs/scenarios/cli.rst @@ -27,7 +27,7 @@ Some popular command-line applications include: Click ***** -`click `_ is a Python package for creating +`click `_ is a Python package for creating command-line interfaces in a composable way with as little code as possible. This “Command-Line Interface Creation Kit” is highly configurable but comes with good defaults out of the box. From 66e19ef0fecc364c4eda2e3f3a36da3795f670d9 Mon Sep 17 00:00:00 2001 From: Romilly Cocking Date: Thu, 27 Feb 2020 16:17:25 +0000 Subject: [PATCH 069/115] Added description of mu IDE. --- docs/dev/env.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/dev/env.rst b/docs/dev/env.rst index 8c0aeef96..c3c1c33dd 100644 --- a/docs/dev/env.rst +++ b/docs/dev/env.rst @@ -231,6 +231,18 @@ based on the Qt GUI toolkit, integrating the Scintilla editor control. Eric is an open source software project (GPLv3 licence) with more than ten years of active development. +Mu +-- + +`Mu ` is a minimalist Python IDE which can run Python 3 code +locally and can also deploy code to the BBC micro:bit and to Adafruit boards running +CircuitPython. + +Intended for beginners, mu includes a Python 3 interpreter, and is easy to install +on Windows, OS/X and Linux. It runs well on the Raspberry Pi. + +There's an active support community on gitter. + Interpreter Tools ::::::::::::::::: From 88377b8e6440d5e5c25f6a9755f83729bcd5c410 Mon Sep 17 00:00:00 2001 From: Romilly Cocking Date: Thu, 27 Feb 2020 16:19:23 +0000 Subject: [PATCH 070/115] Fixed typo --- docs/dev/env.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/env.rst b/docs/dev/env.rst index c3c1c33dd..62dc9aeb0 100644 --- a/docs/dev/env.rst +++ b/docs/dev/env.rst @@ -234,7 +234,7 @@ active development. Mu -- -`Mu ` is a minimalist Python IDE which can run Python 3 code +`Mu `_ is a minimalist Python IDE which can run Python 3 code locally and can also deploy code to the BBC micro:bit and to Adafruit boards running CircuitPython. From adae3f06eee8456adb1a5c722f0221063b14c008 Mon Sep 17 00:00:00 2001 From: Dan Bader Date: Thu, 19 Mar 2020 17:24:47 -0700 Subject: [PATCH 071/115] Update --- docs/_extra/ads.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/_extra/ads.txt b/docs/_extra/ads.txt index 535a7d27c..08a732487 100644 --- a/docs/_extra/ads.txt +++ b/docs/_extra/ads.txt @@ -151,3 +151,6 @@ spotx.tv, 228454, RESELLER, 7842df1d2fe2db34 google.com, pub-4641608711979091, DIRECT, f08c47fec0942fa0 Newormedia.com, 2169, DIRECT + +yieldmo.com, 2417496099628458357, DIRECT +rhythmone.com, 2310154583, DIRECT, a670c89d4a324e47 From e030842c8a316b7cfebc30d671ffb27cf90b4d24 Mon Sep 17 00:00:00 2001 From: gison93 <43569657+gison93@users.noreply.github.com> Date: Wed, 29 Apr 2020 12:58:12 +0200 Subject: [PATCH 072/115] Fix link --- docs/writing/structure.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst index 7f1baef6b..bbbef47fe 100644 --- a/docs/writing/structure.rst +++ b/docs/writing/structure.rst @@ -60,7 +60,7 @@ it is important. Sample Repository ::::::::::::::::: -**tl;dr**: This is what `Kenneth Reitz recommended in 2013`. +**tl;dr**: This is what `Kenneth Reitz recommended in 2013 `__. This repository is `available on GitHub `__. From a43f914fafc8c82993c02ec90b10e7703faafa44 Mon Sep 17 00:00:00 2001 From: "Leonid V. Fedorenchik" Date: Fri, 8 May 2020 15:13:31 +0800 Subject: [PATCH 073/115] Add missing .PHONY target latexpdfja --- docs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index 13201e251..963704aff 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -19,7 +19,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf latexpdfja text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" From ba6a9f27e613f73717cf8d3f9b4fbffb9c6d70e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Alava=20Pe=C3=B1a?= Date: Sun, 19 Jul 2020 14:44:16 +0100 Subject: [PATCH 074/115] Fixed Pro Python link from unused domain to seller from unused domain to where it is sold --- docs/intro/learning.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst index 9def6f459..246e2ab80 100644 --- a/docs/intro/learning.rst +++ b/docs/intro/learning.rst @@ -236,7 +236,7 @@ This book is for intermediate to advanced Python programmers who are looking to understand how and why Python works the way it does and how they can take their code to the next level. - `Pro Python `_ + `Pro Python `_ Expert Python Programming From e245d923c83e93da33615e758454a4be182c6942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Zaczy=C5=84ski?= Date: Wed, 12 Aug 2020 16:15:48 +0200 Subject: [PATCH 075/115] Title overline was too short --- docs/scenarios/gui.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst index 62cf0d11f..1b0ffb427 100644 --- a/docs/scenarios/gui.rst +++ b/docs/scenarios/gui.rst @@ -98,9 +98,9 @@ PyQt provides Python bindings for the Qt Framework (see below). http://www.riverbankcomputing.co.uk/software/pyqt/download -***************************** +*************************************** Pyjs Desktop (formerly Pyjamas Desktop) -***************************** +*************************************** Pyjs Desktop is a application widget set for desktop and a cross-platform framework. It allows the exact same Python web application source code to be From 58befe505fd651365abc4bb4d9413151cca8d2c8 Mon Sep 17 00:00:00 2001 From: pyfisch Date: Fri, 28 Aug 2020 11:14:04 +0200 Subject: [PATCH 076/115] Remove simplejson from guide The simplejson library was only needed for Python 2.5 and earlier. Update documentation link to Python 3. --- docs/scenarios/json.rst | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/docs/scenarios/json.rst b/docs/scenarios/json.rst index 130ad3031..1c3663777 100644 --- a/docs/scenarios/json.rst +++ b/docs/scenarios/json.rst @@ -5,7 +5,7 @@ JSON .. image:: /_static/photos/33928819683_97b5c6a184_k_d.jpg -The `json `_ library can parse +The `json `_ library can parse JSON from strings or files. The library parses JSON into a Python dictionary or list. It can also convert Python dictionaries or lists into JSON strings. @@ -46,27 +46,3 @@ You can also convert the following to JSON: print(json.dumps(d)) '{"first_name": "Guido", "last_name": "Rossum", "titles": ["BDFL", "Developer"]}' - - -********** -simplejson -********** - -The json library was added to Python in version 2.6. -If you're using an earlier version of Python, the -`simplejson `_ library is -available via PyPI. - -simplejson mimics the json standard library. It is available so that developers -that use older versions of Python can use the latest features available in the -json lib. - -You can start using simplejson when the json library is not available by -importing simplejson under a different name: - -.. code-block:: python - - import simplejson as json - -After importing simplejson as `json`, the above examples will all work as if you -were using the standard json library. From 140f1039acf81c58eb5dfabdda807df5a3ab3437 Mon Sep 17 00:00:00 2001 From: pyfisch Date: Sat, 29 Aug 2020 22:47:06 +0200 Subject: [PATCH 077/115] Remove section on unittest2 Only needed for Python 2.6 and below --- docs/writing/tests.rst | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst index ccfc93892..7809d9ffe 100644 --- a/docs/writing/tests.rst +++ b/docs/writing/tests.rst @@ -248,35 +248,6 @@ simple INI-style configuration file. `tox `_ -Unittest2 ---------- - -unittest2 is a backport of Python 2.7's unittest module which has an improved -API and better assertions over the one available in previous versions of Python. - -If you're using Python 2.6 or below, you can install it with pip: - -.. code-block:: console - - $ pip install unittest2 - -You may want to import the module under the name unittest to make porting code -to newer versions of the module easier in the future - -.. code-block:: python - - import unittest2 as unittest - - class MyTest(unittest.TestCase): - ... - -This way if you ever switch to a newer Python version and no longer need the -unittest2 module, you can simply change the import in your test module without -the need to change any other code. - - `unittest2 `_ - - mock ---- From c53cf42b6b20f6554750d39bea2cf562e128114a Mon Sep 17 00:00:00 2001 From: Henry Harutyunyan Date: Wed, 16 Sep 2020 15:41:44 +0400 Subject: [PATCH 078/115] Fixes for Python 2 End of Life Since Python2 reached the end of its life in January, we need to update the page "Picking a Python Interpreter" accordingly --- docs/starting/which-python.rst | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst index d9dcc13ec..ee527a64f 100644 --- a/docs/starting/which-python.rst +++ b/docs/starting/which-python.rst @@ -20,9 +20,9 @@ one might think. The basic gist of the state of things is as follows: -1. Most production applications today use Python 2.7. +1. Most production applications today use Python 3. 2. Python 3 is ready for the production deployment of applications today. -3. Python 2.7 will only receive necessary security updates until 2020 [#pep373_eol]_. +3. Python 2 reached the end of its life on January 1, 2020 [#pep373_eol]_. 4. The brand name "Python" encapsulates both Python 3 and Python 2. @@ -40,10 +40,6 @@ I'll be blunt: - If you're learning Python for the first time, familiarizing yourself with Python 2.7 will be very useful, but not more useful than learning Python 3. - Learn both. They are both "Python". -- Software that is already built often depends on Python 2.7. -- If you are writing a new open source Python library, it's best to write it for both Python 2 and 3 - simultaneously. Only supporting Python 3 for a new library you want to be widely adopted is a - political statement and will alienate many of your users. This is not a problem — slowly, over the next three years, this will become less the case. ********* @@ -58,8 +54,6 @@ Given such, only use Python 2 if you have a strong reason to, such as a pre-existing code-base, a Python 2 exclusive library, simplicity/familiarity, or, of course, you absolutely love and are inspired by Python 2. No harm in that. -Check out `Can I Use Python 3? `_ to see if any -software you're depending on will block your adoption of Python 3. `Further Reading `_ @@ -67,9 +61,7 @@ It is possible to `write code that works on Python 2.6, 2.7, and Python 3 `_. This ranges from trivial to hard depending upon the kind of software you are writing; if you're a beginner there are far more important things to -worry about. Note that Python 2.6 is end-of-life upstream, so you shouldn't -try to write 2.6-compatible code unless you're being paid specifically to -do that. +worry about. *************** @@ -135,7 +127,8 @@ expose Python code to other languages in the .NET framework. IronPython directly into the Visual Studio development environment, making it an ideal choice for Windows developers. -IronPython supports Python 2.7. [#iron_ver]_ +IronPython supports Python 2.7. [#iron_ver]_ IronPython 3 [#iron_ver3]_ +is being developed, but is not ready for use as of September 2020. PythonNet --------- @@ -151,16 +144,16 @@ installations on non-Windows operating systems, such as OS X and Linux, to operate within the .NET framework. It can be run in addition to IronPython without conflict. -Pythonnet supports from Python 2.6 up to Python 3.5. [#pythonnet_ver1]_ [#pythonnet_ver2]_ +Pythonnet is compatible with Python 2.7 and 3.5-3.8. [#pythonnet_ver1]_ .. [#pypy_ver] http://pypy.org/compat.html .. [#jython_ver] https://hg.python.org/jython/file/412a8f9445f7/NEWS -.. [#iron_ver] http://ironpython.codeplex.com/releases/view/81726 +.. [#iron_ver] https://ironpython.net/download/ -.. [#pythonnet_ver1] https://travis-ci.org/pythonnet/pythonnet +.. [#iron_ver3] https://github.com/IronLanguages/ironpython3 -.. [#pythonnet_ver2] https://ci.appveyor.com/project/TonyRoberts/pythonnet-480xs +.. [#pythonnet_ver1] https://pythonnet.github.io/ .. [#pep373_eol] https://www.python.org/dev/peps/pep-0373/#id2 From 4075a0b8408f738ddf5af786d10dc0e259426dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sun, 20 Sep 2020 13:56:53 +0200 Subject: [PATCH 079/115] Update Fedora instructions a bit --- docs/starting/install3/linux.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/starting/install3/linux.rst b/docs/starting/install3/linux.rst index ddd6a6086..b02204bc0 100644 --- a/docs/starting/install3/linux.rst +++ b/docs/starting/install3/linux.rst @@ -37,8 +37,8 @@ For example on Fedora, you would use `dnf`: Note that if the version of the ``python3`` package is not recent enough for you, there may be ways of installing more recent versions as well, -depending on you distribution. For example installing the ``python36`` package -on Fedora 25 to get Python 3.6. If you are a Fedora user, you might want +depending on you distribution. For example installing the ``python3.9`` package +on Fedora 32 to get Python 3.9. If you are a Fedora user, you might want to read about `multiple Python versions available in Fedora`_. .. _multiple Python versions available in Fedora: https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html @@ -54,13 +54,13 @@ At this point, you may have system Python 2.7 available as well. $ python -This will launch the Python 2 interpreter. +This might launch the Python 2 interpreter. .. code-block:: console $ python3 -This will launch the Python 3 interpreter. +This will always launch the Python 3 interpreter. **************** From 5ae6568805fc7197236bee406ae6cfb435e2145d Mon Sep 17 00:00:00 2001 From: Henry Harutyunyan Date: Mon, 21 Sep 2020 20:14:47 +0400 Subject: [PATCH 080/115] Update docs/starting/which-python.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartosz Zaczyński --- docs/starting/which-python.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst index ee527a64f..b1e3a8212 100644 --- a/docs/starting/which-python.rst +++ b/docs/starting/which-python.rst @@ -146,7 +146,7 @@ addition to IronPython without conflict. Pythonnet is compatible with Python 2.7 and 3.5-3.8. [#pythonnet_ver1]_ -.. [#pypy_ver] http://pypy.org/compat.html +.. [#pypy_ver] https://pypy.org/compat.html .. [#jython_ver] https://hg.python.org/jython/file/412a8f9445f7/NEWS From 9385d82078e2532db56c0ddf649496db54267edf Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Mon, 28 Sep 2020 10:34:16 -0400 Subject: [PATCH 081/115] update brew download link if you use the older `ruby` command, the brew installer throws a warning: ``` Warning: The Ruby Homebrew installer is now deprecated and has been rewritten in Bash. Please migrate to the following command: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" ``` --- docs/starting/install3/osx.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst index 654cca115..37252d615 100644 --- a/docs/starting/install3/osx.rst +++ b/docs/starting/install3/osx.rst @@ -50,7 +50,7 @@ your favorite OS X terminal emulator and run .. code-block:: console - $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" The script will explain what changes it will make and prompt you before the installation begins. From 715472dc21666db4164f182e5162289be6d1a244 Mon Sep 17 00:00:00 2001 From: Tomer Cohen Date: Sat, 15 Aug 2020 12:50:03 +0300 Subject: [PATCH 082/115] Fix link to direnv.net on file virtualenvs.rst --- docs/dev/virtualenvs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 326b6e288..b4591e43b 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -438,4 +438,4 @@ Install it on Mac OS X using ``brew``: $ brew install direnv -On Linux follow the instructions at `direnv.net ` +On Linux follow the instructions at `direnv.net `_ From e438a80ec88bc7b0fec1d267d3032f74da74aecf Mon Sep 17 00:00:00 2001 From: Moritz Schillinger Date: Thu, 8 Oct 2020 23:56:52 +0200 Subject: [PATCH 083/115] Add auto-formatting section --- docs/writing/style.rst | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 91f089374..d40033afa 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -496,6 +496,14 @@ Then run it on a file or series of files to get a report of any violations. optparse.py:472:29: E221 multiple spaces before operator optparse.py:544:21: W601 .has_key() is deprecated, use 'in' +Auto-Formatting +~~~~~~~~~~~~~~~ + +There are several auto-formatting tools that can reformat your code, +in order to comply with PEP 8. + +**autopep8** + The program `autopep8 `_ can be used to automatically reformat code in the PEP 8 style. Install the program with: @@ -513,6 +521,49 @@ Excluding the ``--in-place`` flag will cause the program to output the modified code directly to the console for review. The ``--aggressive`` flag will perform more substantial changes and can be applied multiple times for greater effect. +**yapf** + +While autopep8 focuses on solving the PEP 8 violations, `yapf `_ +tries to improve the format of your code aside from complying with PEP 8. +This formatter aims at providing as good looking code as a programmer who +writes PEP 8 compliant code. +It gets installed with: + +.. code-block:: console + + $ pip install yapf + +Run the auto-formatting of a file with: + +.. code-block:: console + + $ yapf --in-place optparse.py + +Similar to autopep8, running the command without the ``--in-place`` flag will +output the diff for review before applying the changes. + +**black** + +The auto-formatter `black `_ offers an +opinionated and deterministic reformatting of your code base. +Its main focus lies in providing a uniform code style without the need of +configuration throughout its users. Hence, users of black are able to forget +about formatting altogether. Also, due to the deterministic approach minimal +git diffs with only the relevant changes are guaranteed. You can install the +tool as follows: + +.. code-block:: console + + $ pip install black + +A python file can be formatted with: + +.. code-block:: console + + $ black optparse.py + +Adding the ``--diff`` flag provides the code modification for review without +direct application. *********** Conventions From e5caf43179e3241da3007390e46f2b063ece172d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E4=B9=9D=E9=BC=8E?= <109224573@qq.com> Date: Tue, 20 Oct 2020 10:45:24 +0800 Subject: [PATCH 084/115] Remove Eldarion --- docs/scenarios/web.rst | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst index 22e78def1..a2c84818b 100644 --- a/docs/scenarios/web.rst +++ b/docs/scenarios/web.rst @@ -280,13 +280,6 @@ how to set up your first application. Heroku is the recommended PaaS for deploying Python web applications today. -Eldarion --------- - -`Eldarion `_ (formerly known as Gondor) is a PaaS powered -by Kubernetes, CoreOS, and Docker. They support any WSGI application and have a -guide on deploying `Django projects `_. - ********** Templating From 558e60c33cc5b8117546965acf6d13420e9939f9 Mon Sep 17 00:00:00 2001 From: Lokesh Dhakal <9079364+aviranzerioniac@users.noreply.github.com> Date: Sun, 22 Nov 2020 15:54:31 +0100 Subject: [PATCH 085/115] Minor Changes --- docs/index.rst | 6 +++--- docs/writing/documentation.rst | 14 +++++++------- docs/writing/gotchas.rst | 15 ++++++++------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index dcd56579f..df7fcb8ed 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,7 +4,7 @@ contain the root `toctree` directive. .. meta:: - :description: An opinionated guide to the Python programming language and a best practice handbook to the installation, configuration, and usage of Python on a daily basis. + :description: An opinionated guide to the Python programming language and a best practice handbook for the installation, configuration, and usage of Python on a daily basis. ################################# @@ -17,7 +17,7 @@ Greetings, Earthling! Welcome to The Hitchhiker's Guide to Python. `fork us on GitHub `_! This handcrafted guide exists to provide both novice and expert Python -developers a best practice handbook to the installation, configuration, and +developers a best practice handbook for the installation, configuration, and usage of Python on a daily basis. This guide is **opinionated** in a way that is almost, but not quite, entirely @@ -25,7 +25,7 @@ This guide is **opinionated** in a way that is almost, but not quite, entirely available here. Rather, you'll find a nice concise list of highly recommended options. -.. note:: The use of **Python 3** is *highly* preferred over Python 2. Consider upgrading your applications and infrastructure if you find yourself *still* using Python 2 in production today. If you are using Python 3, congratulations — you are indeed a person of excellent taste. +.. note:: The use of **Python 3** is *highly* recommended over Python 2. Consider upgrading your applications and infrastructures if you find yourself *still* using Python 2 in production today. If you are using Python 3, congratulations — you are indeed a person of excellent taste. —*Kenneth Reitz* Let's get started! But first, let's make sure you know where your towel is. diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst index 4d72a544d..27d85405a 100644 --- a/docs/writing/documentation.rst +++ b/docs/writing/documentation.rst @@ -45,7 +45,7 @@ Project Publication Depending on the project, your documentation might include some or all of the following components: -- An *introduction* should show a very short overview of what can be +- An *introduction* should give a very short overview of what can be done with the product, using one or two extremely simplified use cases. This is the thirty-second pitch for your project. @@ -94,7 +94,7 @@ reStructuredText ~~~~~~~~~~~~~~~~ Most Python documentation is written with reStructuredText_. It's like -Markdown with all the optional extensions built in. +Markdown, but with all the optional extensions built in. The `reStructuredText Primer`_ and the `reStructuredText Quick Reference`_ should help you familiarize yourself with its syntax. @@ -149,8 +149,8 @@ a project's documentation. Additionally, Doctest_ will read all embedded docstrings that look like input from the Python commandline (prefixed with ">>>") and run them, checking to see if the output of the command matches the text on the following line. This -allows developers to embed real examples and usage of functions alongside -their source code, and as a side effect, it also ensures that their code is +allows developers to embed real examples and usage of functions alongside +their source code. As a side effect, it also ensures that their code is tested and works. :: @@ -187,8 +187,8 @@ Docstrings are accessible from both the `__doc__` dunder attribute for almost every Python object, as well as with the built in `help()` function. While block comments are usually used to explain *what* a section of code is -doing, or the specifics of an algorithm, docstrings are more intended for -explaining to other users of your code (or you in 6 months time) *how* a +doing, or the specifics of an algorithm, docstrings are more intended towards +explaining other users of your code (or you in 6 months time) *how* a particular function can be used and the general purpose of a function, class, or module. @@ -214,7 +214,7 @@ In larger or more complex projects however, it is often a good idea to give more information about a function, what it does, any exceptions it may raise, what it returns, or relevant details about the parameters. -For more detailed documentation of code a popular style is the one used for the +For more detailed documentation of code a popular style used, is the one used by the NumPy project, often called `NumPy style`_ docstrings. While it can take up more lines than the previous example, it allows the developer to include a lot more information about a method, function, or class. :: diff --git a/docs/writing/gotchas.rst b/docs/writing/gotchas.rst index 677bdf823..f717858ca 100644 --- a/docs/writing/gotchas.rst +++ b/docs/writing/gotchas.rst @@ -7,13 +7,13 @@ Common Gotchas .. image:: /_static/photos/34435688380_b5a740762b_k_d.jpg For the most part, Python aims to be a clean and consistent language that -avoids surprises. However, there are a few cases that can be confusing to +avoids surprises. However, there are a few cases that can be confusing for newcomers. Some of these cases are intentional but can be potentially surprising. Some could arguably be considered language warts. In general, what follows is a collection of potentially tricky behavior that might seem strange at first -glance, but is generally sensible once you're aware of the underlying cause for +glance, but are generally sensible, once you're aware of the underlying cause for the surprise. @@ -53,8 +53,8 @@ isn't provided, so that the output is:: [12] [42] -What Does Happen -~~~~~~~~~~~~~~~~ +What Actually Happens +~~~~~~~~~~~~~~~~~~~~~ .. testoutput:: @@ -100,6 +100,7 @@ Late Binding Closures Another common source of confusion is the way Python binds its variables in closures (or in the surrounding global scope). + What You Wrote ~~~~~~~~~~~~~~ @@ -125,8 +126,8 @@ variable that multiplies their argument, producing:: 6 8 -What Does Happen -~~~~~~~~~~~~~~~~ +What Actually Happens +~~~~~~~~~~~~~~~~~~~~~ .. testoutput:: @@ -206,7 +207,7 @@ will automatically write a bytecode version of that file to disk, e.g. These ``.pyc`` files should not be checked into your source code repositories. Theoretically, this behavior is on by default for performance reasons. -Without these bytecode files present, Python would re-generate the bytecode +Without these bytecode files, Python would re-generate the bytecode every time the file is loaded. From ad22d2580cc36f0a27060df1ae940dd5266e5b45 Mon Sep 17 00:00:00 2001 From: Lokesh Dhakal <9079364+aviranzerioniac@users.noreply.github.com> Date: Sun, 22 Nov 2020 16:22:12 +0100 Subject: [PATCH 086/115] Minor Polishes --- docs/writing/license.rst | 4 ++-- docs/writing/logging.rst | 10 +++++----- docs/writing/structure.rst | 13 ++++++------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/docs/writing/license.rst b/docs/writing/license.rst index 0a74f5405..820cc9a05 100644 --- a/docs/writing/license.rst +++ b/docs/writing/license.rst @@ -6,8 +6,8 @@ Choosing a License .. image:: /_static/photos/33907149294_82d7535a6c_k_d.jpg -Your source publication *needs* a license. In the US, if no license is -specified, users have no legal right to download, modify, or distribute. +Your source publication *needs* a license. In the US, unless a license is +specified, users have no legal right to download, modify, or distribute the product. Furthermore, people can't contribute to your code unless you tell them what rules to play by. Choosing a license is complicated, so here are some pointers: diff --git a/docs/writing/logging.rst b/docs/writing/logging.rst index b609dc721..b6110f7f7 100644 --- a/docs/writing/logging.rst +++ b/docs/writing/logging.rst @@ -10,7 +10,7 @@ The :mod:`logging` module has been a part of Python's Standard Library since version 2.3. It is succinctly described in :pep:`282`. The documentation is notoriously hard to read, except for the `basic logging tutorial`_. -As an alternative, `loguru `_ provides an approach to logging nearly as simple as using a simple ``print`` statement. +As an alternative, `loguru `_ provides an approach for logging, nearly as simple as using a simple ``print`` statement. Logging serves two purposes: @@ -59,7 +59,7 @@ using the ``__name__`` global variable: the :mod:`logging` module creates a hierarchy of loggers using dot notation, so using ``__name__`` ensures no name collisions. -Here is an example of best practice from the `requests source`_ -- place +Here is an example of the best practice from the `requests source`_ -- place this in your ``__init__.py``: .. code-block:: python @@ -83,7 +83,7 @@ application environment. There are at least three ways to configure a logger: - Using an INI-formatted file: - - **Pro**: possible to update configuration while running using the + - **Pro**: possible to update configuration while running, using the function :func:`logging.config.listen` to listen on a socket. - **Con**: less control (e.g. custom subclassed filters or loggers) than possible when configuring a logger in code. @@ -94,13 +94,13 @@ There are at least three ways to configure a logger: - **Con**: less control than when configuring a logger in code. - Using code: - **Pro**: complete control over the configuration. - - **Con**: modifications require a change to source code. + - **Con**: modifications require a change to the source code. Example Configuration via an INI File ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Let us say the file is named ``logging_config.ini``. +Let us say that the file is named ``logging_config.ini``. More details for the file format are in the `logging configuration`_ section of the `logging tutorial`_. diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst index bbbef47fe..7a73e36a4 100644 --- a/docs/writing/structure.rst +++ b/docs/writing/structure.rst @@ -18,7 +18,7 @@ the project? What features and functions can be grouped together and isolated? By answering questions like these you can begin to plan, in a broad sense, what your finished product will look like. -In this section we take a closer look at Python's module and import +In this section, we take a closer look at Python's modules and import systems as they are the central elements to enforcing structure in your project. We then discuss various perspectives on how to build code which can be extended and tested reliably. @@ -32,7 +32,7 @@ It's Important. ::::::::::::::: Just as Code Style, API Design, and Automation are essential for a -healthy development cycle, Repository structure is a crucial part of +healthy development cycle. Repository structure is a crucial part of your project's `architecture `__. @@ -54,8 +54,7 @@ documentation. Of course, first impressions aren't everything. You and your colleagues will spend countless hours working with this repository, eventually -becoming intimately familiar with every nook and cranny. The layout of -it is important. +becoming intimately familiar with every nook and cranny. The layout is important. Sample Repository ::::::::::::::::: @@ -126,7 +125,7 @@ If you aren't sure which license you should use for your project, check out `choosealicense.com `_. Of course, you are also free to publish code without a license, but this -would prevent many people from potentially using your code. +would prevent many people from potentially using or contributing to your code. Setup.py :::::::: @@ -157,8 +156,8 @@ should be placed at the root of the repository. It should specify the dependencies required to contribute to the project: testing, building, and generating documentation. -If your project has no development dependencies, or you prefer -development environment setup via ``setup.py``, this file may be +If your project has no development dependencies, or if you prefer +setting up a development environment via ``setup.py``, this file may be unnecessary. Documentation From 148e6503a9036a8b3f4e179911555c6e31b28a0a Mon Sep 17 00:00:00 2001 From: Lokesh Dhakal <9079364+aviranzerioniac@users.noreply.github.com> Date: Sun, 22 Nov 2020 17:14:07 +0100 Subject: [PATCH 087/115] Monir Polishes --- docs/writing/structure.rst | 79 +++++++++++++++++++------------------- docs/writing/style.rst | 12 +++--- 2 files changed, 45 insertions(+), 46 deletions(-) diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst index 7a73e36a4..b8da9decd 100644 --- a/docs/writing/structure.rst +++ b/docs/writing/structure.rst @@ -330,42 +330,42 @@ Easy structuring of a project means it is also easy to do it poorly. Some signs of a poorly structured project include: -- Multiple and messy circular dependencies: if your classes +- Multiple and messy circular dependencies: If the classes Table and Chair in :file:`furn.py` need to import Carpenter from :file:`workers.py` to answer a question such as ``table.isdoneby()``, and if conversely the class Carpenter needs to import Table and Chair to answer the question ``carpenter.whatdo()``, then you have a circular dependency. In this case you will have to resort to - fragile hacks such as using import statements inside + fragile hacks such as using import statements inside your methods or functions. -- Hidden coupling: each and every change in Table's implementation +- Hidden coupling: Each and every change in Table's implementation breaks 20 tests in unrelated test cases because it breaks Carpenter's code, - which requires very careful surgery to adapt the change. This means + which requires very careful surgery to adapt to the change. This means you have too many assumptions about Table in Carpenter's code or the reverse. -- Heavy usage of global state or context: instead of explicitly +- Heavy usage of global state or context: Instead of explicitly passing ``(height, width, type, wood)`` to each other, Table and Carpenter rely on global variables that can be modified and are modified on the fly by different agents. You need to - scrutinize all access to these global variables to understand why + scrutinize all access to these global variables in order to understand why a rectangular table became a square, and discover that remote template code is also modifying this context, messing with - table dimensions. + the table dimensions. - Spaghetti code: multiple pages of nested if clauses and for loops with a lot of copy-pasted procedural code and no proper segmentation are known as spaghetti code. Python's - meaningful indentation (one of its most controversial features) make - it very hard to maintain this kind of code. So the good news is that + meaningful indentation (one of its most controversial features) makes + it very hard to maintain this kind of code. The good news is that you might not see too much of it. - Ravioli code is more likely in Python: it consists of hundreds of similar little pieces of logic, often classes or objects, without - proper structure. If you never can remember if you have to use + proper structure. If you never can remember, if you have to use FurnitureTable, AssetTable or Table, or even TableNew for your - task at hand, you might be swimming in ravioli code. + task at hand, then you might be swimming in ravioli code. ******* @@ -383,13 +383,13 @@ in one file, and all low-level operations in another file. In this case, the interface file needs to import the low-level file. This is done with the ``import`` and ``from ... import`` statements. -As soon as you use `import` statements you use modules. These can be either +As soon as you use `import` statements, you use modules. These can be either built-in modules such as `os` and `sys`, third-party modules you have installed in your environment, or your project's internal modules. To keep in line with the style guide, keep module names short, lowercase, and be sure to avoid using special symbols like the dot (.) or question mark (?). -So a file name like :file:`my.spam.py` is one you should avoid! Naming this way +A file name like :file:`my.spam.py` is the one you should avoid! Naming this way will interfere with the way Python looks for modules. In the case of `my.spam.py` Python expects to find a :file:`spam.py` file in a @@ -397,10 +397,10 @@ folder named :file:`my` which is not the case. There is an `example `_ of how the dot notation should be used in the Python docs. -If you'd like you could name your module :file:`my_spam.py`, but even our -friend the underscore should not be seen often in module names. However, using other +If you like, you could name your module :file:`my_spam.py`, but even our trusty +friend the underscore, should not be seen that often in module names. However, using other characters (spaces or hyphens) in module names will prevent importing -(- is the subtract operator), so try to keep module names short so there is +(- is the subtract operator). Try to keep module names short so there is no need to separate words. And, most of all, don't namespace with underscores; use submodules instead. .. code-block:: python @@ -411,15 +411,15 @@ no need to separate words. And, most of all, don't namespace with underscores; u import library.foo_plugin Aside from some naming restrictions, nothing special is required for a Python -file to be a module, but you need to understand the import mechanism in order +file to be a module. But you need to understand the import mechanism in order to use this concept properly and avoid some issues. Concretely, the ``import modu`` statement will look for the proper file, which -is :file:`modu.py` in the same directory as the caller if it exists. If it is +is :file:`modu.py` in the same directory as the caller, if it exists. If it is not found, the Python interpreter will search for :file:`modu.py` in the "path" -recursively and raise an ImportError exception if it is not found. +recursively and raise an ImportError exception when it is not found. -Once :file:`modu.py` is found, the Python interpreter will execute the module in +When :file:`modu.py` is found, the Python interpreter will execute the module in an isolated scope. Any top-level statement in :file:`modu.py` will be executed, including other imports if any. Function and class definitions are stored in the module's dictionary. @@ -436,7 +436,7 @@ unwanted effects, e.g. override an existing function with the same name. It is possible to simulate the more standard behavior by using a special syntax of the import statement: ``from modu import *``. This is generally considered -bad practice. **Using** ``import *`` **makes code harder to read and makes +bad practice. **Using** ``import *`` **makes the code harder to read and makes dependencies less compartmentalized**. Using ``from modu import func`` is a way to pinpoint the function you want to @@ -492,20 +492,20 @@ modules, but with a special behavior for the :file:`__init__.py` file, which is used to gather all package-wide definitions. A file :file:`modu.py` in the directory :file:`pack/` is imported with the -statement ``import pack.modu``. This statement will look for an +statement ``import pack.modu``. This statement will look for :file:`__init__.py` file in :file:`pack` and execute all of its top-level statements. Then it will look for a file named :file:`pack/modu.py` and execute all of its top-level statements. After these operations, any variable, function, or class defined in :file:`modu.py` is available in the pack.modu namespace. -A commonly seen issue is to add too much code to :file:`__init__.py` +A commonly seen issue is adding too much code to :file:`__init__.py` files. When the project complexity grows, there may be sub-packages and sub-sub-packages in a deep directory structure. In this case, importing a single item from a sub-sub-package will require executing all :file:`__init__.py` files met while traversing the tree. -Leaving an :file:`__init__.py` file empty is considered normal and even a good +Leaving an :file:`__init__.py` file empty is considered normal and even good practice, if the package's modules and sub-packages do not need to share any code. @@ -519,45 +519,44 @@ Object-oriented programming *************************** Python is sometimes described as an object-oriented programming language. This -can be somewhat misleading and needs to be clarified. +can be somewhat misleading and requires further clarifications. In Python, everything is an object, and can be handled as such. This is what is meant when we say, for example, that functions are first-class objects. Functions, classes, strings, and even types are objects in Python: like any object, they have a type, they can be passed as function arguments, and they -may have methods and properties. In this understanding, Python is an -object-oriented language. +may have methods and properties. In this understanding, Python can be considered +as an object-oriented language. However, unlike Java, Python does not impose object-oriented programming as the main programming paradigm. It is perfectly viable for a Python project to not be object-oriented, i.e. to use no or very few class definitions, class inheritance, or any other mechanisms that are specific to object-oriented -programming. +programming languages. Moreover, as seen in the modules_ section, the way Python handles modules and namespaces gives the developer a natural way to ensure the encapsulation and separation of abstraction layers, both being the most common reasons to use object-orientation. Therefore, Python programmers have more -latitude to not use object-orientation, when it is not required by the business +latitude as to not use object-orientation, when it is not required by the business model. There are some reasons to avoid unnecessary object-orientation. Defining -custom classes is useful when we want to glue together some state and some -functionality. The problem, as pointed out by the discussions about functional +custom classes is useful when we want to glue some state and some +functionality together. The problem, as pointed out by the discussions about functional programming, comes from the "state" part of the equation. In some architectures, typically web applications, multiple instances of Python -processes are spawned to respond to external requests that can happen at the -same time. In this case, holding some state in instantiated objects, which +processes are spawned as a response to external requests that happen simultaneously. +In this case, holding some state in instantiated objects, which means keeping some static information about the world, is prone to concurrency problems or race conditions. Sometimes, between the initialization of the state of an object (usually done with the ``__init__()`` method) and the actual use of the object state through one of its methods, the world may have changed, and the retained state may be outdated. For example, a request may load an item in memory and mark it as read by a user. If another request requires the deletion -of this item at the same time, it may happen that the deletion actually occurs -after the first process loaded the item, and then we have to mark as read a -deleted object. +of this item at the same time, the deletion may actually occur after the first +process loaded the item, and then we have to mark a deleted object as read. This and other issues led to the idea that using stateless functions is a better programming paradigm. @@ -571,7 +570,7 @@ or deletes data in a global variable or in the persistence layer, it is said to have a side-effect. Carefully isolating functions with context and side-effects from functions with -logic (called pure functions) allow the following benefits: +logic (called pure functions) allows the following benefits: - Pure functions are deterministic: given a fixed input, the output will always be the same. @@ -713,7 +712,7 @@ type. In fact, in Python, variables are very different from what they are in many other languages, specifically statically-typed languages. Variables are not a segment of the computer's memory where some value is written, they are 'tags' or 'names' pointing to objects. It is therefore possible for the variable 'a' to -be set to the value 1, then to the value 'a string', then to a function. +be set to the value 1, then the value 'a string', to a function. The dynamic typing of Python is often considered to be a weakness, and indeed it can lead to complexities and hard-to-debug code. Something named 'a' can be @@ -743,7 +742,7 @@ Some guidelines help to avoid this issue: def func(): pass # Do something -Using short functions or methods helps reduce the risk +Using short functions or methods helps to reduce the risk of using the same name for two unrelated things. It is better to use different names even for things that are related, @@ -845,7 +844,7 @@ most idiomatic way to do this. One final thing to mention about strings is that using ``join()`` is not always best. In the instances where you are creating a new string from a pre-determined -number of strings, using the addition operator is actually faster, but in cases +number of strings, using the addition operator is actually faster. But in cases like above or in cases where you are adding to an existing string, using ``join()`` should be your preferred method. diff --git a/docs/writing/style.rst b/docs/writing/style.rst index d40033afa..93f2ab875 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -8,7 +8,7 @@ Code Style .. image:: /_static/photos/33907150054_5ee79e8940_k_d.jpg If you ask Python programmers what they like most about Python, they will -often cite its high readability. Indeed, a high level of readability +often cite its high readability. Indeed, a high level of readability is at the heart of the design of the Python language, following the recognized fact that code is read much more often than it is written. @@ -644,7 +644,7 @@ provide a powerful, concise way to work with lists. `Generator expressions `_ follow almost the same syntax as list comprehensions but return a generator -instead of a list. +instead of a list. Creating a new list requires more work and uses more memory. If you are just going to loop through the new list, prefer using an iterator instead. @@ -668,7 +668,7 @@ example if you need to use the result multiple times. If your logic is too complicated for a short list comprehension or generator -expression, consider using a generator function instead of returning a list. +expression, consider using a generator function instead of returning a list. **Good**: @@ -688,7 +688,7 @@ expression, consider using a generator function instead of returning a list. yield current_batch -Never use a list comprehension just for its side effects. +Never use a list comprehension just for its side effects. **Bad**: @@ -701,7 +701,7 @@ Never use a list comprehension just for its side effects. .. code-block:: python for x in sequence: - print(x) + print(x) Filtering a list @@ -728,7 +728,7 @@ Don't make multiple passes through the list. **Good**: -Use a list comprehension or generator expression. +Use a list comprehension or generator expression. .. code-block:: python From 46ff6a600f88f8054003269d1e73f98dfb8a29d4 Mon Sep 17 00:00:00 2001 From: Lokesh Dhakal <9079364+aviranzerioniac@users.noreply.github.com> Date: Sun, 22 Nov 2020 21:30:35 +0100 Subject: [PATCH 088/115] Minor Polishes --- docs/scenarios/admin.rst | 2 +- docs/scenarios/ci.rst | 2 +- docs/starting/which-python.rst | 2 +- docs/writing/style.rst | 8 ++++---- docs/writing/tests.rst | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index 826906af0..07d263945 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -199,7 +199,7 @@ Ansible ******* `Ansible `_ is an open source system automation tool. -The biggest advantage over Puppet or Chef is it does not require an agent on +Its biggest advantage over Puppet or Chef is that it does not require an agent on the client machine. Playbooks are Ansible’s configuration, deployment, and orchestration language and are written in YAML with Jinja2 for templating. diff --git a/docs/scenarios/ci.rst b/docs/scenarios/ci.rst index ade9148c4..4296679c7 100644 --- a/docs/scenarios/ci.rst +++ b/docs/scenarios/ci.rst @@ -65,7 +65,7 @@ Travis-CI tests for open source projects for free. It provides multiple workers to run Python tests on and seamlessly integrates with GitHub. You can even have it comment on your Pull Requests whether this particular changeset breaks the -build or not. So if you are hosting your code on GitHub, Travis-CI is a great +build or not. So, if you are hosting your code on GitHub, Travis-CI is a great and easy way to get started with Continuous Integration. In order to get started, add a :file:`.travis.yml` file to your repository with diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst index b1e3a8212..59d42352e 100644 --- a/docs/starting/which-python.rst +++ b/docs/starting/which-python.rst @@ -31,7 +31,7 @@ Recommendations *************** -.. note:: The use of **Python 3** is *highly* preferred over Python 2. Consider upgrading your applications and infrastructure if you find yourself *still* using Python 2 in production today. If you are using Python 3, congratulations — you are indeed a person of excellent taste. +.. note:: The use of **Python 3** is *highly* recommended over Python 2. Consider upgrading your applications and infrastructure if you find yourself *still* using Python 2 in production today. If you are using Python 3, congratulations — you are indeed a person of excellent taste. —*Kenneth Reitz* I'll be blunt: diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 93f2ab875..3bf029911 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -226,7 +226,7 @@ but making a public property private might be a much harder operation. Returning values ~~~~~~~~~~~~~~~~ -When a function grows in complexity it is not uncommon to use multiple return +When a function grows in complexity, it is not uncommon to use multiple return statements inside the function's body. However, in order to keep a clear intent and a sustainable readability level, it is preferable to avoid returning meaningful values from many output points in the body. @@ -639,11 +639,11 @@ Short Ways to Manipulate Lists `List comprehensions `_ -provide a powerful, concise way to work with lists. +provides a powerful, concise way to work with lists. `Generator expressions `_ -follow almost the same syntax as list comprehensions but return a generator +follows almost the same syntax as list comprehensions but return a generator instead of a list. Creating a new list requires more work and uses more memory. If you are just going @@ -829,7 +829,7 @@ a white space added to the end of the line, after the backslash, will break the code and may have unexpected results. A better solution is to use parentheses around your elements. Left with an -unclosed parenthesis on an end-of-line the Python interpreter will join the +unclosed parenthesis on an end-of-line, the Python interpreter will join the next line until the parentheses are closed. The same behavior holds for curly and square braces. diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst index 7809d9ffe..28eb3260b 100644 --- a/docs/writing/tests.rst +++ b/docs/writing/tests.rst @@ -9,8 +9,8 @@ Testing Your Code Testing your code is very important. Getting used to writing testing code and running this code in parallel is now -considered a good habit. Used wisely, this method helps you define more -precisely your code's intent and have a more decoupled architecture. +considered a good habit. Used wisely, this method helps to define your +code's intent more precisely and have a more decoupled architecture. Some general rules of testing: @@ -294,6 +294,6 @@ always returns the same result (but only for the duration of the test). # get_search_results runs a search and iterates over the result self.assertEqual(len(myapp.get_search_results(q="fish")), 3) -Mock has many other ways you can configure it and control its behavior. +Mock has many other ways with which you can configure and control its behaviour. `mock `_ From be1ac344d6378e90d481112ef707cfbbe56bd83a Mon Sep 17 00:00:00 2001 From: Dan Bader Date: Mon, 25 Jan 2021 17:16:21 -0800 Subject: [PATCH 089/115] Update --- docs/_extra/ads.txt | 237 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) diff --git a/docs/_extra/ads.txt b/docs/_extra/ads.txt index 08a732487..1941fb277 100644 --- a/docs/_extra/ads.txt +++ b/docs/_extra/ads.txt @@ -154,3 +154,240 @@ Newormedia.com, 2169, DIRECT yieldmo.com, 2417496099628458357, DIRECT rhythmone.com, 2310154583, DIRECT, a670c89d4a324e47 + +openx.com, 539824308, RESELLER, 6a698e2ec38604c6 +openx.com, 542511596, RESELLER, 6a698e2ec38604c6 +teads.tv, 19014, DIRECT, 15a9c44f6d26cbe1 +brightcom.com, 20292, DIRECT +onomagic.com, 202921, DIRECT +audienciad.com, 202922, DIRECT +aps.amazon.com,48266a61-b3d9-4cb7-b172-553abc6a42a4,DIRECT +google.com, pub-5231479214411897, RESELLER, f08c47fec0942fa0 +google.com, pub-4207323757133151, RESELLER, f08c47fec0942fa0 +appnexus.com, 11801, RESELLER +appnexus.com, 12061, RESELLER +adtech.com, 11208, RESELLER +pubmatic.com, 159477,RESELLER,5d62403b186f2ace +appnexus.com, 12366, RESELLER, f5ab79cb980f11d1 +indexexchange.com, 189744, RESELLER +rubiconproject.com, 20416, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 21310, RESELLER , 0bfd66d529a55807 +openx.com, 537153209, RESELLER, 6a698e2ec38604c6 +sonobi.com, 37dd19ad4a, RESELLER, d1a215d9eb5aee9e +contextweb.com, 560606, RESELLER, 89ff185a4c4e857c +openx.com,540833447, RESELLER, 6a698e2ec38604c6 +improvedigital.com, 1362, RESELLER +sovrn.com, 270524, RESELLER, fafdf38b16bf6b2b +lijit.com, 270524, RESELLER, fafdf38b16bf6b2b +appnexus.com, 3153, RESELLER, f5ab79cb980f11d1 +pubmatic.com, 159330, RESELLER, 5d62403b186f2ace +33across.com, 0013300001qkdlwAAA, RESELLER +google.com, pub-6314168058065736, RESELLER, f08c47fec0942fa0 +pubmatic.com, 32987, RESELLER, 5d62403b186f2ace +google.com, pub-2290755540215120, RESELLER, f08c47fec0942fa0 +conversantmedia.com, 39882, DIRECT, 03113cd04947736d +contextweb.com, 561998, RESELLER, 89ff185a4c4e857c +pubmatic.com, 158100, RESELLER, 5d62403b186f2ace +districtm.io, 101080, RESELLER +adform.com, 2708, DIRECT, 9f5210a2f0999e32 +sparcmedia.com, 310627, Direct +appnexus.com, 12263, RESELLER +aps.amazon.com,094e2c86-72d9-47d6-a647-d95ce39ad4c7,DIRECT +sovrn.com,217352,DIRECT,fafdf38b16bf6b2b +lijit.com,217352,DIRECT,fafdf38b16bf6b2b +pubmatic.com,157150,RESELLER,5d62403b186f2ace +openx.com,540191398,RESELLER,6a698e2ec38604c6 +rubiconproject.com,18020,RESELLER,0bfd66d529a55807 +appnexus.com,1908,RESELLER,f5ab79cb980f11d1 +smaato.com,1100044650,RESELLER,07bcf65f187117b4 +adtech.com,12068,RESELLER,e1a5b5b6e3255540 +ad-generation.jp,12474,RESELLER,7f4ea9029ac04e53 +districtm.io,100962,RESELLER,3fd707be9c4527c3 +appnexus.com,3663,RESELLER,f5ab79cb980f11d1 +rhythmone.com,1654642120,RESELLER,a670c89d4a324e47 +yahoo.com,55029,RESELLER,e1a5b5b6e3255540 +gumgum.com,14141,RESELLER,ffdef49475d318a9 +pubmatic.com,160006,RESELLER,5d62403b186f2ace +pubmatic.com,160096,RESELLER,5d62403b186f2ace +amxrtb.com, 105199384, DIRECT +appnexus.com, 12290, RESELLER, f5ab79cb980f11d1 +appnexus.com, 11786, RESELLER, f5ab79cb980f11d1 +indexexchange.com, 191503, RESELLER, 50b1c356f2c5c8fc +lijit.com, 260380, RESELLER, fafdf38b16bf6b2b +sovrn.com, 260380, RESELLER, fafdf38b16bf6b2b +pubmatic.com, 158355 , RESELLER, 5d62403b186f2ace +appnexus.com, 9393, RESELLER #Video #Display, f5ab79cb980f11d1 +appnexus.com, 11924, RESELLER, f5ab79cb980f11d1 +appnexus.com, 1356, RESELLER, f5ab79cb980f11d1 +openx.com, 538959099, RESELLER, 6a698e2ec38604c6 +rubiconproject.com, 17960, RESELLER, 0bfd66d529a55807 +indexexchange.com, 186046, RESELLER +pubmatic.com, 158723, RESELLER, 5d62403b186f2ace +33across.com, 0013300001kQj2HAAS, RESELLER, bbea06d9c4d2853c +smaato.com, 1100047713, RESELLER, 07bcf65f187117b4 +yahoo.com, 57289, RESELLER, e1a5b5b6e3255540 +indexexchange.com, 191973, RESELLER, 50b1c356f2c5c8fc +rubiconproject.com, 21642, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 17822, RESELLER, 0bfd66d529a55807 +districtm.io, 100835, DIRECT, 3fd707be9c4527c3 +appnexus.com, 3153, RESELLER +conversantmedia.com, 40790, RESELLER, 03113cd04947736d +gumgum.com, 13504, RESELLER, ffdef49475d318a9 +pubmatic.com, 79136 , RESELLER, 5d62403b186f2ace +sharethrough.com, d09156e5, RESELLER, d53b998a7bd4ecd2 +Sekindo.com, 20749, DIRECT, b6b21d256ef43532 +spotxchange.com, 84294, RESELLER, 7842df1d2fe2db34 +spotx.tv, 84294, RESELLER, 7842df1d2fe2db34 +advertising.com, 7372, RESELLER +advertising.com, 24410, RESELLER +pubmatic.com, 156595, RESELLER, 5d62403b186f2ace +google.com, pub-1320774679920841, RESELLER, f08c47fec0942fa0 +openx.com, 540258065, RESELLER, 6a698e2ec38604c6 +rubiconproject.com, 20130, RESELLER, 0bfd66d529a55807 +freewheel.tv, 19129, RESELLER +freewheel.tv, 19133, RESELLER +tremorhub.com, mb9eo-oqsbf, RESELLER, 1a4e959a1b50034a +telaria.com, mb9eo-oqsbf, RESELLER, 1a4e959a1b50034a +smartadserver.com, 3436, RESELLER +indexexchange.com, 191923, RESELLER +contextweb.com, 562350, RESELLER, 89ff185a4c4e857c +pubmatic.com, 160131, RESELLER, 5d62403b186f2ace +pubmatic.com, 160082 , RESELLER, 5d62403b186f2ace +newormedia.com, 4908, DIRECT +rhythmone.com,2310154583,DIRECT,a670c89d4a324e47 +video.unrulymedia.com, 2310154583, DIRECT +indexexchange.com, 193351, DIRECT +lijit.com, 217352-eb, DIRECT, fafdf38b16bf6b2b +appnexus.com, 1360, RESELLER, f5ab79cb980f11d1 +openx.com, 538959099, RESELLER, 6a698e2ec38604c6 +pubmatic.com, 137711, RESELLER, 5d62403b186f2ace +pubmatic.com, 156212, RESELLER, 5d62403b186f2ace +rubiconproject.com, 17960, RESELLER, 0bfd66d529a55807 +synacor.com, 82350, RESELLER, e108f11b2cdf7d5b +33across.com, 0014000001aXjnGAAS, RESELLER, bbea06d9c4d2853c # 33 Across +adtech.com, 12094, RESELLER # 33 Across +advangelists.com, 8d3bba7425e7c98c50f52ca1b52d3735, RESELLER, 60d26397ec060f98 # 33 Across +appnexus.com, 10239, RESELLER, f5ab79cb980f11d1 # 33 Across +emxdgt.com, 326, RESELLER, 1e1d41537f7cad7f # 33 Across +google.com, pub-9557089510405422, RESELLER, f08c47fec0942fa0 # 33 Across +gumgum.com, 13318, RESELLER, ffdef49475d318a9 # 33 Across +openx.com, 537120563, RESELLER, 6a698e2ec38604c6 # 33 Across +pubmatic.com, 156423, RESELLER, 5d62403b186f2ace # 33 Across +rhythmone.com, 2439829435, RESELLER, a670c89d4a324e47 # 33 Across +rubiconproject.com, 16414, RESELLER, 0bfd66d529a55807 # 33 Across +advertising.com, 19623, RESELLER # AOL - One +indexexchange.com, 183965, RESELLER, 50b1c356f2c5c8fc # AOL - One +pubmatic.com, 156084, RESELLER, 5d62403b186f2ace # AOL - One +pubmatic.com, 156325, RESELLER, 5d62403b186f2ace # AOL - One +pubmatic.com, 156458, RESELLER, 5d62403b186f2ace # AOL - One +rubiconproject.com, 18222, RESELLER, 0bfd66d529a55807 # AOL - One +appnexus.com, 9316, RESELLER, f5ab79cb980f11d1 # AppNexus +appnexus.com, 4052, RESELLER, f5ab79cb980f11d1 # Conversant +conversantmedia.com, 20923, RESELLER # Conversant +openx.com, 540031703, RESELLER, 6a698e2ec38604c6 # Conversant +appnexus.com, 1908, RESELLER, f5ab79cb980f11d1 # DistrictM +districtm.io, 101769, RESELLER, 3fd707be9c4527c3 # DistrictM +google.com, pub-9685734445476814, RESELLER, f08c47fec0942fa0 # DistrictM +engagebdr.com, 10417, RESELLER # EngageDBR +improvedigital.com, 1669, RESELLER # ImproveDigital +indexexchange.com, 191740, RESELLER, 50b1c356f2c5c8fc # Index +themediagrid.com, P5JONV, RESELLER, 35d5010d7789b49d # Media Grid (IPONWEB) +onetag.com, 572a470226457b8, RESELLER # OneTag +openx.com, 540401713, RESELLER, 6a698e2ec38604c6 # OpenX +pubmatic.com, 156344, RESELLER, 5d62403b186f2ace # Pubmatic +advertising.com, 28605, RESELLER # RhythmOne +appnexus.com, 6849, RESELLER, f5ab79cb980f11d1 # RhythmOne +indexexchange.com, 182257, RESELLER, 50b1c356f2c5c8fc # RhythmOne +pubmatic.com, 159277, RESELLER, 5d62403b186f2ace # RhythmOne +rhythmone.com, 905992537, RESELLER, a670c89d4a324e47 # RhythmOne +rubiconproject.com, 15268, RESELLER, 0bfd66d529a55807 # RhythmOne +spotx.tv, 285547, RESELLER, 7842df1d2fe2db34 # RhythmOne +spotxchange.com, 285547, RESELLER, 7842df1d2fe2db34 # RhythmOne +video.unrulymedia.com, 905992537, RESELLER, a670c89d4a324e47 # RhythmOne +rubiconproject.com, 13344, RESELLER, 0bfd66d529a55807 # Rubicon +spotx.tv, 94794, RESELLER, 7842df1d2fe2db34 # SpotX +spotxchange.com, 94794, RESELLER, 7842df1d2fe2db34 # SpotX +advertising.com, 8603, RESELLER # Taboola +aol.com, 53392, RESELLER # Taboola +freewheel.tv, 799841, RESELLER # Taboola +freewheel.tv, 799921, RESELLER # Taboola +pubmatic.com, 156307, RESELLER, 5d62403b186f2ace # Taboola +rhythmone.com, 1166984029, RESELLER, a670c89d4a324e47 # Taboola +spotx.tv, 71451, RESELLER, 7842df1d2fe2db34 # Taboola +spotxchange.com, 71451, RESELLER, 7842df1d2fe2db34 # Taboola +tremorhub.com, z87wm, RESELLER, 1a4e959a1b50034a # Taboola +aralego.com, par-488A3E6BD8D997D0ED8B3BD34D8BA4B, RESELLER # ucFunnel +ucfunnel.com, par-488A3E6BD8D997D0ED8B3BD34D8BA4B, RESELLER # ucFunnel +yahoo.com, 55317, RESELLER # Verizon +pubnx.com, 337-1, RESELLER, 8728b7e97e589da4 # Vertoz +contextweb.com, 561118, RESELLER, 89ff185a4c4e857c #yieldmo +appnexus.com, 7911, RESELLER #yieldmo +rubiconproject.com, 17070, RESELLER, 0bfd66d529a55807 #yieldmo +pubnative.net, 1007284, RESELLER, d641df8625486a7b #yieldmodisplay +pubnative.net, 1007285, RESELLER, d641df8625486a7b #yieldmonative +pubnative.net, 1007286, RESELLER, d641df8625486a7b #yieldmovideo +onetag.com, 664e107d9f2b748, RESELLER #yieldmo +conversantmedia.com, 41812, DIRECT +appnexus.com, 4052, RESELLER +openx.com, 540031703, RESELLER, 6a698e2ec38604c6 +contextweb.com, 561998, RESELLER, 89ff185a4c4e857c +pubmatic.com, 158100, RESELLER, 5d62403b186f2ace +yahoo.com, 55771, RESELLER, e1a5b5b6e3255540 +appnexus.com, 7118, RESELLER +spotx.tv, 108933, RESELLER, 7842df1d2fe2db34 +spotxchange.com, 108933, RESELLER, 7842df1d2fe2db34 +improvedigital.com, 185, RESELLER +adform.com, 183, RESELLER +freewheel.tv, 33081, RESELLER +freewheel.tv, 33601, RESELLER +google.com, pub-8172268348509349, RESELLER, f08c47fec0942fa0 +indexexchange.com, 189872, RESELLER +openx.com, 541159484, RESELLER, 6a698e2ec38604c6 +gumgum.com,13174,DIRECT,ffdef49475d318a9 +appnexus.com,1001,reseller,f5ab79cb980f11d1 +appnexus.com,2758,reseller,f5ab79cb980f11d1 +bidtellect.com,1407,reseller,1c34aa2d85d45e93 +contextweb.com,558355,reseller +openx.com,537149485,reseller,6a698e2ec38604c6 +google.com,pub-9557089510405422,reseller,f08c47fec0942fa0 +google.com,pub-3848273848634341,reseller,f08c47fec0942fa0 +rhythmone.com,78519861,reseller,a670c89d4a324e47 +appnexus.com,7597,reseller,f5ab79cb980f11d1 +33across.com,0013300001r0t9mAAA,reseller,bbea06d9c4d2853c +appnexus.com,10239,reseller,f5ab79cb980f11d1 +pubmatic.com,157897,reseller,5d62403b186f2ace +synacor.com,82151,reseller,e108f11b2cdf7d5b +appnexus.com,9316,reseller,f5ab79cb980f11d1 +EMXDGT.com,1284,reseller,1e1d41537f7cad7f +appnexus.com,1356,reseller,f5ab79cb980f11d1 +outbrain.com,00254374f0c468f3b2732db17fd42cb6e5,reseller +aps.amazon.com,2840f06c-5d89-4853-a03e-3bfa567dd33c,reseller +adtech.com, 10947, DIRECT, e1a5b5b6e3255540 +appnexus.com, 7556, DIRECT, f5ab79cb980f11d1 +emxdgt.com, 20, DIRECT, 1e1d41537f7cad7f +indexexchange.com, 184914, DIRECT, 50b1c356f2c5c8fc +indexexchange.com, 186248, DIRECT, 50b1c356f2c5c8fc +lijit.com, 248396, DIRECT, fafdf38b16bf6b2b +openx.com, 537150004, DIRECT, 6a698e2ec38604c6 +pubmatic.com, 156319, DIRECT, 5d62403b186f2ace +sonobi.com, e55fb5d7c2, DIRECT, d1a215d9eb5aee9e +sovrn.com, 248396, DIRECT, fafdf38b16bf6b2b +tremorhub.com, vtrdn-wjdav, DIRECT, 1a4e959a1b50034a +rubiconproject.com, 17632, DIRECT, 0bfd66d529a55807 +openx.com, 539699341, DIRECT, 6a698e2ec38604c6 +rubiconproject.com, 18890, DIRECT, 0bfd66d529a55807 +pubmatic.com, 157367, DIRECT, 5d62403b186f2ace +indexexchange.com, 187454, DIRECT, 50b1c356f2c5c8fc +consumable.com, 2000908, DIRECT, aefcd3d2f45b5070 +sonobi.com, 6e5cfb5420, DIRECT, d1a215d9eb5aee9e +advertising.com, 28409, DIRECT, e1a5b5b6e3255540 +spotxchange.com, 270977, DIRECT, 7842df1d2fe2db34 +spotx.tv, 270977, DIRECT, 7842df1d2fe2db34 +telaria.com, vtrdn-wjdav, DIRECT, 1a4e959a1b50034a +lijit.com, 248396-eb, DIRECT, fafdf38b16bf6b2b +advertising.com, 28509, DIRECT, e1a5b5b6e3255540 +yahoo.com, 55104, DIRECT, e1a5b5b6e3255540 +pubmatic.com, 159117, DIRECT, 5d62403b186f2ace +tremorhub.com, vtrdn-ysjam, DIRECT, 1a4e959a1b50034a +telaria.com, vtrdn-ysjam, DIRECT, 1a4e959a1b50034a +yahoo.com, 57695, DIRECT, e1a5b5b6e3255540 From 3240cd0c808a42da5540264fc0c8ad9a10533045 Mon Sep 17 00:00:00 2001 From: klml Date: Tue, 26 Jan 2021 18:41:50 +0100 Subject: [PATCH 090/115] kennethreitzs essay repository-structure-and-python new URL --- docs/writing/structure.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst index b8da9decd..69c9cf616 100644 --- a/docs/writing/structure.rst +++ b/docs/writing/structure.rst @@ -59,7 +59,7 @@ becoming intimately familiar with every nook and cranny. The layout is important Sample Repository ::::::::::::::::: -**tl;dr**: This is what `Kenneth Reitz recommended in 2013 `__. +**tl;dr**: This is what `Kenneth Reitz recommended in 2013 `__. This repository is `available on GitHub `__. From 266b4c4f42d444e23425167103d785739c220a52 Mon Sep 17 00:00:00 2001 From: Dan Bader Date: Tue, 2 Feb 2021 11:03:11 -0800 Subject: [PATCH 091/115] Update --- docs/_extra/ads.txt | 649 ++++++++++++++++++++------------------------ 1 file changed, 298 insertions(+), 351 deletions(-) diff --git a/docs/_extra/ads.txt b/docs/_extra/ads.txt index 1941fb277..52291a930 100644 --- a/docs/_extra/ads.txt +++ b/docs/_extra/ads.txt @@ -1,393 +1,340 @@ -google.com, pub-2802445174821308, RESELLER, f08c47fec0942fa0 - - -appnexus.com, 8692, DIRECT, f5ab79cb980f11d1 - - -districtm.io, 100835, DIRECT -appnexus.com, 1908, RESELLER, f5ab79cb980f11d1 -google.com, pub-9685734445476814, RESELLER, f08c47fec0942fa0 - - -appnexus.com, 1613, reseller -appnexus.com, 3326, reseller -google.com, pub-1409765517756851, reseller -google.com, pub-4075894099602271, reseller -freewheel.tv, 146081, reseller -rubiconproject.com, 8861, reseller, 0bfd66d529a55807 - - -aol.com, 11119, DIRECT -adtech.com, 11341, DIRECT -coxmt.com, 2000067907202, RESELLER -Openx.com, 537143344, RESELLER -indexexchange.com, 175407, RESELLER - - -sonobi.com, 337f0e70cc, DIRECT -rhythmone.com, 1059622079, RESELLER -contextweb.com, 560606, RESELLER - - -sovrn.com, 217352, DIRECT, fafdf38b16bf6b2b -lijit.com, 217352, DIRECT, fafdf38b16bf6b2b -openx.com, 537120960, RESELLER -openx.com, 83499, RESELLER -openx.com, 538959099, RESELLER -pubmatic.com, 137711, RESELLER -pubmatic.com, 156212, RESELLER -pubmatic.com, 62483, RESELLER -contextweb.com, 558511, RESELLER -gumgum.com, 11645, RESELLER, ffdef49475d318a9 - - -openx.com, 539824308, RESELLER, 6a698e2ec38604c6 - - -rubiconproject.com, 17822, DIRECT, 0bfd66d529a55807 - - -gumgum.com, 13174, DIRECT, ffdef49475d318a9 +33across.com, 0010b00002Mpn7AAAR, DIRECT, bbea06d9c4d2853c +33across.com, 0013300001kQj2HAAS, RESELLER, bbea06d9c4d2853c +33across.com, 0013300001qkdlwAAA, RESELLER 33across.com, 0013300001r0t9mAAA, RESELLER +33across.com, 0014000001aXjnGAAS, RESELLER, bbea06d9c4d2853c # 33 Across +33across.com,0013300001r0t9mAAA,reseller,bbea06d9c4d2853c +ad-generation.jp,12474,RESELLER,7f4ea9029ac04e53 +adform.com, 183, RESELLER +adform.com, 2708, DIRECT, 9f5210a2f0999e32 +adtech.com, 10947, DIRECT, e1a5b5b6e3255540 +adtech.com, 11095, RESELLER +adtech.com, 11119, RESELLER +adtech.com, 11208, RESELLER +adtech.com, 11341, DIRECT +adtech.com, 12094, RESELLER +adtech.com, 12094, RESELLER # 33 Across adtech.com, 9904, RESELLER +adtech.com,12068,RESELLER,e1a5b5b6e3255540 +advangelists.com, 8d3bba7425e7c98c50f52ca1b52d3735, RESELLER, 60d26397ec060f98 +advangelists.com, 8d3bba7425e7c98c50f52ca1b52d3735, RESELLER, 60d26397ec060f98 # 33 Across +advertising.com, 11602, RESELLER Advertising.com, 16736, RESELLER +advertising.com, 19623, RESELLER # AOL - One +advertising.com, 24410, RESELLER +advertising.com, 28409, DIRECT, e1a5b5b6e3255540 +advertising.com, 28509, DIRECT, e1a5b5b6e3255540 +advertising.com, 28605, RESELLER # RhythmOne +advertising.com, 7372, RESELLER +advertising.com, 8603, RESELLER # Taboola +amxrtb.com, 105199384, DIRECT +aol.com, 11119, DIRECT +aol.com, 53392, RESELLER # Taboola aolcloud.net, 9904, RESELLER appnexus.com, 1001, RESELLER, f5ab79cb980f11d1 +appnexus.com, 10239, RESELLER, f5ab79cb980f11d1 +appnexus.com, 10239, RESELLER, f5ab79cb980f11d1 # 33 Across +appnexus.com, 11786, RESELLER, f5ab79cb980f11d1 +appnexus.com, 11801, RESELLER +appnexus.com, 11924, RESELLER, f5ab79cb980f11d1 +appnexus.com, 12061, RESELLER +appnexus.com, 12263, RESELLER +appnexus.com, 12290, RESELLER, f5ab79cb980f11d1 +appnexus.com, 12366, RESELLER, f5ab79cb980f11d1 +appnexus.com, 1314, RESELLER +Appnexus.com, 1356, RESELLER, f5ab79cb980f11d1 +appnexus.com, 1360, RESELLER, f5ab79cb980f11d1 +appnexus.com, 1613, reseller +appnexus.com, 1908, RESELLER +appnexus.com, 1908, RESELLER, f5ab79cb980f11d1 +appnexus.com, 1908, RESELLER, f5ab79cb980f11d1 # DistrictM appnexus.com, 1942, RESELLER, f5ab79cb980f11d1 +appnexus.com, 2530, RESELLER appnexus.com, 2758, RESELLER, f5ab79cb980f11d1 appnexus.com, 3135, RESELLER, f5ab79cb980f11d1 +appnexus.com, 3153, DIRECT +appnexus.com, 3153, RESELLER +appnexus.com, 3153, RESELLER, f5ab79cb980f11d1 +appnexus.com, 3326, reseller +appnexus.com, 4052, RESELLER +appnexus.com, 4052, RESELLER, f5ab79cb980f11d1 # Conversant +appnexus.com, 6849, RESELLER, f5ab79cb980f11d1 # RhythmOne +appnexus.com, 7118, RESELLER +appnexus.com, 7556, DIRECT, f5ab79cb980f11d1 appnexus.com, 7597, RESELLER, f5ab79cb980f11d1 +appnexus.com, 7911, RESELLER #yieldmo +appnexus.com, 7944, RESELLER +appnexus.com, 8692, DIRECT, f5ab79cb980f11d1 +appnexus.com, 9316, RESELLER, f5ab79cb980f11d1 # AppNexus +appnexus.com, 9393, DIRECT +appnexus.com, 9393, RESELLER #Video #Display, f5ab79cb980f11d1 +appnexus.com,1001,reseller,f5ab79cb980f11d1 +appnexus.com,10239,reseller,f5ab79cb980f11d1 +appnexus.com,1356,reseller,f5ab79cb980f11d1 +appnexus.com,1908,RESELLER,f5ab79cb980f11d1 +appnexus.com,2758,reseller,f5ab79cb980f11d1 +appnexus.com,3663,RESELLER,f5ab79cb980f11d1 +appnexus.com,7597,reseller,f5ab79cb980f11d1 +appnexus.com,9316,reseller,f5ab79cb980f11d1 +aps.amazon.com,094e2c86-72d9-47d6-a647-d95ce39ad4c7,DIRECT +aps.amazon.com,2840f06c-5d89-4853-a03e-3bfa567dd33c,reseller +aps.amazon.com,48266a61-b3d9-4cb7-b172-553abc6a42a4,DIRECT +aralego.com, par-488A3E6BD8D997D0ED8B3BD34D8BA4B, RESELLER # ucFunnel +audienciad.com, 202922, DIRECT bidtellect.com, 1407, RESELLER, 1c34aa2d85d45e93 +bidtellect.com,1407,reseller,1c34aa2d85d45e93 +brightcom.com, 20292, DIRECT +ccoxmt.com, 2000067997702, RESELLER +consumable.com, 2000908, DIRECT, aefcd3d2f45b5070 contextweb.com, 558355, RESELLER +contextweb.com, 558511, RESELLER +contextweb.com, 560606, RESELLER +contextweb.com, 560606, RESELLER, 89ff185a4c4e857 +contextweb.com, 560606, RESELLER, 89ff185a4c4e857c +contextweb.com, 561118, RESELLER, 89ff185a4c4e857c #yieldmo +contextweb.com, 561998, RESELLER, 89ff185a4c4e857c +contextweb.com, 562350, RESELLER, 89ff185a4c4e857c +contextweb.com,558355,reseller +conversantmedia.com, 20923, RESELLER # Conversant +conversantmedia.com, 39882, DIRECT, 03113cd04947736d +conversantmedia.com, 40790, RESELLER, 03113cd04947736d +conversantmedia.com, 41812, DIRECT +coxmt.com, 2000067907202, RESELLER criteo.com, 109412, DIRECT, 9fac4a4a87c2a44f +districtm.io, 100808, DIRECT +districtm.io, 100835, DIRECT +districtm.io, 100835, DIRECT, 3fd707be9c4527c3 +districtm.io, 101080, RESELLER +districtm.io, 101769, RESELLER, 3fd707be9c4527c3 # DistrictM +districtm.io,100962,RESELLER,3fd707be9c4527c3 +EMXDGT.com, 1133, DIRECT, 1e1d41537f7cad7f +emxdgt.com, 20, DIRECT, 1e1d41537f7cad7f +emxdgt.com, 326, RESELLER, 1e1d41537f7cad7f +emxdgt.com, 326, RESELLER, 1e1d41537f7cad7f # 33 Across +EMXDGT.com,1284,reseller,1e1d41537f7cad7f +engagebdr.com, 10417, RESELLER # EngageDBR +freewheel.tv, 146081, reseller +freewheel.tv, 19129, RESELLER +freewheel.tv, 19133, RESELLER +freewheel.tv, 33081, RESELLER +freewheel.tv, 33601, RESELLER +freewheel.tv, 799841, RESELLER # Taboola +freewheel.tv, 799921, RESELLER # Taboola +google.com, pub-1320774679920841, RESELLER, f08c47fec0942fa0 +google.com, pub-1409765517756851, reseller +google.com, pub-2290755540215120, RESELLER, f08c47fec0942fa0 +google.com, pub-2802445174821308, RESELLER, f08c47fec0942fa0 google.com, pub-3848273848634341, RESELLER, f08c47fec0942fa0 +google.com, pub-4075894099602271, reseller +google.com, pub-4207323757133151, RESELLER, f08c47fec0942fa0 +google.com, pub-4641608711979091, DIRECT, f08c47fec0942fa0 +google.com, pub-5231479214411897, RESELLER, f08c47fec0942fa0 +Google.com, pub-5995202563537249, RESELLER, f08c47fec0942fa0 +google.com, pub-6314168058065736, RESELLER, f08c47fec0942fa0 +google.com, pub-8172268348509349, RESELLER, f08c47fec0942fa0 google.com, pub-9557089510405422, RESELLER, f08c47fec0942fa0 +google.com, pub-9557089510405422, RESELLER, f08c47fec0942fa0 # 33 Across +google.com, pub-9685734445476814, RESELLER, f08c47fec0942fa0 +google.com, pub-9685734445476814, RESELLER, f08c47fec0942fa0 # DistrictM +google.com,pub-3848273848634341,reseller,f08c47fec0942fa0 +google.com,pub-9557089510405422,reseller,f08c47fec0942fa0 +gumgum.com, 11645, RESELLER, ffdef49475d318a9 +gumgum.com, 13174, DIRECT, ffdef49475d318a9 +gumgum.com, 13318, RESELLER, ffdef49475d318a9 +gumgum.com, 13318, RESELLER, ffdef49475d318a9 # 33 Across +gumgum.com, 13504, RESELLER, ffdef49475d318a9 +gumgum.com,13174,DIRECT,ffdef49475d318a9 +gumgum.com,14141,RESELLER,ffdef49475d318a9 +improvedigital.com, 1362, RESELLER +improvedigital.com, 1669, RESELLER # ImproveDigital +improvedigital.com, 185, RESELLER +indexexchange.com, 175407, RESELLER indexexchange.com, 177754, RESELLER, 50b1c356f2c5c8fc +indexexchange.com, 182257, RESELLER, 50b1c356f2c5c8fc # RhythmOne +indexexchange.com, 183965, RESELLER, 50b1c356f2c5c8fc # AOL - One +indexexchange.com, 184914, DIRECT, 50b1c356f2c5c8fc +indexexchange.com, 186046, RESELLER +indexexchange.com, 186248, DIRECT, 50b1c356f2c5c8fc +indexexchange.com, 187196, DIRECT +indexexchange.com, 187454, DIRECT, 50b1c356f2c5c8fc +indexexchange.com, 189744, RESELLER +indexexchange.com, 189872, RESELLER +indexexchange.com, 191503, RESELLER, 50b1c356f2c5c8fc +indexexchange.com, 191740, RESELLER, 50b1c356f2c5c8fc # Index +indexexchange.com, 191923, RESELLER +indexexchange.com, 191973, RESELLER, 50b1c356f2c5c8fc +indexexchange.com, 193351, DIRECT +lijit.com, 217352, DIRECT, fafdf38b16bf6b2b +lijit.com, 217352-eb, DIRECT, fafdf38b16bf6b2b +lijit.com, 248396, DIRECT, fafdf38b16bf6b2b +lijit.com, 248396-eb, DIRECT, fafdf38b16bf6b2b +lijit.com, 260380, RESELLER, fafdf38b16bf6b2b +lijit.com, 270524, RESELLER, fafdf38b16bf6b2b +lijit.com,217352,DIRECT,fafdf38b16bf6b2b lkqd.com, 470, RESELLER, 59c49fa9598a0117 lkqd.net, 470, RESELLER, 59c49fa9598a0117 +Newormedia.com, 2169, DIRECT +newormedia.com, 4908, DIRECT +onetag.com, 572a470226457b8, RESELLER # OneTag +onetag.com, 664e107d9f2b748, RESELLER #yieldmo +onomagic.com, 202921, DIRECT +openx.com, 539824308, RESELLER, 6a698e2ec38604c6 openx.com, 537120563, RESELLER, 6a698e2ec38604c6 +openx.com, 537120563, RESELLER, 6a698e2ec38604c6 # 33 Across +openx.com, 537120960, RESELLER +openx.com, 537127577, RESELLER, 6a698e2ec38604c6 +Openx.com, 537143344, RESELLER openx.com, 537149485, RESELLER, 6a698e2ec38604c6 +openx.com, 537150004, DIRECT, 6a698e2ec38604c6 +openx.com, 537153209, RESELLER, 6a698e2ec38604c6 +openx.com, 538959099, RESELLER +openx.com, 538959099, RESELLER, 6a698e2ec38604c6 +openx.com, 539699341, DIRECT, 6a698e2ec38604c6 +openx.com, 539824308, RESELLER, 6a698e2ec38604c6 openx.com, 540003333, RESELLER, 6a698e2ec38604c6 -outbrain.com, 01a755b08c8c22b15d46a8b753ab6955d4, RESELLER +openx.com, 540031703, RESELLER, 6a698e2ec38604c6 +openx.com, 540031703, RESELLER, 6a698e2ec38604c6 # Conversant +openx.com, 540258065, RESELLER, 6a698e2ec38604c6 +openx.com, 540274407, RESELLER, 6a698e2ec38604c6 +openx.com, 540337213, RESELLER, 6a698e2ec38604c6 +openx.com, 540401713, RESELLER, 6a698e2ec38604c6 # OpenX +openx.com, 541159484, RESELLER, 6a698e2ec38604c6 +openx.com, 542511596, RESELLER, 6a698e2ec38604c6 +openx.com, 83499, RESELLER +openx.com,537149485,reseller,6a698e2ec38604c6 +openx.com,540191398,RESELLER,6a698e2ec38604c6 +openx.com,540833447, RESELLER, 6a698e2ec38604c6 outbrain.com, 01a755b08c8c22b15d46a8b753ab6955d4, DIRECT +outbrain.com, 01a755b08c8c22b15d46a8b753ab6955d4, RESELLER +outbrain.com,00254374f0c468f3b2732db17fd42cb6e5,reseller +pubmatic.com, 137711, RESELLER +pubmatic.com, 137711, RESELLER, 5d62403b186f2ace +pubmatic.com, 156084, RESELLER, 5d62403b186f2ace # AOL - One +pubmatic.com, 156212, RESELLER +pubmatic.com, 156212, RESELLER, 5d62403b186f2ace +pubmatic.com, 156307, RESELLER, 5d62403b186f2ace # Taboola +pubmatic.com, 156319, DIRECT, 5d62403b186f2ace +pubmatic.com, 156325, RESELLER, 5d62403b186f2ace # AOL - One +pubmatic.com, 156344, RESELLER, 5d62403b186f2ace # Pubmatic +pubmatic.com, 156423, RESELLER, 5d62403b186f2ace +pubmatic.com, 156423, RESELLER, 5d62403b186f2ace # 33 Across +pubmatic.com, 156458, RESELLER, 5d62403b186f2ace # AOL - One +pubmatic.com, 156557, RESELLER +pubmatic.com, 156595, RESELLER, 5d62403b186f2ace +pubmatic.com, 157367, DIRECT, 5d62403b186f2ace +pubmatic.com, 158100, RESELLER, 5d62403b186f2ace +pubmatic.com, 158355 , RESELLER, 5d62403b186f2ace +pubmatic.com, 158723, RESELLER, 5d62403b186f2ace +pubmatic.com, 159117, DIRECT, 5d62403b186f2ace +pubmatic.com, 159277, RESELLER, 5d62403b186f2ace # RhythmOne +pubmatic.com, 159330, RESELLER, 5d62403b186f2ace +pubmatic.com, 159477,RESELLER,5d62403b186f2ace +pubmatic.com, 160082 , RESELLER, 5d62403b186f2ace +pubmatic.com, 160131, RESELLER, 5d62403b186f2ace +pubmatic.com, 32987, RESELLER, 5d62403b186f2ace pubmatic.com, 50758, RESELLER, 5d62403b186f2ace +pubmatic.com, 62483, RESELLER +pubmatic.com, 79136 , RESELLER, 5d62403b186f2ace +pubmatic.com,157150,RESELLER,5d62403b186f2ace +pubmatic.com,157897,reseller,5d62403b186f2ace +pubmatic.com,160006,RESELLER,5d62403b186f2ace +pubmatic.com,160096,RESELLER,5d62403b186f2ace +pubnative.net, 1007284, RESELLER, d641df8625486a7b #yieldmodisplay +pubnative.net, 1007285, RESELLER, d641df8625486a7b #yieldmonative +pubnative.net, 1007286, RESELLER, d641df8625486a7b #yieldmovideo +pubnx.com, 337-1, RESELLER, 8728b7e97e589da4 # Vertoz revcontent.com, 76611, RESELLER -rhythmone.com, 78519861, RESELLER -smaato.com, 1100033117, RESELLER -spotx.tv, 147949, RESELLER, 7842df1d2fe2db34 -spotxchange.com, 147949, RESELLER, 7842df1d2fe2db34 -springserve.com, 686, DIRECT, a24eb641fc82e93d - - -indexexchange.com, 187196, DIRECT - +rhythmone.com, 1059622079, RESELLER rhythmone.com, 1059622079, RESELLER, a670c89d4a324e47 -contextweb.com, 560606, RESELLER, 89ff185a4c4e857 -ccoxmt.com, 2000067997702, RESELLER -adtech.com, 11119, RESELLER -33across.com, 0013300001r0t9mAAA, RESELLER -adtech.com, 9904, RESELLER -Advertising.com, 16736, RESELLER -aolcloud.net, 9904, RESELLER -appnexus.com, 7597, RESELLER, f5ab79cb980f11d1 -bidtellect.com, 1407, RESELLER, 1c34aa2d85d45e93 -contextweb.com, 558355, RESELLER -criteo.com, 109412, DIRECT, 9fac4a4a87c2a44f -indexexchange.com, 177754, RESELLER, 50b1c356f2c5c8fc -lkqd.com, 470, RESELLER, 59c49fa9598a0117 -lkqd.net, 470, RESELLER, 59c49fa9598a0117 -outbrain.com, 01a755b08c8c22b15d46a8b753ab6955d4, RESELLER -outbrain.com, 01a755b08c8c22b15d46a8b753ab6955d4, DIRECT -revcontent.com, 76611, RESELLER -smaato.com, 1100033117, RESELLER -spotx.tv, 147949, RESELLER, 7842df1d2fe2db34 -spotxchange.com, 147949, RESELLER, 7842df1d2fe2db34 -springserve.com, 686, DIRECT, a24eb641fc82e93d - -33across.com, 0010b00002Mpn7AAAR, DIRECT, bbea06d9c4d2853c -rubiconproject.com, 16414, RESELLER, 0bfd66d529a55807 -pubmatic.com, 156423, RESELLER, 5d62403b186f2ace -appnexus.com, 10239, RESELLER, f5ab79cb980f11d1 -openx.com, 537120563, RESELLER, 6a698e2ec38604c6 -rhythmone.com, 2439829435, RESELLER, a670c89d4a324e47 -emxdgt.com, 326, RESELLER, 1e1d41537f7cad7f -gumgum.com, 13318, RESELLER, ffdef49475d318a9 -adtech.com, 12094, RESELLER -advangelists.com, 8d3bba7425e7c98c50f52ca1b52d3735, RESELLER, 60d26397ec060f98 -EMXDGT.com, 1133, DIRECT, 1e1d41537f7cad7f -Appnexus.com, 1356, RESELLER, f5ab79cb980f11d1 -Google.com, pub-5995202563537249, RESELLER, f08c47fec0942fa0 -sharethrough.com, 3a0f657b, DIRECT, d53b998a7bd4ecd2 -spotxchange.com, 212457, RESELLER -spotx.tv, 212457, RESELLER -pubmatic.com, 156557, RESELLER -rubiconproject.com, 18694, RESELLER, 0bfd66d529a55807 -openx.com, 540274407, RESELLER, 6a698e2ec38604c6 -appnexus.com, 2530, RESELLER -appnexus.com, 3153, DIRECT -advertising.com, 11602, RESELLER -vertamedia.com, 287605, DIRECT, 7de89dc7742b5b11 -vertamedia.com, 287605, RESELLER, 7de89dc7742b5b11 -appnexus.com, 9393, DIRECT -adtech.com, 11095, RESELLER -coxmt.com, 2000067907202, RESELLER -openx.com, 537143344, RESELLER -indexexchange.com, 175407, RESELLER -districtm.io, 100808, DIRECT -appnexus.com, 7944, RESELLER -appnexus.com, 1908, RESELLER -openx.com, 537127577, RESELLER, 6a698e2ec38604c6 -openx.com, 540337213, RESELLER, 6a698e2ec38604c6 rhythmone.com, 1114124056, RESELLER, a670c89d4a324e47 +rhythmone.com, 1166984029, RESELLER, a670c89d4a324e47 # Taboola rhythmone.com, 2241341073, RESELLER, a670c89d4a324e47 +rhythmone.com, 2310154583, DIRECT, a670c89d4a324e47 +rhythmone.com, 2439829435, RESELLER, a670c89d4a324e47 +rhythmone.com, 2439829435, RESELLER, a670c89d4a324e47 # 33 Across +rhythmone.com, 78519861, RESELLER +rhythmone.com, 905992537, RESELLER, a670c89d4a324e47 # RhythmOne +rhythmone.com,1654642120,RESELLER,a670c89d4a324e47 +rhythmone.com,2310154583,DIRECT,a670c89d4a324e47 +rhythmone.com,78519861,reseller,a670c89d4a324e47 rtk.io, 819, DIRECT +rubiconproject.com, 13344, RESELLER, 0bfd66d529a55807 # Rubicon +rubiconproject.com, 15268, RESELLER, 0bfd66d529a55807 # RhythmOne +rubiconproject.com, 16414, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 16414, RESELLER, 0bfd66d529a55807 # 33 Across +rubiconproject.com, 17070, RESELLER, 0bfd66d529a55807 #yieldmo +rubiconproject.com, 17632, DIRECT, 0bfd66d529a55807 rubiconproject.com, 17790, RESELLER, 0bfd66d529a55807 rubiconproject.com, 17792, RESELLER, 0bfd66d529a55807 - -triplelift.com, 7205, DIRECT, 6c33edb13117fd86 -appnexus.com, 1314, RESELLER -spotxchange.com, 228454, RESELLER, 7842df1d2fe2db34 -spotx.tv, 228454, RESELLER, 7842df1d2fe2db34 - -google.com, pub-4641608711979091, DIRECT, f08c47fec0942fa0 -Newormedia.com, 2169, DIRECT - -yieldmo.com, 2417496099628458357, DIRECT -rhythmone.com, 2310154583, DIRECT, a670c89d4a324e47 - -openx.com, 539824308, RESELLER, 6a698e2ec38604c6 -openx.com, 542511596, RESELLER, 6a698e2ec38604c6 -teads.tv, 19014, DIRECT, 15a9c44f6d26cbe1 -brightcom.com, 20292, DIRECT -onomagic.com, 202921, DIRECT -audienciad.com, 202922, DIRECT -aps.amazon.com,48266a61-b3d9-4cb7-b172-553abc6a42a4,DIRECT -google.com, pub-5231479214411897, RESELLER, f08c47fec0942fa0 -google.com, pub-4207323757133151, RESELLER, f08c47fec0942fa0 -appnexus.com, 11801, RESELLER -appnexus.com, 12061, RESELLER -adtech.com, 11208, RESELLER -pubmatic.com, 159477,RESELLER,5d62403b186f2ace -appnexus.com, 12366, RESELLER, f5ab79cb980f11d1 -indexexchange.com, 189744, RESELLER +rubiconproject.com, 17822, DIRECT, 0bfd66d529a55807 +rubiconproject.com, 17822, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 17960, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 18222, RESELLER, 0bfd66d529a55807 # AOL - One +rubiconproject.com, 18694, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 18890, DIRECT, 0bfd66d529a55807 +rubiconproject.com, 20130, RESELLER, 0bfd66d529a55807 rubiconproject.com, 20416, RESELLER, 0bfd66d529a55807 rubiconproject.com, 21310, RESELLER , 0bfd66d529a55807 -openx.com, 537153209, RESELLER, 6a698e2ec38604c6 -sonobi.com, 37dd19ad4a, RESELLER, d1a215d9eb5aee9e -contextweb.com, 560606, RESELLER, 89ff185a4c4e857c -openx.com,540833447, RESELLER, 6a698e2ec38604c6 -improvedigital.com, 1362, RESELLER -sovrn.com, 270524, RESELLER, fafdf38b16bf6b2b -lijit.com, 270524, RESELLER, fafdf38b16bf6b2b -appnexus.com, 3153, RESELLER, f5ab79cb980f11d1 -pubmatic.com, 159330, RESELLER, 5d62403b186f2ace -33across.com, 0013300001qkdlwAAA, RESELLER -google.com, pub-6314168058065736, RESELLER, f08c47fec0942fa0 -pubmatic.com, 32987, RESELLER, 5d62403b186f2ace -google.com, pub-2290755540215120, RESELLER, f08c47fec0942fa0 -conversantmedia.com, 39882, DIRECT, 03113cd04947736d -contextweb.com, 561998, RESELLER, 89ff185a4c4e857c -pubmatic.com, 158100, RESELLER, 5d62403b186f2ace -districtm.io, 101080, RESELLER -adform.com, 2708, DIRECT, 9f5210a2f0999e32 -sparcmedia.com, 310627, Direct -appnexus.com, 12263, RESELLER -aps.amazon.com,094e2c86-72d9-47d6-a647-d95ce39ad4c7,DIRECT -sovrn.com,217352,DIRECT,fafdf38b16bf6b2b -lijit.com,217352,DIRECT,fafdf38b16bf6b2b -pubmatic.com,157150,RESELLER,5d62403b186f2ace -openx.com,540191398,RESELLER,6a698e2ec38604c6 -rubiconproject.com,18020,RESELLER,0bfd66d529a55807 -appnexus.com,1908,RESELLER,f5ab79cb980f11d1 -smaato.com,1100044650,RESELLER,07bcf65f187117b4 -adtech.com,12068,RESELLER,e1a5b5b6e3255540 -ad-generation.jp,12474,RESELLER,7f4ea9029ac04e53 -districtm.io,100962,RESELLER,3fd707be9c4527c3 -appnexus.com,3663,RESELLER,f5ab79cb980f11d1 -rhythmone.com,1654642120,RESELLER,a670c89d4a324e47 -yahoo.com,55029,RESELLER,e1a5b5b6e3255540 -gumgum.com,14141,RESELLER,ffdef49475d318a9 -pubmatic.com,160006,RESELLER,5d62403b186f2ace -pubmatic.com,160096,RESELLER,5d62403b186f2ace -amxrtb.com, 105199384, DIRECT -appnexus.com, 12290, RESELLER, f5ab79cb980f11d1 -appnexus.com, 11786, RESELLER, f5ab79cb980f11d1 -indexexchange.com, 191503, RESELLER, 50b1c356f2c5c8fc -lijit.com, 260380, RESELLER, fafdf38b16bf6b2b -sovrn.com, 260380, RESELLER, fafdf38b16bf6b2b -pubmatic.com, 158355 , RESELLER, 5d62403b186f2ace -appnexus.com, 9393, RESELLER #Video #Display, f5ab79cb980f11d1 -appnexus.com, 11924, RESELLER, f5ab79cb980f11d1 -appnexus.com, 1356, RESELLER, f5ab79cb980f11d1 -openx.com, 538959099, RESELLER, 6a698e2ec38604c6 -rubiconproject.com, 17960, RESELLER, 0bfd66d529a55807 -indexexchange.com, 186046, RESELLER -pubmatic.com, 158723, RESELLER, 5d62403b186f2ace -33across.com, 0013300001kQj2HAAS, RESELLER, bbea06d9c4d2853c -smaato.com, 1100047713, RESELLER, 07bcf65f187117b4 -yahoo.com, 57289, RESELLER, e1a5b5b6e3255540 -indexexchange.com, 191973, RESELLER, 50b1c356f2c5c8fc rubiconproject.com, 21642, RESELLER, 0bfd66d529a55807 -rubiconproject.com, 17822, RESELLER, 0bfd66d529a55807 -districtm.io, 100835, DIRECT, 3fd707be9c4527c3 -appnexus.com, 3153, RESELLER -conversantmedia.com, 40790, RESELLER, 03113cd04947736d -gumgum.com, 13504, RESELLER, ffdef49475d318a9 -pubmatic.com, 79136 , RESELLER, 5d62403b186f2ace -sharethrough.com, d09156e5, RESELLER, d53b998a7bd4ecd2 +rubiconproject.com, 8861, reseller, 0bfd66d529a55807 +rubiconproject.com,18020,RESELLER,0bfd66d529a55807 Sekindo.com, 20749, DIRECT, b6b21d256ef43532 -spotxchange.com, 84294, RESELLER, 7842df1d2fe2db34 -spotx.tv, 84294, RESELLER, 7842df1d2fe2db34 -advertising.com, 7372, RESELLER -advertising.com, 24410, RESELLER -pubmatic.com, 156595, RESELLER, 5d62403b186f2ace -google.com, pub-1320774679920841, RESELLER, f08c47fec0942fa0 -openx.com, 540258065, RESELLER, 6a698e2ec38604c6 -rubiconproject.com, 20130, RESELLER, 0bfd66d529a55807 -freewheel.tv, 19129, RESELLER -freewheel.tv, 19133, RESELLER -tremorhub.com, mb9eo-oqsbf, RESELLER, 1a4e959a1b50034a -telaria.com, mb9eo-oqsbf, RESELLER, 1a4e959a1b50034a +sharethrough.com, 3a0f657b, DIRECT, d53b998a7bd4ecd2 +sharethrough.com, d09156e5, RESELLER, d53b998a7bd4ecd2 +smaato.com, 1100033117, RESELLER +smaato.com, 1100047713, RESELLER, 07bcf65f187117b4 +smaato.com,1100044650,RESELLER,07bcf65f187117b4 smartadserver.com, 3436, RESELLER -indexexchange.com, 191923, RESELLER -contextweb.com, 562350, RESELLER, 89ff185a4c4e857c -pubmatic.com, 160131, RESELLER, 5d62403b186f2ace -pubmatic.com, 160082 , RESELLER, 5d62403b186f2ace -newormedia.com, 4908, DIRECT -rhythmone.com,2310154583,DIRECT,a670c89d4a324e47 -video.unrulymedia.com, 2310154583, DIRECT -indexexchange.com, 193351, DIRECT -lijit.com, 217352-eb, DIRECT, fafdf38b16bf6b2b -appnexus.com, 1360, RESELLER, f5ab79cb980f11d1 -openx.com, 538959099, RESELLER, 6a698e2ec38604c6 -pubmatic.com, 137711, RESELLER, 5d62403b186f2ace -pubmatic.com, 156212, RESELLER, 5d62403b186f2ace -rubiconproject.com, 17960, RESELLER, 0bfd66d529a55807 -synacor.com, 82350, RESELLER, e108f11b2cdf7d5b -33across.com, 0014000001aXjnGAAS, RESELLER, bbea06d9c4d2853c # 33 Across -adtech.com, 12094, RESELLER # 33 Across -advangelists.com, 8d3bba7425e7c98c50f52ca1b52d3735, RESELLER, 60d26397ec060f98 # 33 Across -appnexus.com, 10239, RESELLER, f5ab79cb980f11d1 # 33 Across -emxdgt.com, 326, RESELLER, 1e1d41537f7cad7f # 33 Across -google.com, pub-9557089510405422, RESELLER, f08c47fec0942fa0 # 33 Across -gumgum.com, 13318, RESELLER, ffdef49475d318a9 # 33 Across -openx.com, 537120563, RESELLER, 6a698e2ec38604c6 # 33 Across -pubmatic.com, 156423, RESELLER, 5d62403b186f2ace # 33 Across -rhythmone.com, 2439829435, RESELLER, a670c89d4a324e47 # 33 Across -rubiconproject.com, 16414, RESELLER, 0bfd66d529a55807 # 33 Across -advertising.com, 19623, RESELLER # AOL - One -indexexchange.com, 183965, RESELLER, 50b1c356f2c5c8fc # AOL - One -pubmatic.com, 156084, RESELLER, 5d62403b186f2ace # AOL - One -pubmatic.com, 156325, RESELLER, 5d62403b186f2ace # AOL - One -pubmatic.com, 156458, RESELLER, 5d62403b186f2ace # AOL - One -rubiconproject.com, 18222, RESELLER, 0bfd66d529a55807 # AOL - One -appnexus.com, 9316, RESELLER, f5ab79cb980f11d1 # AppNexus -appnexus.com, 4052, RESELLER, f5ab79cb980f11d1 # Conversant -conversantmedia.com, 20923, RESELLER # Conversant -openx.com, 540031703, RESELLER, 6a698e2ec38604c6 # Conversant -appnexus.com, 1908, RESELLER, f5ab79cb980f11d1 # DistrictM -districtm.io, 101769, RESELLER, 3fd707be9c4527c3 # DistrictM -google.com, pub-9685734445476814, RESELLER, f08c47fec0942fa0 # DistrictM -engagebdr.com, 10417, RESELLER # EngageDBR -improvedigital.com, 1669, RESELLER # ImproveDigital -indexexchange.com, 191740, RESELLER, 50b1c356f2c5c8fc # Index -themediagrid.com, P5JONV, RESELLER, 35d5010d7789b49d # Media Grid (IPONWEB) -onetag.com, 572a470226457b8, RESELLER # OneTag -openx.com, 540401713, RESELLER, 6a698e2ec38604c6 # OpenX -pubmatic.com, 156344, RESELLER, 5d62403b186f2ace # Pubmatic -advertising.com, 28605, RESELLER # RhythmOne -appnexus.com, 6849, RESELLER, f5ab79cb980f11d1 # RhythmOne -indexexchange.com, 182257, RESELLER, 50b1c356f2c5c8fc # RhythmOne -pubmatic.com, 159277, RESELLER, 5d62403b186f2ace # RhythmOne -rhythmone.com, 905992537, RESELLER, a670c89d4a324e47 # RhythmOne -rubiconproject.com, 15268, RESELLER, 0bfd66d529a55807 # RhythmOne +sonobi.com, 337f0e70cc, DIRECT +sonobi.com, 37dd19ad4a, RESELLER, d1a215d9eb5aee9e +sonobi.com, 6e5cfb5420, DIRECT, d1a215d9eb5aee9e +sonobi.com, e55fb5d7c2, DIRECT, d1a215d9eb5aee9e +sovrn.com, 217352, DIRECT, fafdf38b16bf6b2b +sovrn.com, 248396, DIRECT, fafdf38b16bf6b2b +sovrn.com, 260380, RESELLER, fafdf38b16bf6b2b +sovrn.com, 270524, RESELLER, fafdf38b16bf6b2b +sovrn.com,217352,DIRECT,fafdf38b16bf6b2b +sparcmedia.com, 310627, Direct +spotx.tv, 108933, RESELLER, 7842df1d2fe2db34 +spotx.tv, 147949, RESELLER, 7842df1d2fe2db34 +spotx.tv, 212457, RESELLER +spotx.tv, 228454, RESELLER, 7842df1d2fe2db34 +spotx.tv, 270977, DIRECT, 7842df1d2fe2db34 spotx.tv, 285547, RESELLER, 7842df1d2fe2db34 # RhythmOne -spotxchange.com, 285547, RESELLER, 7842df1d2fe2db34 # RhythmOne -video.unrulymedia.com, 905992537, RESELLER, a670c89d4a324e47 # RhythmOne -rubiconproject.com, 13344, RESELLER, 0bfd66d529a55807 # Rubicon -spotx.tv, 94794, RESELLER, 7842df1d2fe2db34 # SpotX -spotxchange.com, 94794, RESELLER, 7842df1d2fe2db34 # SpotX -advertising.com, 8603, RESELLER # Taboola -aol.com, 53392, RESELLER # Taboola -freewheel.tv, 799841, RESELLER # Taboola -freewheel.tv, 799921, RESELLER # Taboola -pubmatic.com, 156307, RESELLER, 5d62403b186f2ace # Taboola -rhythmone.com, 1166984029, RESELLER, a670c89d4a324e47 # Taboola spotx.tv, 71451, RESELLER, 7842df1d2fe2db34 # Taboola +spotx.tv, 84294, RESELLER, 7842df1d2fe2db34 +spotx.tv, 94794, RESELLER, 7842df1d2fe2db34 # SpotX +spotxchange.com, 108933, RESELLER, 7842df1d2fe2db34 +spotxchange.com, 147949, RESELLER, 7842df1d2fe2db34 +spotxchange.com, 212457, RESELLER +spotxchange.com, 228454, RESELLER, 7842df1d2fe2db34 +spotxchange.com, 270977, DIRECT, 7842df1d2fe2db34 +spotxchange.com, 285547, RESELLER, 7842df1d2fe2db34 # RhythmOne spotxchange.com, 71451, RESELLER, 7842df1d2fe2db34 # Taboola +spotxchange.com, 84294, RESELLER, 7842df1d2fe2db34 +spotxchange.com, 94794, RESELLER, 7842df1d2fe2db34 # SpotX +springserve.com, 686, DIRECT, a24eb641fc82e93d +synacor.com, 82350, RESELLER, e108f11b2cdf7d5b +synacor.com,82151,reseller,e108f11b2cdf7d5b +teads.tv, 19014, DIRECT, 15a9c44f6d26cbe1 +telaria.com, mb9eo-oqsbf, RESELLER, 1a4e959a1b50034a +telaria.com, vtrdn-wjdav, DIRECT, 1a4e959a1b50034a +telaria.com, vtrdn-ysjam, DIRECT, 1a4e959a1b50034a +themediagrid.com, P5JONV, RESELLER, 35d5010d7789b49d # Media Grid (IPONWEB) +tremorhub.com, mb9eo-oqsbf, RESELLER, 1a4e959a1b50034a +tremorhub.com, vtrdn-wjdav, DIRECT, 1a4e959a1b50034a +tremorhub.com, vtrdn-ysjam, DIRECT, 1a4e959a1b50034a tremorhub.com, z87wm, RESELLER, 1a4e959a1b50034a # Taboola -aralego.com, par-488A3E6BD8D997D0ED8B3BD34D8BA4B, RESELLER # ucFunnel +triplelift.com, 7205, DIRECT, 6c33edb13117fd86 ucfunnel.com, par-488A3E6BD8D997D0ED8B3BD34D8BA4B, RESELLER # ucFunnel -yahoo.com, 55317, RESELLER # Verizon -pubnx.com, 337-1, RESELLER, 8728b7e97e589da4 # Vertoz -contextweb.com, 561118, RESELLER, 89ff185a4c4e857c #yieldmo -appnexus.com, 7911, RESELLER #yieldmo -rubiconproject.com, 17070, RESELLER, 0bfd66d529a55807 #yieldmo -pubnative.net, 1007284, RESELLER, d641df8625486a7b #yieldmodisplay -pubnative.net, 1007285, RESELLER, d641df8625486a7b #yieldmonative -pubnative.net, 1007286, RESELLER, d641df8625486a7b #yieldmovideo -onetag.com, 664e107d9f2b748, RESELLER #yieldmo -conversantmedia.com, 41812, DIRECT -appnexus.com, 4052, RESELLER -openx.com, 540031703, RESELLER, 6a698e2ec38604c6 -contextweb.com, 561998, RESELLER, 89ff185a4c4e857c -pubmatic.com, 158100, RESELLER, 5d62403b186f2ace +vertamedia.com, 287605, DIRECT, 7de89dc7742b5b11 +vertamedia.com, 287605, RESELLER, 7de89dc7742b5b11 +video.unrulymedia.com, 2310154583, DIRECT +video.unrulymedia.com, 905992537, RESELLER, a670c89d4a324e47 # RhythmOne yahoo.com, 55771, RESELLER, e1a5b5b6e3255540 -appnexus.com, 7118, RESELLER -spotx.tv, 108933, RESELLER, 7842df1d2fe2db34 -spotxchange.com, 108933, RESELLER, 7842df1d2fe2db34 -improvedigital.com, 185, RESELLER -adform.com, 183, RESELLER -freewheel.tv, 33081, RESELLER -freewheel.tv, 33601, RESELLER -google.com, pub-8172268348509349, RESELLER, f08c47fec0942fa0 -indexexchange.com, 189872, RESELLER -openx.com, 541159484, RESELLER, 6a698e2ec38604c6 -gumgum.com,13174,DIRECT,ffdef49475d318a9 -appnexus.com,1001,reseller,f5ab79cb980f11d1 -appnexus.com,2758,reseller,f5ab79cb980f11d1 -bidtellect.com,1407,reseller,1c34aa2d85d45e93 -contextweb.com,558355,reseller -openx.com,537149485,reseller,6a698e2ec38604c6 -google.com,pub-9557089510405422,reseller,f08c47fec0942fa0 -google.com,pub-3848273848634341,reseller,f08c47fec0942fa0 -rhythmone.com,78519861,reseller,a670c89d4a324e47 -appnexus.com,7597,reseller,f5ab79cb980f11d1 -33across.com,0013300001r0t9mAAA,reseller,bbea06d9c4d2853c -appnexus.com,10239,reseller,f5ab79cb980f11d1 -pubmatic.com,157897,reseller,5d62403b186f2ace -synacor.com,82151,reseller,e108f11b2cdf7d5b -appnexus.com,9316,reseller,f5ab79cb980f11d1 -EMXDGT.com,1284,reseller,1e1d41537f7cad7f -appnexus.com,1356,reseller,f5ab79cb980f11d1 -outbrain.com,00254374f0c468f3b2732db17fd42cb6e5,reseller -aps.amazon.com,2840f06c-5d89-4853-a03e-3bfa567dd33c,reseller -adtech.com, 10947, DIRECT, e1a5b5b6e3255540 -appnexus.com, 7556, DIRECT, f5ab79cb980f11d1 -emxdgt.com, 20, DIRECT, 1e1d41537f7cad7f -indexexchange.com, 184914, DIRECT, 50b1c356f2c5c8fc -indexexchange.com, 186248, DIRECT, 50b1c356f2c5c8fc -lijit.com, 248396, DIRECT, fafdf38b16bf6b2b -openx.com, 537150004, DIRECT, 6a698e2ec38604c6 -pubmatic.com, 156319, DIRECT, 5d62403b186f2ace -sonobi.com, e55fb5d7c2, DIRECT, d1a215d9eb5aee9e -sovrn.com, 248396, DIRECT, fafdf38b16bf6b2b -tremorhub.com, vtrdn-wjdav, DIRECT, 1a4e959a1b50034a -rubiconproject.com, 17632, DIRECT, 0bfd66d529a55807 -openx.com, 539699341, DIRECT, 6a698e2ec38604c6 -rubiconproject.com, 18890, DIRECT, 0bfd66d529a55807 -pubmatic.com, 157367, DIRECT, 5d62403b186f2ace -indexexchange.com, 187454, DIRECT, 50b1c356f2c5c8fc -consumable.com, 2000908, DIRECT, aefcd3d2f45b5070 -sonobi.com, 6e5cfb5420, DIRECT, d1a215d9eb5aee9e -advertising.com, 28409, DIRECT, e1a5b5b6e3255540 -spotxchange.com, 270977, DIRECT, 7842df1d2fe2db34 -spotx.tv, 270977, DIRECT, 7842df1d2fe2db34 -telaria.com, vtrdn-wjdav, DIRECT, 1a4e959a1b50034a -lijit.com, 248396-eb, DIRECT, fafdf38b16bf6b2b -advertising.com, 28509, DIRECT, e1a5b5b6e3255540 yahoo.com, 55104, DIRECT, e1a5b5b6e3255540 -pubmatic.com, 159117, DIRECT, 5d62403b186f2ace -tremorhub.com, vtrdn-ysjam, DIRECT, 1a4e959a1b50034a -telaria.com, vtrdn-ysjam, DIRECT, 1a4e959a1b50034a +yahoo.com, 55317, RESELLER # Verizon +yahoo.com, 57289, RESELLER, e1a5b5b6e3255540 yahoo.com, 57695, DIRECT, e1a5b5b6e3255540 +yahoo.com,55029,RESELLER,e1a5b5b6e3255540 +yieldmo.com, 2417496099628458357, DIRECT From ea10fc92c547a9194330611f34a680cdef94aa7e Mon Sep 17 00:00:00 2001 From: Matheus Felipe <50463866+matheusfelipeog@users.noreply.github.com> Date: Sat, 20 Feb 2021 18:51:09 -0300 Subject: [PATCH 092/115] Update examples to Python 3 in structure section --- docs/writing/structure.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst index 69c9cf616..5d9645acd 100644 --- a/docs/writing/structure.rst +++ b/docs/writing/structure.rst @@ -788,7 +788,7 @@ compute x + 1, you have to create another integer and give it a name. my_list = [1, 2, 3] my_list[0] = 4 - print my_list # [4, 2, 3] <- The same list has changed + print(my_list) # [4, 2, 3] <- The same list has changed x = 6 x = x + 1 # The new x is another object @@ -822,7 +822,7 @@ most idiomatic way to do this. nums = "" for n in range(20): nums += str(n) # slow and inefficient - print nums + print(nums) **Better** @@ -832,7 +832,7 @@ most idiomatic way to do this. nums = [] for n in range(20): nums.append(str(n)) - print "".join(nums) # much more efficient + print("".join(nums)) # much more efficient **Best** @@ -840,7 +840,7 @@ most idiomatic way to do this. # create a concatenated string from 0 to 19 (e.g. "012..1819") nums = [str(n) for n in range(20)] - print "".join(nums) + print("".join(nums)) One final thing to mention about strings is that using ``join()`` is not always best. In the instances where you are creating a new string from a pre-determined From 9c2d09dfcdc908443f494a512a6e83ce5a4a1a97 Mon Sep 17 00:00:00 2001 From: Matheus Felipe <50463866+matheusfelipeog@users.noreply.github.com> Date: Mon, 22 Feb 2021 19:25:31 -0300 Subject: [PATCH 093/115] Upd to python 3 in explicit code section --- docs/writing/style.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 3bf029911..718a6b4dd 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -65,9 +65,9 @@ it is bad practice to have two disjointed statements on the same line of code. .. code-block:: python - print 'one'; print 'two' + print('one'); print('two') - if x == 1: print 'one' + if x == 1: print('one') if and : # do something @@ -76,11 +76,11 @@ it is bad practice to have two disjointed statements on the same line of code. .. code-block:: python - print 'one' - print 'two' + print('one') + print('two') if x == 1: - print 'one' + print('one') cond1 = cond2 = From ed755c1e6328589ef04be91c8dbb3e068be159d5 Mon Sep 17 00:00:00 2001 From: Matheus Felipe <50463866+matheusfelipeog@users.noreply.github.com> Date: Mon, 22 Feb 2021 19:35:31 -0300 Subject: [PATCH 094/115] Change xrange function to range function --- docs/writing/style.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 718a6b4dd..cd62d81f4 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -357,9 +357,7 @@ Instead, use a list comprehension: .. code-block:: python - four_lists = [[] for __ in xrange(4)] - -Note: Use range() instead of xrange() in Python 3. + four_lists = [[] for __ in range(4)] Create a string from a list ~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 5796581b4fbd581052601b3de9fef42755e64805 Mon Sep 17 00:00:00 2001 From: Matheus Felipe <50463866+matheusfelipeog@users.noreply.github.com> Date: Mon, 22 Feb 2021 19:47:10 -0300 Subject: [PATCH 095/115] Upd of print func to py3 syntax in conventions section --- docs/writing/style.rst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/writing/style.rst b/docs/writing/style.rst index cd62d81f4..9858112de 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -582,10 +582,10 @@ list of what is considered false. .. code-block:: python if attr == True: - print 'True!' + print('True!') if attr == None: - print 'attr is None!' + print('attr is None!') **Good**: @@ -593,15 +593,15 @@ list of what is considered false. # Just check the value if attr: - print 'attr is truthy!' + print('attr is truthy!') # or check for the opposite if not attr: - print 'attr is falsey!' + print('attr is falsey!') # or, since None is considered false, explicitly check for it if attr is None: - print 'attr is None!' + print('attr is None!') Access a Dictionary Element ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -615,9 +615,9 @@ or pass a default argument to :py:meth:`dict.get`. d = {'hello': 'world'} if d.has_key('hello'): - print d['hello'] # prints 'world' + print(d['hello']) # prints 'world' else: - print 'default_value' + print('default_value') **Good**: @@ -625,12 +625,12 @@ or pass a default argument to :py:meth:`dict.get`. d = {'hello': 'world'} - print d.get('hello', 'default_value') # prints 'world' - print d.get('thingy', 'default_value') # prints 'default_value' + print(d.get('hello', 'default_value')) # prints 'world' + print(d.get('thingy', 'default_value')) # prints 'default_value' # Or: if 'hello' in d: - print d['hello'] + print(d['hello']) Short Ways to Manipulate Lists ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -781,7 +781,7 @@ Use :py:func:`enumerate` keep a count of your place in the list. a = [3, 4, 5] for i, item in enumerate(a): - print i, item + print(i, item) # prints # 0 3 # 1 4 @@ -802,7 +802,7 @@ files for you. f = open('file.txt') a = f.read() - print a + print(a) f.close() **Good**: @@ -811,7 +811,7 @@ files for you. with open('file.txt') as f: for line in f: - print line + print(line) The ``with`` statement is better because it will ensure you always close the file, even if an exception is raised inside the ``with`` block. From ed39c488ffb3aabb00525ea82715b7e163b312b0 Mon Sep 17 00:00:00 2001 From: Matheus Felipe <50463866+matheusfelipeog@users.noreply.github.com> Date: Mon, 22 Feb 2021 20:05:12 -0300 Subject: [PATCH 096/115] Upd of print func to py3 syntax --- docs/scenarios/scrape.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scenarios/scrape.rst b/docs/scenarios/scrape.rst index 3c7493f42..54747b295 100644 --- a/docs/scenarios/scrape.rst +++ b/docs/scenarios/scrape.rst @@ -87,8 +87,8 @@ Let's see what we got exactly: .. code-block:: python - print 'Buyers: ', buyers - print 'Prices: ', prices + print('Buyers: ', buyers) + print('Prices: ', prices) :: From ebb2a21a6500977494313bfda47b950f489acef7 Mon Sep 17 00:00:00 2001 From: Matheus Felipe <50463866+matheusfelipeog@users.noreply.github.com> Date: Mon, 22 Feb 2021 20:17:53 -0300 Subject: [PATCH 097/115] Upd of print func to py3 syntax --- docs/scenarios/speed.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst index e99b18f4e..e178efb63 100644 --- a/docs/scenarios/speed.rst +++ b/docs/scenarios/speed.rst @@ -176,17 +176,17 @@ What's the difference in speed? Let's try it! #primes implemented with Python import primes - print "Cython:" + print("Cython:") t1= time.time() - print primesCy.primes(500) + print(primesCy.primes(500)) t2= time.time() - print "Cython time: %s" %(t2-t1) - print "" - print "Python" + print("Cython time: %s" %(t2-t1)) + print("") + print("Python") t1= time.time() - print primes.primes(500) + print(primes.primes(500)) t2= time.time() - print "Python time: %s" %(t2-t1) + print("Python time: %s" %(t2-t1)) These lines both need a remark: From 727edfedf20c47e99c59f855a8366a336dc3b02b Mon Sep 17 00:00:00 2001 From: Dan Bader Date: Tue, 23 Feb 2021 09:10:29 -0800 Subject: [PATCH 098/115] Code formatting cleanup --- docs/scenarios/speed.rst | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst index e178efb63..5dc0cd845 100644 --- a/docs/scenarios/speed.rst +++ b/docs/scenarios/speed.rst @@ -168,25 +168,23 @@ What's the difference in speed? Let's try it! .. code-block:: python import time - #activate pyx compiler + # Activate pyx compiler import pyximport - pyximport.install() - #primes implemented with Cython - import primesCy - #primes implemented with Python - import primes + pyximport.install() + import primesCy # primes implemented with Cython + import primes # primes implemented with Python print("Cython:") - t1= time.time() + t1 = time.time() print(primesCy.primes(500)) - t2= time.time() - print("Cython time: %s" %(t2-t1)) + t2 = time.time() + print("Cython time: %s" % (t2 - t1)) print("") print("Python") - t1= time.time() + t1 = time.time() print(primes.primes(500)) - t2= time.time() - print("Python time: %s" %(t2-t1)) + t2 = time.time() + print("Python time: %s" % (t2 - t1)) These lines both need a remark: From 4050adc9cb2657a7139a04e892501c77e303ae49 Mon Sep 17 00:00:00 2001 From: trk9001 Date: Tue, 4 May 2021 19:54:28 +0600 Subject: [PATCH 099/115] Update gpip function to use explicit false value This commit fixes #1099. See that issue for more details. --- docs/dev/pip-virtualenv.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/pip-virtualenv.rst b/docs/dev/pip-virtualenv.rst index ee223078e..667f30c7a 100644 --- a/docs/dev/pip-virtualenv.rst +++ b/docs/dev/pip-virtualenv.rst @@ -79,7 +79,7 @@ adding the following to your :file:`~/.bashrc` file: .. code-block:: console gpip() { - PIP_REQUIRE_VIRTUALENV="" pip "$@" + PIP_REQUIRE_VIRTUALENV=false pip "$@" } After saving the changes and sourcing your :file:`~/.bashrc` file you can now From e591eca8dc263d6568850ac0243222e744d9da68 Mon Sep 17 00:00:00 2001 From: Ilya Shubkin Date: Thu, 13 May 2021 07:48:27 +0100 Subject: [PATCH 100/115] docs: fix Expert Python Programming book link --- docs/intro/learning.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst index c6d534549..b0c957398 100644 --- a/docs/intro/learning.rst +++ b/docs/intro/learning.rst @@ -253,7 +253,7 @@ and eventually an application, including a chapter on using zc.buildout. Later chapters detail best practices such as writing documentation, test-driven development, version control, optimization, and profiling. - `Expert Python Programming `_ + `Expert Python Programming `_ A Guide to Python's Magic Methods From 6cc16258bdc75d5bad4c155359c7fc18f51cfa6d Mon Sep 17 00:00:00 2001 From: Dan Bader Date: Tue, 13 Jul 2021 12:06:22 -0700 Subject: [PATCH 101/115] Fix Netlify build --- runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime.txt b/runtime.txt index d70c8f8d8..5a958026d 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -3.6 +3.5 From 0c8dfb2a7c07407f7aed2165abbb98bebb13be72 Mon Sep 17 00:00:00 2001 From: Dan Bader Date: Tue, 13 Jul 2021 12:08:42 -0700 Subject: [PATCH 102/115] Fix Netlify build --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c2886a7fe..4a246ac76 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ docutils==0.14 idna==2.7 imagesize==1.0.0 Jinja2==2.10 -MarkupSafe==1.0 +MarkupSafe==1.1.1 packaging==17.1 Pygments==2.2.0 pyparsing==2.2.0 From d047f536fedf2e4e7ab7d3c45e8b450a46f5c6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=C3=A1n=20Maureira-Fredes?= Date: Tue, 5 Oct 2021 23:07:02 +0200 Subject: [PATCH 103/115] Update PySide entry --- docs/scenarios/gui.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst index 1b0ffb427..3ad0af364 100644 --- a/docs/scenarios/gui.rst +++ b/docs/scenarios/gui.rst @@ -79,12 +79,15 @@ PySide ****** PySide is a Python binding of the cross-platform GUI toolkit Qt. +The package name depends on the major Qt version (`PySide` for Qt4, +`PySide2` for Qt5, and `PySide6` for Qt6). +This set of bindings is developed by `The Qt Company `_. .. code-block:: console - $ pip install pyside + $ pip install pyside6 -https://wiki.qt.io/Category:LanguageBindings::PySide::Downloads +https://pyside.org **** From 4eedae744f5a5bd8edc5b5edd021e9e49a68a653 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Sun, 26 Dec 2021 16:57:36 +0000 Subject: [PATCH 104/115] Replacing Tablib fork with the original repo Link currently points to a tablib fork and not to the original repo (https://github.com/jazzband/tablib). Fork doesn't look maintained and is behind the original repo Changing link to use https://github.com/jazzband/tablib --- docs/writing/reading.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/writing/reading.rst b/docs/writing/reading.rst index ad67ea3cb..1e03a4def 100644 --- a/docs/writing/reading.rst +++ b/docs/writing/reading.rst @@ -43,7 +43,7 @@ reading. Each one of these projects is a paragon of Python coding. Requests is an Apache2 Licensed HTTP library, written in Python, for human beings. -- `Tablib `_ +- `Tablib `_ Tablib is a format-agnostic tabular dataset library, written in Python. From 8e7087b41b42609837ed3484732f450c68e86edc Mon Sep 17 00:00:00 2001 From: Thomas Severin Date: Mon, 25 Apr 2022 10:05:30 +0200 Subject: [PATCH 105/115] Code refactoring and wording improvements. --- docs/scenarios/admin.rst | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index 07d263945..236d08d2b 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -155,44 +155,42 @@ tests (net, CPU) fail, it will send an email. # Package for email services: import smtplib import string - MAX_NET_USAGE = 400000 + MAX_NET_USAGE = 400000 # bytes per seconds MAX_ATTACKS = 4 attack = 0 - counter = 0 while attack <= MAX_ATTACKS: sleep(4) - counter = counter + 1 - # Check the cpu usage - if cpu_percent(interval = 1) > 70: - attack = attack + 1 - # Check the net usage - neti1 = net_io_counters()[1] - neto1 = net_io_counters()[0] + + # Check the net usage wit named tuples + neti1 = net_io_counters().bytes_recv + neto1 = net_io_counters().bytes_sent sleep(1) - neti2 = net_io_counters()[1] - neto2 = net_io_counters()[0] + neti2 = net_io_counters().bytes_recv + neto2 = net_io_counters().bytes_sent + # Calculate the bytes per second net = ((neti2+neto2) - (neti1+neto1))/2 - if net > MAX_NET_USAGE: - attack = attack + 1 - if counter > 25: - attack = 0 - counter = 0 + + # Check the net and cpu usage + if (net > MAX_NET_USAGE) or (cpu_percent(interval = 1) > 70): + attack+=1 + elif attack > 1: + attack-=1 + # Write a very important email if attack is higher than 4 TO = "you@your_email.com" FROM = "webmaster@your_domain.com" SUBJECT = "Your domain is out of system resources!" text = "Go and fix your server!" - BODY = string.join(("From: %s" %FROM,"To: %s" %TO,"Subject: %s" %SUBJECT, "",text), "\r\n") + string="\r\n" + BODY = string.join(("From: %s" %FROM,"To: %s" %TO, + "Subject: %s" %SUBJECT, "",text)) server = smtplib.SMTP('127.0.0.1') server.sendmail(FROM, [TO], BODY) server.quit() -A full terminal application like a widely extended top which is based on -psutil and with the ability of a client-server monitoring is -`glance `_. - +A full terminal application like a widely extended top is glance, which is based on psutil and has the ability for client-server monitoring. ******* Ansible From 69580b1179e64da6dca20215aeaf0257e044f369 Mon Sep 17 00:00:00 2001 From: Thomas S Date: Wed, 27 Apr 2022 18:34:21 +0200 Subject: [PATCH 106/115] Broken link to Glance --- docs/scenarios/admin.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index 236d08d2b..f70268fa9 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -190,7 +190,7 @@ tests (net, CPU) fail, it will send an email. server.quit() -A full terminal application like a widely extended top is glance, which is based on psutil and has the ability for client-server monitoring. +A full terminal application like a widely extended top is `glance `_, which is based on psutil and has the ability for client-server monitoring. ******* Ansible From 536b08fc804eb9af246a3e707aafb951a3cc14c1 Mon Sep 17 00:00:00 2001 From: Thomas S Date: Wed, 27 Apr 2022 18:34:46 +0200 Subject: [PATCH 107/115] Broken link to Glance --- docs/scenarios/admin.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index f70268fa9..73df990d7 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -190,7 +190,7 @@ tests (net, CPU) fail, it will send an email. server.quit() -A full terminal application like a widely extended top is `glance `_, which is based on psutil and has the ability for client-server monitoring. +A full terminal application like a widely extended top is `Glance `_, which is based on psutil and has the ability for client-server monitoring. ******* Ansible From 32db4ae8e27ccc1b2c5a3099166add1543671819 Mon Sep 17 00:00:00 2001 From: Max Weiner Date: Thu, 16 Jun 2022 07:44:27 +0200 Subject: [PATCH 108/115] add section for xmlschema --- docs/scenarios/xml.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/scenarios/xml.rst b/docs/scenarios/xml.rst index 3bdf15b6c..24dab5869 100644 --- a/docs/scenarios/xml.rst +++ b/docs/scenarios/xml.rst @@ -81,3 +81,30 @@ and then you can access elements, attributes, and values like this: xmltodict also lets you roundtrip back to XML with the unparse function, has a streaming mode suitable for handling files that don't fit in memory, and supports XML namespaces. + +********** +xmlschema +********** + +`xmlschema `_ provides support for using XSD-Schemas in Python. +Unlike other XML libraries, automatic type parsing is available, so f.e. if the schema defines an element to be of type ``int``, the parsed ``dict`` will contain also an ``int`` value for that element. +Moreover the library supports automatic and explicit validation of XML documents against a schema. + +.. code-block:: python + + from xmlschema import XMLSchema, etree_tostring + + # load a XSD schema file + schema = XMLSchema("your_schema.xsd") + + # validate against the schema + schema.validate("your_file.xml") + + # or + schema.is_valid("your_file.xml") + + # decode a file + data = schmema.decode("your_file.xml") + + # encode to string + s = etree_tostring(schema.encode(data)) From 20b4160bf8424d881c007b320a3f65d2289c9b14 Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Fri, 17 Jun 2022 11:43:46 -0600 Subject: [PATCH 109/115] Update Requests documentation links --- docs/dev/virtualenvs.rst | 2 +- docs/scenarios/client.rst | 2 +- docs/scenarios/scrape.rst | 2 +- docs/writing/style.rst | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index b4591e43b..fe6bd3f9e 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -156,7 +156,7 @@ when you share your project with others. You should get output similar to this Adding requests to Pipfile's [packages]... P.S. You have excellent taste! ✨ 🍰 ✨ -.. _Requests: http://docs.python-requests.org/en/master/ +.. _Requests: https://requests.readthedocs.io/en/latest/ Using installed packages diff --git a/docs/scenarios/client.rst b/docs/scenarios/client.rst index 1457fa479..c2d5c289b 100644 --- a/docs/scenarios/client.rst +++ b/docs/scenarios/client.rst @@ -28,7 +28,7 @@ your URLs, or to form-encode your POST data. Keep-alive and HTTP connection pooling are 100% automatic, powered by urllib3, which is embedded within Requests. -- `Documentation `_ +- `Documentation `_ - `PyPi `_ - `GitHub `_ diff --git a/docs/scenarios/scrape.rst b/docs/scenarios/scrape.rst index 54747b295..527719200 100644 --- a/docs/scenarios/scrape.rst +++ b/docs/scenarios/scrape.rst @@ -28,7 +28,7 @@ lxml and Requests `lxml `_ is a pretty extensive library written for parsing XML and HTML documents very quickly, even handling messed up tags in the process. We will also be using the -`Requests `_ module instead of the +`Requests `_ module instead of the already built-in urllib2 module due to improvements in speed and readability. You can easily install both using ``pip install lxml`` and ``pip install requests``. diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 9858112de..d8c096a05 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -465,8 +465,7 @@ easy-to-read version of PEP 8 is also available at `pep8.org ` This is highly recommended reading. The entire Python community does their best to adhere to the guidelines laid out within this document. Some project -may sway from it from time to time, while others may -`amend its recommendations `_. +may sway from it from time to time, while others may amend its recommendations. That being said, conforming your Python code to PEP 8 is generally a good idea and helps make code more consistent when working on projects with other From 44630bbe9b3353e3b6bac125cbb4530f72fb00a7 Mon Sep 17 00:00:00 2001 From: Howie Zhao Date: Sun, 28 Aug 2022 12:35:00 +0800 Subject: [PATCH 110/115] Update osx.rst --- docs/starting/install3/osx.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst index 37252d615..6e3f09057 100644 --- a/docs/starting/install3/osx.rst +++ b/docs/starting/install3/osx.rst @@ -9,9 +9,9 @@ Installing Python 3 on Mac OS X .. image:: /_static/photos/34435689480_2e6f358510_k_d.jpg -**Mac OS X comes with Python 2.7 out of the box.** +**Mac OS X comes with Python 2.7 out of the box between versions 10.8 and 12.3.** -You do not need to install or configure anything else to use Python 2. These +If your Mac OS X version is between the above versions, you do not need to install or configure anything else to use Python 2. These instructions document the installation of Python 3. The version of Python that ships with OS X is great for learning, but it's not From d03633e5d62acfee6060430f5e763e3d69d29d0f Mon Sep 17 00:00:00 2001 From: Howie Zhao Date: Sun, 28 Aug 2022 12:38:04 +0800 Subject: [PATCH 111/115] Update osx.rst --- docs/starting/install/osx.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst index d0aa601aa..4a8a8e03b 100644 --- a/docs/starting/install/osx.rst +++ b/docs/starting/install/osx.rst @@ -10,9 +10,10 @@ Installing Python 2 on Mac OS X .. note:: Check out our :ref:`guide for installing Python 3 on OS X`. -**Mac OS X comes with Python 2.7 out of the box.** +**Mac OS X comes with Python 2.7 out of the box between versions 10.8 and 12.3.** -You do not need to install or configure anything else to use Python. Having said +If your Mac OS X version is between the above versions, +you do not need to install or configure anything else to use Python. Having said that, I would strongly recommend that you install the tools and libraries described in the next section before you start building Python applications for real-world use. In particular, you should always install Setuptools, as it makes From 2935d8f4f7255fa1ad81b06eda2c800f82b9a2f1 Mon Sep 17 00:00:00 2001 From: Howie Zhao Date: Sun, 28 Aug 2022 12:38:33 +0800 Subject: [PATCH 112/115] Update osx.rst --- docs/starting/install3/osx.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst index 6e3f09057..fa90fb93a 100644 --- a/docs/starting/install3/osx.rst +++ b/docs/starting/install3/osx.rst @@ -11,7 +11,8 @@ Installing Python 3 on Mac OS X **Mac OS X comes with Python 2.7 out of the box between versions 10.8 and 12.3.** -If your Mac OS X version is between the above versions, you do not need to install or configure anything else to use Python 2. These +If your Mac OS X version is between the above versions, +you do not need to install or configure anything else to use Python 2. These instructions document the installation of Python 3. The version of Python that ships with OS X is great for learning, but it's not From f70533e75f03cd6d45d3ec113705a16c493be529 Mon Sep 17 00:00:00 2001 From: Dan Bader Date: Wed, 2 Nov 2022 18:30:56 -0700 Subject: [PATCH 113/115] Update runtime.txt --- runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime.txt b/runtime.txt index 5a958026d..cc1923a40 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -3.5 +3.8 From 4f0ee6998c3c3d27b316bb9356896a18c8e51d63 Mon Sep 17 00:00:00 2001 From: fa064972 Date: Sun, 16 Jun 2024 22:26:05 +0530 Subject: [PATCH 114/115] updated the broken links of opencv and PIL readthedocs site --- docs/scenarios/imaging.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scenarios/imaging.rst b/docs/scenarios/imaging.rst index 7b0e71935..8fe7e08fe 100644 --- a/docs/scenarios/imaging.rst +++ b/docs/scenarios/imaging.rst @@ -62,7 +62,7 @@ Example exif_data There are more examples of the Pillow library in the -`Pillow tutorial `_. +`Pillow tutorial `_. *************************** @@ -109,4 +109,4 @@ Example There are more Python-implemented examples of OpenCV in this `collection of tutorials -`_. +`_. From 64ac5ceb88f20537c8c5c26cbcbb15f1ca56623f Mon Sep 17 00:00:00 2001 From: d9pouces Date: Thu, 20 Jun 2024 22:34:50 +0200 Subject: [PATCH 115/115] fix: remove Shinken from the admin part, because Shinken is dead (last version 8 years ago) --- docs/scenarios/admin.rst | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index 73df990d7..f6433c213 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -395,17 +395,3 @@ up. Buildout is primarily used to download and set up dependencies in `Python eggs `_ format of the software being developed or deployed. Recipes for build tasks in any environment can be created, and many are already available. - - -******* -Shinken -******* - -`Shinken `_ is a modern, Nagios compatible -monitoring framework written in Python. Its main goal is to give users a flexible -architecture for their monitoring system that is designed to scale to large -environments. - -Shinken is backwards-compatible with the Nagios configuration standard and -plugins. It works on any operating system and architecture that supports Python, -which includes Windows, Linux, and FreeBSD.