pyams-utils


Namepyams-utils JSON
Version 2.6.1 PyPI version JSON
download
home_pagehttps://pyams.readthedocs.io
SummaryPyAMS generic modules
upload_time2024-07-25 08:34:35
maintainerNone
docs_urlNone
authorThierry Florac
requires_python>=3.7
licenseZPL
keywords pyramid pyams
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===================
PyAMS_utils package
===================

.. contents::


What is PyAMS?
==============

PyAMS (Pyramid Application Management Suite) is a small suite of packages written for applications
and content management with the Pyramid framework.

**PyAMS** is actually mainly used to manage web sites through content management applications (CMS,
see PyAMS_content package), but many features are generic and can be used inside any kind of web
application.

All PyAMS documentation is available on `ReadTheDocs <https://pyams.readthedocs.io>`_; source code
is available on `Gitlab <https://gitlab.com/pyams>`_ and pushed to `Github
<https://github.com/py-ams>`_.


What is PyAMS_utils?
====================

PyAMS_utils is a large set of small generic modules used to handle PyAMS applications.

These modules provide several decorators used to declare object factories, adapters, utilities
and vocabularies; they also provide a large set of adapters, utilities and predicates related to
many common operations like caching, dates management, data API, text conversions, request
properties..., as well as custom schema fields.

When included into Pyramid's configuration, this package also register several Zope packages
through ZCML, typically to automatically inclure DublinCore extensions or IntIDs management.

Most PyAMS_utils modules are documented using doctests in the /doctests/ sub-directory.



Changelog
=========

2.6.1
-----
 - allow usage of event form context in "context_selector" subscriber predicate

2.6.0
-----
 - added new factory to handle internal requests

2.5.1
-----
 - small code refactoring

2.5.0
-----
 - switch default timezone from GMT to UTC
 - replaced calls to datetime.utcnow() with datetime.now(timezone.utc)

2.4.4
-----
 - temporary drop of Python 3.12 support...

2.4.3
-----
 - updated Python 3.12 support

2.4.2
-----
 - updated Python 3.12 support

2.4.1
-----
 - updated Python 3.12 support

2.4.0
-----
 - added "grouped_iter" function to get iterator items by groups
 - added support for SonarCloud
 - added support for Python 3.12

2.3.2
-----
 - updated HTTP proxy information class

2.3.1
-----
 - added helper to get next item from any iterable

2.3.0
-----
 - added helper to get interface base name
 - updated parent getter, and added new getter to get parents from context until a given interface
   is found

2.2.0
-----
 - updated base container mixin class
 - moved finding helpers to new module

2.1.0
-----
 - added text function to get sub-parts from input string
 - added helper to load object from ZODB from it's OID

2.0.3
-----
 - added helper to IUniqueID interface getter

2.0.2
-----
 - updated local utilities title getter

2.0.1
-----
 - updated Buildout configuration

2.0.0
-----
 - migrated to Pyramid 2.0

1.17.0
------
 - added TALES extensions for date formatting
 - added ISO countries mapping and vocabulary
 - added support for HTTP proxy schema field
 - added Colander "StringArraySchema" type to handle inputs which can be provided as strings using a
   given separator, or as arrays
 - added support for parameters in absolute and canonical URL adapters
 - updated base CORS requests handler
 - add result to current connection when creating annotation adapter
 - updated local utilities vocabulary terms title factory
 - converted cache key adapters to use hexadecimal values

1.16.2
------
 - added REST API helpers, types converters and base responses
 - moved Swagger/OpenAPI specifications to *PyAMS_zmi* package

1.16.1
------
 - added constant for "missing" string
 - updated date and datetime range schema fields interfaces

1.16.0
------
 - added new "isodate" formatter to *timestamp* TALES extension, to only get date instead of
   datetime in ISO format
 - added "boolean_dict" helper to check that a mapping has at least one key which doesn't
   have an empty value

1.15.1
------
 - added support for Python 3.11
 - added a few types hints

1.15.0
------
 - added new text renderers interfaces and support; the goal of these interfaces is to be able
   to include dynamic fragments into a static string which will be evaluated at runtime; this
   string can be, for example, an SQL query or a JSON object which could be used to provide
   arguments to a REST service, and is actually usable by PyAMS tasks scheduler

1.14.0
------
 - added RPC protocols helper module
 - added object factory helper function

1.13.1
------
 - updated CORS request handler interface to be able to specify supported HTTP methods when
   REST service is not based on Cornice

1.13.0
------
 - added custom interface and default adapter to handle CORS requests

1.12.3
------
 - updated CORS headers support

