===================
plaster_pastedeploy
===================
.. image:: https://img.shields.io/pypi/v/plaster_pastedeploy.svg
:target: https://pypi.python.org/pypi/plaster_pastedeploy
.. image:: https://github.com/Pylons/plaster_pastedeploy/workflows/Build%20and%20test/badge.svg?branch=master
:target: https://github.com/Pylons/plaster_pastedeploy/actions?query=workflow%3A%22Build+and+test%22
:alt: master CI Status
``plaster_pastedeploy`` is a plaster_ plugin that provides a ``plaster.Loader``
that can parse ini files according to the standard set by PasteDeploy_. It
supports the ``wsgi`` plaster protocol, implementing the
``plaster.protocols.IWSGIProtocol`` interface.
Usage
=====
Applications should use ``plaster_pastedeploy`` to load settings from named
sections in a configuration source (usually a file).
- Please look at the documentation for plaster_ on how to integrate this
loader into your application.
- Please look at the documentation for PasteDeploy_ on the specifics of the
supported INI file format.
Most applications will want to use
``plaster.get_loader(uri, protocols=['wsgi'])`` to get this loader. It then
exposes ``get_wsgi_app``, ``get_wsgi_app_settings``, ``get_wsgi_filter`` and
``get_wsgi_server``.
.. code-block:: python
import plaster
loader = plaster.get_loader('development.ini', protocols=['wsgi'])
# to get any section out of the config file
settings = loader.get_settings('app:main')
# to get settings for a WSGI app
app_config = loader.get_wsgi_app_settings() # defaults to main
# to get an actual WSGI app
app = loader.get_wsgi_app() # defaults to main
# to get a filter and compose it with an app
filter = loader.get_wsgi_filter('filt')
app = filter(app)
# to get a WSGI server
server = loader.get_wsgi_server() # defaults to main
# to start the WSGI server
server(app)
Any ``plaster.PlasterURL`` options are forwarded as defaults to the loader.
Some examples are below:
- ``development.ini#myapp``
- ``development.ini?http_port=8080#main``
- ``pastedeploy+ini:///path/to/development.ini``
- ``pastedeploy+ini://development.ini#foo``
- ``egg:MyApp?debug=false#foo``
.. _PasteDeploy: https://pastedeploy.readthedocs.io/en/latest/
.. _plaster: https://docs.pylonsproject.org/projects/plaster/en/latest/
1.0.1 (2022-11-06)
==================
- Minor release to cleanup README.
1.0 (2022-11-06)
================
- Drop support for Python 2.7, 3.4, 3.5, 3.6.
- Add support for Python 3.8, 3.9, 3.10.
- Blackify the codebase.
- Switch CI to Github Actions.
0.7 (2019-04-12)
================
- Support Python 3.7.
- Depend on ``pastedeploy >= 2.0`` to enforce new behavior when overriding
defaults. Default values passed into the loader will now override values in
the ``[DEFAULT]`` section.
See https://github.com/Pylons/plaster_pastedeploy/pull/17
0.6 (2018-07-11)
================
- Change ``setup_logging`` to invoke ``logging.config.fileConfig`` with
``disable_existing_loggers=False`` to avoid disabling any loggers that were
imported prior to configuration of the logging system.
See https://github.com/Pylons/plaster_pastedeploy/pull/16
0.5 (2018-03-29)
================
- Removed environment variable support entirely for now. The feature requires
bugfixes upstream in PasteDeploy which have not been done yet and this was
breaking people's environments so it is gone for now.
See https://github.com/Pylons/plaster_pastedeploy/pull/15
0.4.2 (2017-11-20)
==================
- Fix ``ConfigDict.copy`` so that it works.
See https://github.com/Pylons/plaster_pastedeploy/pull/14
0.4.1 (2017-07-10)
==================
- Disable environment variable support on Python 2. PasteDeploy does not
support escaping the contents on Python 2 which means any variable with
a value of the format %(foo)s would break the parser. Because this is
implicit behavior it was deemed too error prone to support.
See https://github.com/Pylons/plaster_pastedeploy/pull/10
- Escape environment variables such that their contents are not subject to
interpolation. See https://github.com/Pylons/plaster_pastedeploy/pull/10
- Invoke ``logging.basicConfig`` when ``setup_logging`` is called and the
config file doesn't contain any logging setup or the URI is using the
``egg:`` protocol. See https://github.com/Pylons/plaster_pastedeploy/pull/11
0.4 (2017-07-09)
================
- Fix ``get_settings`` for an arbitrary section to follow the same rules as
PasteDeploy with regards to the handling of defaults. The goal of this
package is to be compliant with PasteDeploy's format for all sections in
the file such that there are no surprising format changes in various
sections.
Supported added for ``set default_foo = bar`` and ``get foo = default_foo``
syntax to override a default value and to pull a default value into the
settings, respectively. In the above example the value ``foo = bar`` would
be returned. Any other defaults not pulled into the section via either
interpolation or the ``get`` syntax will be ignored.
See https://github.com/Pylons/plaster_pastedeploy/pull/6
- Inject environment variables into the defaults automatically. These will
be available for interpolation as ``ENV_<foo>``. For example if environment
variable ``APP_DEBUG=true`` then ``%(ENV_APP_DEBUG)s`` will work within the
ini file. See https://github.com/Pylons/plaster_pastedeploy/pull/7
- ``get_settings`` and ``get_wsgi_app_settings`` both return only the local
config now. However, the returned object has a ``global_conf`` attribute
containing the defaults as well as a ``loader`` attribute pointing at
the loader instance.
See https://github.com/Pylons/plaster_pastedeploy/pull/8
0.3.2 (2017-07-01)
==================
- Resolve an issue in which ``NoSectionError`` would not be properly caught on
Python 2.7 if the ``configparser`` module was installed from PyPI.
See https://github.com/Pylons/plaster_pastedeploy/issues/5
0.3.1 (2017-06-02)
==================
- Recognize the ``pastedeploy+egg`` scheme as an ``egg`` type.
0.3 (2017-06-02)
================
- Drop the ``ini`` scheme and replace with ``file+ini`` and ``pastedeploy``.
Also rename ``ini+pastedeploy`` and ``egg+pastedeploy`` to
``pastedeploy+ini`` and ``pastedeploy+egg`` respectively.
See https://github.com/Pylons/plaster_pastedeploy/pull/4
0.2.1 (2017-03-29)
==================
- Fix a bug in 0.2 in which an exception was raised for an invalid section
if the a non-config-file-based protocol was used.
0.2 (2017-03-29)
================
- No longer raise ``plaster.NoSectionError`` exceptions. Empty dictionaries
are returned for missing sections and a user should check ``get_sections``
for the list of valid sections.
0.1 (2017-03-27)
================
- Initial release.
Raw data
{
"_id": null,
"home_page": "https://github.com/Pylons/plaster_pastedeploy",
"name": "plaster-pastedeploy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "plaster,pastedeploy,plaster_pastedeploy,ini,config,egg",
"author": "Hunter Senft-Grupp",
"author_email": "pylons-discuss@googlegroups.com",
"download_url": "https://files.pythonhosted.org/packages/c7/af/01a22f73ce97c6375c88d7ceaf6f5f4f345e940da93c94f98833d898a449/plaster_pastedeploy-1.0.1.tar.gz",
"platform": null,
"description": "===================\nplaster_pastedeploy\n===================\n\n.. image:: https://img.shields.io/pypi/v/plaster_pastedeploy.svg\n :target: https://pypi.python.org/pypi/plaster_pastedeploy\n\n.. image:: https://github.com/Pylons/plaster_pastedeploy/workflows/Build%20and%20test/badge.svg?branch=master\n :target: https://github.com/Pylons/plaster_pastedeploy/actions?query=workflow%3A%22Build+and+test%22\n :alt: master CI Status\n\n``plaster_pastedeploy`` is a plaster_ plugin that provides a ``plaster.Loader``\nthat can parse ini files according to the standard set by PasteDeploy_. It\nsupports the ``wsgi`` plaster protocol, implementing the\n``plaster.protocols.IWSGIProtocol`` interface.\n\nUsage\n=====\n\nApplications should use ``plaster_pastedeploy`` to load settings from named\nsections in a configuration source (usually a file).\n\n- Please look at the documentation for plaster_ on how to integrate this\n loader into your application.\n\n- Please look at the documentation for PasteDeploy_ on the specifics of the\n supported INI file format.\n\nMost applications will want to use\n``plaster.get_loader(uri, protocols=['wsgi'])`` to get this loader. It then\nexposes ``get_wsgi_app``, ``get_wsgi_app_settings``, ``get_wsgi_filter`` and\n``get_wsgi_server``.\n\n.. code-block:: python\n\n import plaster\n\n loader = plaster.get_loader('development.ini', protocols=['wsgi'])\n # to get any section out of the config file\n settings = loader.get_settings('app:main')\n\n # to get settings for a WSGI app\n app_config = loader.get_wsgi_app_settings() # defaults to main\n\n # to get an actual WSGI app\n app = loader.get_wsgi_app() # defaults to main\n\n # to get a filter and compose it with an app\n filter = loader.get_wsgi_filter('filt')\n app = filter(app)\n\n # to get a WSGI server\n server = loader.get_wsgi_server() # defaults to main\n\n # to start the WSGI server\n server(app)\n\nAny ``plaster.PlasterURL`` options are forwarded as defaults to the loader.\nSome examples are below:\n\n- ``development.ini#myapp``\n\n- ``development.ini?http_port=8080#main``\n\n- ``pastedeploy+ini:///path/to/development.ini``\n\n- ``pastedeploy+ini://development.ini#foo``\n\n- ``egg:MyApp?debug=false#foo``\n\n.. _PasteDeploy: https://pastedeploy.readthedocs.io/en/latest/\n.. _plaster: https://docs.pylonsproject.org/projects/plaster/en/latest/\n\n1.0.1 (2022-11-06)\n==================\n\n- Minor release to cleanup README.\n\n1.0 (2022-11-06)\n================\n\n- Drop support for Python 2.7, 3.4, 3.5, 3.6.\n\n- Add support for Python 3.8, 3.9, 3.10.\n\n- Blackify the codebase.\n\n- Switch CI to Github Actions.\n\n0.7 (2019-04-12)\n================\n\n- Support Python 3.7.\n\n- Depend on ``pastedeploy >= 2.0`` to enforce new behavior when overriding\n defaults. Default values passed into the loader will now override values in\n the ``[DEFAULT]`` section.\n See https://github.com/Pylons/plaster_pastedeploy/pull/17\n\n0.6 (2018-07-11)\n================\n\n- Change ``setup_logging`` to invoke ``logging.config.fileConfig`` with\n ``disable_existing_loggers=False`` to avoid disabling any loggers that were\n imported prior to configuration of the logging system.\n See https://github.com/Pylons/plaster_pastedeploy/pull/16\n\n0.5 (2018-03-29)\n================\n\n- Removed environment variable support entirely for now. The feature requires\n bugfixes upstream in PasteDeploy which have not been done yet and this was\n breaking people's environments so it is gone for now.\n See https://github.com/Pylons/plaster_pastedeploy/pull/15\n\n0.4.2 (2017-11-20)\n==================\n\n- Fix ``ConfigDict.copy`` so that it works.\n See https://github.com/Pylons/plaster_pastedeploy/pull/14\n\n0.4.1 (2017-07-10)\n==================\n\n- Disable environment variable support on Python 2. PasteDeploy does not\n support escaping the contents on Python 2 which means any variable with\n a value of the format %(foo)s would break the parser. Because this is\n implicit behavior it was deemed too error prone to support.\n See https://github.com/Pylons/plaster_pastedeploy/pull/10\n\n- Escape environment variables such that their contents are not subject to\n interpolation. See https://github.com/Pylons/plaster_pastedeploy/pull/10\n\n- Invoke ``logging.basicConfig`` when ``setup_logging`` is called and the\n config file doesn't contain any logging setup or the URI is using the\n ``egg:`` protocol. See https://github.com/Pylons/plaster_pastedeploy/pull/11\n\n0.4 (2017-07-09)\n================\n\n- Fix ``get_settings`` for an arbitrary section to follow the same rules as\n PasteDeploy with regards to the handling of defaults. The goal of this\n package is to be compliant with PasteDeploy's format for all sections in\n the file such that there are no surprising format changes in various\n sections.\n\n Supported added for ``set default_foo = bar`` and ``get foo = default_foo``\n syntax to override a default value and to pull a default value into the\n settings, respectively. In the above example the value ``foo = bar`` would\n be returned. Any other defaults not pulled into the section via either\n interpolation or the ``get`` syntax will be ignored.\n\n See https://github.com/Pylons/plaster_pastedeploy/pull/6\n\n- Inject environment variables into the defaults automatically. These will\n be available for interpolation as ``ENV_<foo>``. For example if environment\n variable ``APP_DEBUG=true`` then ``%(ENV_APP_DEBUG)s`` will work within the\n ini file. See https://github.com/Pylons/plaster_pastedeploy/pull/7\n\n- ``get_settings`` and ``get_wsgi_app_settings`` both return only the local\n config now. However, the returned object has a ``global_conf`` attribute\n containing the defaults as well as a ``loader`` attribute pointing at\n the loader instance.\n See https://github.com/Pylons/plaster_pastedeploy/pull/8\n\n0.3.2 (2017-07-01)\n==================\n\n- Resolve an issue in which ``NoSectionError`` would not be properly caught on\n Python 2.7 if the ``configparser`` module was installed from PyPI.\n See https://github.com/Pylons/plaster_pastedeploy/issues/5\n\n0.3.1 (2017-06-02)\n==================\n\n- Recognize the ``pastedeploy+egg`` scheme as an ``egg`` type.\n\n0.3 (2017-06-02)\n================\n\n- Drop the ``ini`` scheme and replace with ``file+ini`` and ``pastedeploy``.\n Also rename ``ini+pastedeploy`` and ``egg+pastedeploy`` to\n ``pastedeploy+ini`` and ``pastedeploy+egg`` respectively.\n See https://github.com/Pylons/plaster_pastedeploy/pull/4\n\n0.2.1 (2017-03-29)\n==================\n\n- Fix a bug in 0.2 in which an exception was raised for an invalid section\n if the a non-config-file-based protocol was used.\n\n0.2 (2017-03-29)\n================\n\n- No longer raise ``plaster.NoSectionError`` exceptions. Empty dictionaries\n are returned for missing sections and a user should check ``get_sections``\n for the list of valid sections.\n\n0.1 (2017-03-27)\n================\n\n- Initial release.\n",
"bugtrack_url": null,
"license": "",
"summary": "A loader implementing the PasteDeploy syntax to be used by plaster.",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/Pylons/plaster_pastedeploy"
},
"split_keywords": [
"plaster",
"pastedeploy",
"plaster_pastedeploy",
"ini",
"config",
"egg"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bd302d4cf89035c22a89bf0e34dbc50fdc07c42c9bdc90fd972d495257ad2b6e",
"md5": "29c33baa01599cee7a7574505a2647f4",
"sha256": "ad3550cc744648969ed3b810f33c9344f515ee8d8a8cec18e8f2c4a643c2181f"
},
"downloads": -1,
"filename": "plaster_pastedeploy-1.0.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "29c33baa01599cee7a7574505a2647f4",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 7823,
"upload_time": "2022-11-07T01:23:03",
"upload_time_iso_8601": "2022-11-07T01:23:03.230572Z",
"url": "https://files.pythonhosted.org/packages/bd/30/2d4cf89035c22a89bf0e34dbc50fdc07c42c9bdc90fd972d495257ad2b6e/plaster_pastedeploy-1.0.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c7af01a22f73ce97c6375c88d7ceaf6f5f4f345e940da93c94f98833d898a449",
"md5": "79a05aadf9704ffae75e374715aaba4c",
"sha256": "be262e6d2e41a7264875daa2fe2850cbb0615728bcdc92828fdc72736e381412"
},
"downloads": -1,
"filename": "plaster_pastedeploy-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "79a05aadf9704ffae75e374715aaba4c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 20915,
"upload_time": "2022-11-07T01:23:05",
"upload_time_iso_8601": "2022-11-07T01:23:05.348112Z",
"url": "https://files.pythonhosted.org/packages/c7/af/01a22f73ce97c6375c88d7ceaf6f5f4f345e940da93c94f98833d898a449/plaster_pastedeploy-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-11-07 01:23:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Pylons",
"github_project": "plaster_pastedeploy",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "plaster-pastedeploy"
}