Metadata-Version: 2.1
Name: pyams_utils
Version: 0.2.1
Summary: Utility functions and classes for PyAMS
Home-page: http://www.ztfy.org
Author: Thierry Florac
Author-email: tflorac@ulthar.net
License: ZPL
Keywords: Pyramid PyAMS utilities
Classifier: License :: OSI Approved :: Zope Public License
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Framework :: Zope3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
License-File: LICENSE
Requires-Dist: setuptools
Requires-Dist: babel
Requires-Dist: beaker
Requires-Dist: BTrees
Requires-Dist: chameleon
Requires-Dist: docutils
Requires-Dist: fanstatic
Requires-Dist: httplib2
Requires-Dist: markdown
Requires-Dist: persistent
Requires-Dist: pygments
Requires-Dist: pyramid
Requires-Dist: pyramid_zodbconn
Requires-Dist: pyramid_zope_request
Requires-Dist: pysocks
Requires-Dist: pytz
Requires-Dist: transaction
Requires-Dist: venusian
Requires-Dist: z3c.form
Requires-Dist: z3c.pt
Requires-Dist: z3c.ptcompat
Requires-Dist: ZEO
Requires-Dist: ZODB
Requires-Dist: zope.annotation
Requires-Dist: zope.component
Requires-Dist: zope.container
Requires-Dist: zope.contentprovider
Requires-Dist: zope.datetime
Requires-Dist: zope.dublincore
Requires-Dist: zope.interface
Requires-Dist: zope.intid
Requires-Dist: zope.keyreference
Requires-Dist: zope.lifecycleevent
Requires-Dist: zope.location
Requires-Dist: zope.publisher
Requires-Dist: zope.schema
Requires-Dist: zope.site
Requires-Dist: zope.traversing
Provides-Extra: test
Requires-Dist: pyramid_zcml; extra == "test"
Requires-Dist: zope.exceptions; extra == "test"