1.12.2
------
 - updated Gitlab-CI configuration

1.12.1
------
 - added support helpers for CORS preflight OPTIONS verb used by REST services

1.12.0
------
 - removed Pypy3 support from Gitlab-CI because of build issues with Twine and Cryptography
 - added small "is not None" filter helper
 - added text renderers for vocabulary-based properties
 - removed unused Pygments resource

1.11.6
------
 - updated Pypy 3 support

1.11.5
------
 - updated Pypy 3 support

1.11.4
------
 - added support for Python 3.10 and Pypy 3

1.11.3
------
 - check if provided argument is an interface in object factory getter
 - added volatile property setter

1.11.2
------
 - added helper function in *factory* module to get all registered factories
   for a given interface
 - catch RuntimeError in boolean iterator checker to handle Python 3.7+ use case where
   a StopIteration raised from inside a generator is transformed into a RuntimeError
   (see PEP 479)
 - catch NotYet exception in IIntIds object remove subscriber
 - updated class properties management
 - updated local utilities vocabulary
 - updated Gitlab-CI configuration

1.11.1
------
 - updated imports

1.11.0
------
 - added arguments to container module to be able to get depth of found objects inside a
   container

1.10.0
------
 - added 'transaction' module
 - handler sets in dicts merging
 - Pylint improvements

1.9.2
-----
 - updated path getter of external Fanstatic resources

1.9.1
-----
 - locales and translations updates

1.9.0
-----
 - added simple container class to handle internal sequence
 - added mappings marging function
 - updated unique ID adapter
 - updated Pygments resources management

1.8.1
-----
 - updated custom Fanstatic resource manager to handle resources with data correctly in
   production mode

1.8.0
-----
 - updated Venusian decorator callbacks category to "pyramid" for compatibility
   with Pyramid 2.0
 - added registry helper to do adapters lookups

1.7.1
-----
 - added missing interface translation

1.7.0
-----
 - remove support for Python < 3.7
 - added global OpenAPI specification view
 - added simple Cornice schema fields and converters
 - added custom handling of newlines character in "br" TALES extension

1.6.1
-----
 - updated Gitlab-CI configuration

1.6.0
-----
 - added ILocation copy hook (copied from "zope.location" package)
 - added base class for local utilities vocabulary

1.5.2
-----
 - removed Travis-CI configuration

1.5.1
-----
 - translation update

1.5.0
-----
 - updated "get_duration" function to directly accept a timedelta object
 - added dict formatter function (mainly used for tests)
 - use keywords arguments in "request.has_permission" call to use request cache

1.4.3
-----
 - updated doctests for last Pygments release

1.4.2
-----
 - package version mismatch

1.4.1
-----
 - make "object_data" TALES extension return None instead of an empty string when no
   data is available

1.4.0
-----
 - added Beaker's cache management functions and vocabulary
 - always make a registered utility class to provide it's registered interface
 - added HTTPMethodField schema field, a tuple used to combine an HTTP method and an URL in
   a single property

1.3.8
-----
 - updated Gitlab-CI settings to remove Travis-CI

1.3.7
-----
 - updated Travis configuration

1.3.6
-----
 - updated WSGI environment decorator to prevent storing null values into request environment

1.3.5
-----
 - updated request's WSGI property decorator to be able to handle caching functions with
   arguments
 - extracted object data renderer into a dedicated function
 - updated adapter_config decorator arguments names

1.3.4
-----
 - always add "context" attribute to request when creating a new request

1.3.3
-----
 - changed format of "capture*" context managers to also get result of initial function call

1.3.2
-----
 - renamed testing decorator caller argument

1.3.1
-----
 - added testing requirement for Pyramid ZCML

1.3.0
-----
 - updated PyAMS registry management to only use Pyramid registry (using "hook_zca")
 - local registry should only be used to handle local utilities, and not any kind of
   components!
 - updated doctests to use hooked ZCA

1.2.8
-----
 - updated doctests

1.2.7
-----
 - updated doctests

1.2.6
-----
 - updated doctests

1.2.5
-----
 - updated doctests

1.2.4
-----
 - added distribution check

1.2.3
-----
 - small refactoring to add "get_timestamp" function to "pyams_utils.date" module
 - small updates in "url" and "zodb" modules
 - added venusian decorators testing helpers
 - completed doctests

1.2.2
-----
 - Pylint upgrade

1.2.1
-----
 - updated doctest

1.2.0
-----
 - added Fanstatic resource type to define link "data" attributes, with new doctests
 - added new "data" function to format data attributes
 - Pylint code cleanup

