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/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. 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/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 -`_. +`_. 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/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)) 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 diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst index 37252d615..fa90fb93a 100644 --- a/docs/starting/install3/osx.rst +++ b/docs/starting/install3/osx.rst @@ -9,9 +9,10 @@ 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 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 diff --git a/runtime.txt b/runtime.txt index 5a958026d..cc1923a40 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -3.5 +3.8