===================
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>`_


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

PyAMS_utils is a set of classes and functions which can be used to provide many small services and
handle common operations in the context of a Pyramid application.

Internal sub-packages include:
 - registry: local registry management tools
 - adapter: custom adapters and annotations
 - date: convert dates to unicode ISO format, parse ISO datetime, convert date to datetime
 - request: get current request, get request annotations, get and set request data via annotations
 - session: to store and get properties values from current session
 - timezone: convert datetime to a given timezone ; provides a server default timezone utility
 - traversing: custom traverser utility supporting namespaces
 - unicode: convert any text to unicode for easy storage
 - protocol: utility functions and modules for several nerwork protocols
 - text: simple text operations and text to HTML conversion
 - html: HTML parser and HTML to text converter
 - file: file upload data converter
 - tales: custom "extension:" TALES expression using adapters


Changelog
=========

0.2.1
-----
 - added optional query argument to absolute_url TALES extension

0.2.0
------
 - added automatic implementation of provided interface to registered classes adapters
 - added transaction module utilities

0.1.52
------
 - added "escape_dict" function to escape all values from an input dict

0.1.51
------
 - added "exponential backoff" decorator
 - added argument to request property decorator to remove debug logging
 - added list pagination helper
 - updated object factory constructor to allow args and keyword args

0.1.50
------
 - added "sanitize" TALES extension

0.1.49
------
 - updated time formatter

0.1.48
------
 - added base REST API helpers
 - added permission to use API keys
 - updated adapter_config decorator to replace *context* argument with *required*

0.1.47
------
 - added "break_text" function to handle custom line breaks in text, and updated "br"
   TALES extension

0.1.46
------
 - added *isodate* formatter to *timestamp* TALES extension to only get date in ISO format

0.1.45
------
 - added "isoformat" TALES extension

0.1.44
------
 - updated StopIteration exception catcher (required for Python >= 3.7)

0.1.43
------
 - added TALES "format_date" and "format_time" extensions

0.1.42
------
 - updated IUniqueID adapter

0.1.41
------
 - added "tee_iter" TALES extension, which returns a tee of incoming iterator

0.1.40
------
 - updated "br" TALES extension to support getting a list of strings as argument instead of
   only a string using a separator character

0.1.39
------
 - updated "relative_url" TALES extension to add "display_context" argument

0.1.38
------
 - added arguments to "find_objects_matching"/"find_objects_providing" functions, to be able to
   get depth of found items
 - updated "get_text_start" function to return the initial argument value when provided length
   is negative

0.1.37
------
 - added "pyams_utils.date.get_timestamp(context)" function

0.1.36
------
 - added multiple mail addresses schema field
 - added pyams_utils.list.unique_iter_max() function to get items out of an iterable containing
   the biggest value for a given key
 - small decorators updates

0.1.35
------
 - Pylint code cleanup and GitLab-CI integration updates

0.1.34.2
--------
 - correction in "generate_url" function

0.1.34.1
--------
 - replace remaining slashes with dashes when generating content's URL

0.1.34
------
 - don't escape slashes when generating content's URL
 - added schema field to display JSON mapping data

0.1.33
------
 - added test in "relative_url" function to check if request is an instance of PyramidPublisherRequest

0.1.32
------
 - updated unit tests
 - added Gitlab-CI integration

0.1.31
------
 - added "boolean_iter" function and TALES extension to check if an iterator returns at least one value, without
   consuming it

0.1.30.3
--------
 - small updates in progress management

0.1.30.2
--------
 - added extra-characters to punctuation when translating string to generate URLs
 - handle IndexError in NamespaceTraverser

0.1.30.1
--------
 - added entry into Unicode translation table to convert Microsoft Word typographic quotes to simple quotes

0.1.30
------
 - updated "copy_request" function to keep track of request's "root" attribute
 - added label to HTML renderers which can be selected by end-users

0.1.29
------
 - updated "check_request()" function to be able to use currently registered request factory (instead of PyAMSRequest)
   and to specify a principal ID when creating a new request is required

0.1.28
------
 - added NamespaceTraverser to replace "++oid++XX::title.html" URL syntax with a simpler "*/+/XX::title.html".
   This requires an ITraversable adapter named "+" for context and request to handle content access.

0.1.27.1
--------
 - force timezone in "timestamp" TALES adapter

0.1.27
------
 - updated text to HTML converter to be able to specify several renderers in the same TALES 'html' extension call
   (giving renderers names separated by semicolon)

0.1.26
------
 - added Markdown text renderer

0.1.25
------
 - updated "factory_config" decorator so that decorated class automatically implements the interface provided by factory

0.1.24.1
--------
 - added 'order' attribute to INode interface
 - updated 'generate_url' function to add argument to define minimum words length with a default
   value of 2 characters (instead of 2 before)

0.1.24
------
 - added Pygments utilities

0.1.23
------
 - added function to check if TCP port is already opened
 - added "truncate" TALES extension
 - updated Fanstatic package docstring

0.1.22
------
 - updated Fanstatic's external resource declaration to handle resources types not based on URLs

0.1.21
------
 - added "display_context" property to request
 - updated 'timestamp' TALES extension to specify optional ISO output format

0.1.20
------
 - added support for server's locale configuration
 - added 'need_resource' TALES extension to include Fanstatic resource from template

0.1.19
------
 - updated "br" TALES extension to add custom start and end tags

0.1.18
------
 - added default JSON encoder to serialize date and datetime objects (required for PyAMS_apm package)
 - added JS text renderer
 - use "yield from" in container's ISublocations adapters

0.1.17.1
--------
 - update "br" TALES extension to disallow empty context

0.1.17
------
 - added functions to get unique or random members from iterator

0.1.16
------
 - updated annotation adapter factory to use a registered object factory if given factory is an
   interface
 - added "parent_selector" predicate for IObjectMoved/IObjectAdded events
 - added "is_interface" function to check if an object is an interface
 - added IRelativeURL interface, default adapter and TALES "relative_url" extension to get
   content's URL based on current display context
 - added "cache_key" and "timestamp" TALES extensions
 - removed configuration factory interfaces and use standard object factory

0.1.15
------
 - added "inherit_from" attribute to IInheritInfo interface
 - added helper to get a persistent adapter through context's annotations
 - added "canonical_url" function, interface and TALES extension
 - updated custom PyAMS traverser to notify BeforeTraverseEvent on last traversed object

0.1.14
------
 - updated request_property decorator cache key
 - updated base site root ACL to grant 'public' permission to everyone
 - use object ID in default cache key adapter
 - add cache key adapters for string and persistent objects

0.1.13
------
 - added site root factory interface
 - updated site factory to use new factory interface utility

0.1.12
------
 - added "request_selector" subscriber predicate
 - updated ZEO connection timeout arguments for ZEO 5.x
 - remove INewLocalSite event subscribers; database upgrade is now only done through command line script, and
   utilities providing ISiteGenerations can be ordered
 - removed static configuration manager interface
 - make sure that requests created manually support annotations in get/set request data functions

0.1.11
------
 - moved PyAMS documentation to "PyAMS User Guide" package
 - added "inherit" interface and module to handle inheritance between located components easier
 - added exception handling when trying to get or set request annotations
 - added property annotation to define volatile attributes on persistent classes

0.1.10
------
 - added ZODB connection class and vocabulary based on Pyramid's settings
 - updated DocFieldProperty to correctly handle attributes documentation
 - small updates in registry management functions

0.1.9
-----
 - added "NullAdapter" class to be able to remove a default adapter for a given context
 - added "get_global_registry" function

0.1.8
-----
 - updated TALES extensions interfaces
 - added validation method and exception for email schema field

0.1.7
-----
 - added mail address schema field

0.1.6
-----
 - updated exceptions messages translations
 - added 'query' parameter to 'absolute_url' function

0.1.5
-----
 - refactored request and session properties management
 - added check for multi-adapter lookup on IHTMLRenderer interface in 'html' TALES extension
 - update docstrings

0.1.4
-----
 - added "condition" optional argument to "get_parent" traversing helper to retrieve a parent only if given function
   returns a "True" value when called with parent as argument
 - added annotation for vocabulary registry
 - added 'prefix' argument to 'request_property' and 'session_property' decorators
 - handle POSError in 'query_utility' registry function
 - updated unit tests
 - updated documentation

0.1.3
-----
 - corrected XML-RPC client for Python 3
 - added container's "find_objects_*" functions based on ISubLocations interface

0.1.2
-----
 - imports cleanup
 - moved IIntIds related modules from pyams_base package

0.1.1
-----
 - corrected cookies management in XML-RPC authenticated transport

0.1.0
-----
 - initial release