1.1.4
-----
 - updated doctests
 - when registering a class adapter, automatically make this class implement the adapter
   "provided" interface
 - added testing helpers

1.1.3
-----
 - added doctests

1.1.2
-----
 - renamed arguments and variables to avoid shadowing arguments names
 - updated private Gitlab integration

1.1.1
-----
 - added synonyms to "adapter_config" arguments names ('required' and 'adapts' for 'context', and
   'provided' for 'provides')

1.1.0
-----
 - corrected "timestamp" TALES extension
 - added generic *IDataManager* interface definition to PyAMS_utils, so it can be used in any
   package without using PyAMS_form

1.0.0
-----
 - initial release

            

Raw data

            {
    "_id": null,
    "home_page": "https://pyams.readthedocs.io",
    "name": "pyams-utils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "Pyramid PyAMS",
    "author": "Thierry Florac",
    "author_email": "tflorac@ulthar.net",
    "download_url": "https://files.pythonhosted.org/packages/ef/93/c46a7dab3ceb493975de47c5873ddb890ea747aaf3f26efbeeb6a79ad2cc/pyams_utils-2.6.1.tar.gz",
    "platform": null,
    "description": "===================\nPyAMS_utils package\n===================\n\n.. contents::\n\n\nWhat is PyAMS?\n==============\n\nPyAMS (Pyramid Application Management Suite) is a small suite of packages written for applications\nand content management with the Pyramid framework.\n\n**PyAMS** is actually mainly used to manage web sites through content management applications (CMS,\nsee PyAMS_content package), but many features are generic and can be used inside any kind of web\napplication.\n\nAll PyAMS documentation is available on `ReadTheDocs <https://pyams.readthedocs.io>`_; source code\nis available on `Gitlab <https://gitlab.com/pyams>`_ and pushed to `Github\n<https://github.com/py-ams>`_.\n\n\nWhat is PyAMS_utils?\n====================\n\nPyAMS_utils is a large set of small generic modules used to handle PyAMS applications.\n\nThese modules provide several decorators used to declare object factories, adapters, utilities\nand vocabularies; they also provide a large set of adapters, utilities and predicates related to\nmany common operations like caching, dates management, data API, text conversions, request\nproperties..., as well as custom schema fields.\n\nWhen included into Pyramid's configuration, this package also register several Zope packages\nthrough ZCML, typically to automatically inclure DublinCore extensions or IntIDs management.\n\nMost PyAMS_utils modules are documented using doctests in the /doctests/ sub-directory.\n\n\n\nChangelog\n=========\n\n2.6.1\n-----\n - allow usage of event form context in \"context_selector\" subscriber predicate\n\n2.6.0\n-----\n - added new factory to handle internal requests\n\n2.5.1\n-----\n - small code refactoring\n\n2.5.0\n-----\n - switch default timezone from GMT to UTC\n - replaced calls to datetime.utcnow() with datetime.now(timezone.utc)\n\n2.4.4\n-----\n - temporary drop of Python 3.12 support...\n\n2.4.3\n-----\n - updated Python 3.12 support\n\n2.4.2\n-----\n - updated Python 3.12 support\n\n2.4.1\n-----\n - updated Python 3.12 support\n\n2.4.0\n-----\n - added \"grouped_iter\" function to get iterator items by groups\n - added support for SonarCloud\n - added support for Python 3.12\n\n2.3.2\n-----\n - updated HTTP proxy information class\n\n2.3.1\n-----\n - added helper to get next item from any iterable\n\n2.3.0\n-----\n - added helper to get interface base name\n - updated parent getter, and added new getter to get parents from context until a given interface\n   is found\n\n2.2.0\n-----\n - updated base container mixin class\n - moved finding helpers to new module\n\n2.1.0\n-----\n - added text function to get sub-parts from input string\n - added helper to load object from ZODB from it's OID\n\n2.0.3\n-----\n - added helper to IUniqueID interface getter\n\n2.0.2\n-----\n - updated local utilities title getter\n\n2.0.1\n-----\n - updated Buildout configuration\n\n2.0.0\n-----\n - migrated to Pyramid 2.0\n\n1.17.0\n------\n - added TALES extensions for date formatting\n - added ISO countries mapping and vocabulary\n - added support for HTTP proxy schema field\n - added Colander \"StringArraySchema\" type to handle inputs which can be provided as strings using a\n   given separator, or as arrays\n - added support for parameters in absolute and canonical URL adapters\n - updated base CORS requests handler\n - add result to current connection when creating annotation adapter\n - updated local utilities vocabulary terms title factory\n - converted cache key adapters to use hexadecimal values\n\n1.16.2\n------\n - added REST API helpers, types converters and base responses\n - moved Swagger/OpenAPI specifications to *PyAMS_zmi* package\n\n1.16.1\n------\n - added constant for \"missing\" string\n - updated date and datetime range schema fields interfaces\n\n1.16.0\n------\n - added new \"isodate\" formatter to *timestamp* TALES extension, to only get date instead of\n   datetime in ISO format\n - added \"boolean_dict\" helper to check that a mapping has at least one key which doesn't\n   have an empty value\n\n1.15.1\n------\n - added support for Python 3.11\n - added a few types hints\n\n1.15.0\n------\n - added new text renderers interfaces and support; the goal of these interfaces is to be able\n   to include dynamic fragments into a static string which will be evaluated at runtime; this\n   string can be, for example, an SQL query or a JSON object which could be used to provide\n   arguments to a REST service, and is actually usable by PyAMS tasks scheduler\n\n1.14.0\n------\n - added RPC protocols helper module\n - added object factory helper function\n\n1.13.1\n------\n - updated CORS request handler interface to be able to specify supported HTTP methods when\n   REST service is not based on Cornice\n\n1.13.0\n------\n - added custom interface and default adapter to handle CORS requests\n\n1.12.3\n------\n - updated CORS headers support\n\n1.12.2\n------\n - updated Gitlab-CI configuration\n\n1.12.1\n------\n - added support helpers for CORS preflight OPTIONS verb used by REST services\n\n1.12.0\n------\n - removed Pypy3 support from Gitlab-CI because of build issues with Twine and Cryptography\n - added small \"is not None\" filter helper\n - added text renderers for vocabulary-based properties\n - removed unused Pygments resource\n\n1.11.6\n------\n - updated Pypy 3 support\n\n1.11.5\n------\n - updated Pypy 3 support\n\n1.11.4\n------\n - added support for Python 3.10 and Pypy 3\n\n1.11.3\n------\n - check if provided argument is an interface in object factory getter\n - added volatile property setter\n\n1.11.2\n------\n - added helper function in *factory* module to get all registered factories\n   for a given interface\n - catch RuntimeError in boolean iterator checker to handle Python 3.7+ use case where\n   a StopIteration raised from inside a generator is transformed into a RuntimeError\n   (see PEP 479)\n - catch NotYet exception in IIntIds object remove subscriber\n - updated class properties management\n - updated local utilities vocabulary\n - updated Gitlab-CI configuration\n\n1.11.1\n------\n - updated imports\n\n1.11.0\n------\n - added arguments to container module to be able to get depth of found objects inside a\n   container\n\n1.10.0\n------\n - added 'transaction' module\n - handler sets in dicts merging\n - Pylint improvements\n\n1.9.2\n-----\n - updated path getter of external Fanstatic resources\n\n1.9.1\n-----\n - locales and translations updates\n\n1.9.0\n-----\n - added simple container class to handle internal sequence\n - added mappings marging function\n - updated unique ID adapter\n - updated Pygments resources management\n\n1.8.1\n-----\n - updated custom Fanstatic resource manager to handle resources with data correctly in\n   production mode\n\n1.8.0\n-----\n - updated Venusian decorator callbacks category to \"pyramid\" for compatibility\n   with Pyramid 2.0\n - added registry helper to do adapters lookups\n\n1.7.1\n-----\n - added missing interface translation\n\n1.7.0\n-----\n - remove support for Python < 3.7\n - added global OpenAPI specification view\n - added simple Cornice schema fields and converters\n - added custom handling of newlines character in \"br\" TALES extension\n\n1.6.1\n-----\n - updated Gitlab-CI configuration\n\n1.6.0\n-----\n - added ILocation copy hook (copied from \"zope.location\" package)\n - added base class for local utilities vocabulary\n\n1.5.2\n-----\n - removed Travis-CI configuration\n\n1.5.1\n-----\n - translation update\n\n1.5.0\n-----\n - updated \"get_duration\" function to directly accept a timedelta object\n - added dict formatter function (mainly used for tests)\n - use keywords arguments in \"request.has_permission\" call to use request cache\n\n1.4.3\n-----\n - updated doctests for last Pygments release\n\n1.4.2\n-----\n - package version mismatch\n\n1.4.1\n-----\n - make \"object_data\" TALES extension return None instead of an empty string when no\n   data is available\n\n1.4.0\n-----\n - added Beaker's cache management functions and vocabulary\n - always make a registered utility class to provide it's registered interface\n - added HTTPMethodField schema field, a tuple used to combine an HTTP method and an URL in\n   a single property\n\n1.3.8\n-----\n - updated Gitlab-CI settings to remove Travis-CI\n\n1.3.7\n-----\n - updated Travis configuration\n\n1.3.6\n-----\n - updated WSGI environment decorator to prevent storing null values into request environment\n\n1.3.5\n-----\n - updated request's WSGI property decorator to be able to handle caching functions with\n   arguments\n - extracted object data renderer into a dedicated function\n - updated adapter_config decorator arguments names\n\n1.3.4\n-----\n - always add \"context\" attribute to request when creating a new request\n\n1.3.3\n-----\n - changed format of \"capture*\" context managers to also get result of initial function call\n\n1.3.2\n-----\n - renamed testing decorator caller argument\n\n1.3.1\n-----\n - added testing requirement for Pyramid ZCML\n\n1.3.0\n-----\n - updated PyAMS registry management to only use Pyramid registry (using \"hook_zca\")\n - local registry should only be used to handle local utilities, and not any kind of\n   components!\n - updated doctests to use hooked ZCA\n\n1.2.8\n-----\n - updated doctests\n\n1.2.7\n-----\n - updated doctests\n\n1.2.6\n-----\n - updated doctests\n\n1.2.5\n-----\n - updated doctests\n\n1.2.4\n-----\n - added distribution check\n\n1.2.3\n-----\n - small refactoring to add \"get_timestamp\" function to \"pyams_utils.date\" module\n - small updates in \"url\" and \"zodb\" modules\n - added venusian decorators testing helpers\n - completed doctests\n\n1.2.2\n-----\n - Pylint upgrade\n\n1.2.1\n-----\n - updated doctest\n\n1.2.0\n-----\n - added Fanstatic resource type to define link \"data\" attributes, with new doctests\n - added new \"data\" function to format data attributes\n - Pylint code cleanup\n\n1.1.4\n-----\n - updated doctests\n - when registering a class adapter, automatically make this class implement the adapter\n   \"provided\" interface\n - added testing helpers\n\n1.1.3\n-----\n - added doctests\n\n1.1.2\n-----\n - renamed arguments and variables to avoid shadowing arguments names\n - updated private Gitlab integration\n\n1.1.1\n-----\n - added synonyms to \"adapter_config\" arguments names ('required' and 'adapts' for 'context', and\n   'provided' for 'provides')\n\n1.1.0\n-----\n - corrected \"timestamp\" TALES extension\n - added generic *IDataManager* interface definition to PyAMS_utils, so it can be used in any\n   package without using PyAMS_form\n\n1.0.0\n-----\n - initial release\n",
    "bugtrack_url": null,
    "license": "ZPL",
    "summary": "PyAMS generic modules",
    "version": "2.6.1",
    "project_urls": {
        "Homepage": "https://pyams.readthedocs.io"
    },
    "split_keywords": [
        "pyramid",
        "pyams"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e14b28a048e71cdbee0cb2f3097af332515378766e2b0df1a290e9e09f26babc",
                "md5": "3ec17bf326f67975ed330f0dd7443394",
                "sha256": "874baa2cd16b3529ab9f655e6252d1966e12ae9410f2f3d66b309a0ddf88a0ea"
            },
            "downloads": -1,
            "filename": "pyams_utils-2.6.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3ec17bf326f67975ed330f0dd7443394",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 199302,
            "upload_time": "2024-07-25T08:34:33",
            "upload_time_iso_8601": "2024-07-25T08:34:33.604514Z",
            "url": "https://files.pythonhosted.org/packages/e1/4b/28a048e71cdbee0cb2f3097af332515378766e2b0df1a290e9e09f26babc/pyams_utils-2.6.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ef93c46a7dab3ceb493975de47c5873ddb890ea747aaf3f26efbeeb6a79ad2cc",
                "md5": "b378e7cab37bf78c70c03d52539f893c",
                "sha256": "6cdbf0bd919517b27e8a1dd9fa1a4feaed6332c52f495c6dda131f8ab0d9e51f"
            },
            "downloads": -1,
            "filename": "pyams_utils-2.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b378e7cab37bf78c70c03d52539f893c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 135097,
            "upload_time": "2024-07-25T08:34:35",
            "upload_time_iso_8601": "2024-07-25T08:34:35.940134Z",
            "url": "https://files.pythonhosted.org/packages/ef/93/c46a7dab3ceb493975de47c5873ddb890ea747aaf3f26efbeeb6a79ad2cc/pyams_utils-2.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-25 08:34:35",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pyams-utils"
}
        
Elapsed time: 0.45485s