{ "info": { "author": "Grok project", "author_email": "grok-dev@zope.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 6 - Mature", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Utilities" ], "description": "*******\nMartian\n*******\n\n.. image:: https://travis-ci.org/zopefoundation/martian.svg?branch=master\n :target: https://travis-ci.org/zopefoundation/martian\n\n.. image:: https://readthedocs.org/projects/martian/badge/?version=latest\n :target: https://martian.readthedocs.org/en/latest/\n :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/v/martian.svg\n :target: https://pypi.python.org/pypi/martian\n :alt: PyPI\n\n.. image:: https://img.shields.io/pypi/pyversions/martian.svg\n :target: https://pypi.python.org/pypi/martian\n :alt: Python versions\n\n\nA library to grok configuration from Python code.\n\nMartian tutorial\n****************\n\nIntroduction\n============\n\n\"There was so much to grok, so little to grok from.\" -- Stranger in a\nStrange Land, by Robert A. Heinlein\n\nMartian provides infrastructure for declarative configuration of\nPython code. Martian is especially useful for the construction of\nframeworks that need to provide a flexible plugin\ninfrastructure. Martian doesn't actually provide infrastructure for\nplugin registries (except for itself). Many frameworks have their own\nsystems for this, and if you need a generic one, you might want to\nconsider ``zope.component``. Martian just allows you to make the\nregistration of plugins less verbose.\n\nYou can see Martian as doing something that you can also solve with\nmetaclasses, with the following advantages:\n\n* the developer of the framework doesn't have to write a lot of ad-hoc\n metaclasses anymore; instead we offer an infrastructure to make life\n easier.\n\n* configuration doesn't need to happen at import time, but can happen at\n program startup time. This also makes configuration more tractable for\n a developer.\n\n* we don't bother the developer that *uses* the framework with the\n surprising behavior that metaclasses sometimes bring. The classes\n the user has to deal with are normal classes.\n\nWhy is this package named ``martian``? In the novel \"Stranger in a\nStrange Land\", the verb *grok* is introduced:\n\n Grok means to understand so thoroughly that the observer becomes a\n part of the observed -- to merge, blend, intermarry, lose identity\n in group experience.\n\nIn the context of this package, \"grokking\" stands for the process of\ndeducing declarative configuration actions from Python code. In the\nnovel, grokking is originally a concept that comes from the planet\nMars. Martians *grok*. Since this package helps you grok code, it's\ncalled Martian.\n\nMartian provides a framework that allows configuration to be expressed\nin declarative Python code. These declarations can often be deduced\nfrom the structure of the code itself. The idea is to make these\ndeclarations so minimal and easy to read that even extensive\nconfiguration does not overly burden the programmers working with the\ncode.\n\nThe ``martian`` package is a spin-off from the `Grok project`_, in the\ncontext of which this codebase was first developed. While Grok uses\nit, the code is completely independent of Grok.\n\n.. _`Grok project`: http://grok.zope.org\n\nMotivation\n==========\n\n\"Deducing declarative configuration actions from Python code\" - that\nsounds very abstract. What does it actually mean? What is\nconfiguration? What is declarative configuration? In order to explain\nthis, we'll first take a look at configuration.\n\nLarger frameworks often offer a lot of points where you can modify\ntheir behavior: ways to combine its own components with components you\nprovide yourself to build a larger application. A framework offers\npoints where it can be *configured* with plugin code. When you plug\nsome code into a plugin point, it results in the updating of some\nregistry somewhere with the new plugin. When the framework uses a\nplugin, it will first look it up in the registry. The action of\nregistering some component into a registry can be called\n*configuration*.\n\nLet's look at an example framework that offers a plugin point. We\nintroduce a very simple framework for plugging in different template\nlanguages, where each template language uses its own extension. You\ncan then supply the framework with the template body and the template\nextension and some data, and render the template.\n\nLet's look at the framework::\n\n >>> import string\n >>> class templating(FakeModule):\n ...\n ... class InterpolationTemplate(object):\n ... \"Use %(foo)s for dictionary interpolation.\"\n ... def __init__(self, text):\n ... self.text = text\n ... def render(self, **kw):\n ... return self.text % kw\n ...\n ... class TemplateStringTemplate(object):\n ... \"PEP 292 string substitutions.\"\n ... def __init__(self, text):\n ... self.template = string.Template(text)\n ... def render(self, **kw):\n ... return self.template.substitute(**kw)\n ...\n ... # the registry, we plug in the two templating systems right away\n ... extension_handlers = { '.txt': InterpolationTemplate,\n ... '.tmpl': TemplateStringTemplate }\n ...\n ... def render(data, extension, **kw):\n ... \"\"\"Render the template at filepath with arguments.\n ...\n ... data - the data in the file\n ... extension - the extension of the file\n ... keyword arguments - variables to interpolate\n ...\n ... In a real framework you could pass in the file path instead of\n ... data and extension, but we don't want to open files in our\n ... example.\n ...\n ... Returns the rendered template\n ... \"\"\"\n ... template = extension_handlers[extension](data)\n ... return template.render(**kw)\n\nSince normally we cannot create modules in a doctest, we have emulated\nthe ``templating`` Python module using the ``FakeModule``\nclass. Whenever you see ``FakeModule`` subclasses, imagine you're\nlooking at a module definition in a ``.py`` file. Now that we have\ndefined a module ``templating``, we also need to be able to import\nit. Fake modules are always placed automatically into the\n``martiantest.fake`` namespace so you can import them from there::\n\n >>> from martiantest.fake import templating\n\nNow let's try the ``render`` function for the registered template\ntypes, to demonstrate that our framework works::\n\n >>> templating.render('Hello %(name)s!', '.txt', name=\"world\")\n 'Hello world!'\n >>> templating.render('Hello ${name}!', '.tmpl', name=\"universe\")\n 'Hello universe!'\n\nFile extensions that we do not recognize cause a ``KeyError`` to be\nraised::\n\n >>> templating.render('Hello', '.silly', name=\"test\")\n Traceback (most recent call last):\n ...\n KeyError: '.silly'\n\nWe now want to plug into this filehandler framework and provide a\nhandler for ``.silly`` files. Since we are writing a plugin, we cannot\nchange the ``templating`` module directly. Let's write an extension\nmodule instead::\n\n >>> class sillytemplating(FakeModule):\n ... class SillyTemplate(object):\n ... \"Replace {key} with dictionary values.\"\n ... def __init__(self, text):\n ... self.text = text\n ... def render(self, **kw):\n ... text = self.text\n ... for key, value in kw.items():\n ... text = text.replace('{%s}' % key, value)\n ... return text\n ...\n ... templating.extension_handlers['.silly'] = SillyTemplate\n >>> from martiantest.fake import sillytemplating\n\nIn the extension module, we manipulate the ``extension_handlers``\ndictionary of the ``templating`` module (in normal code we'd need to\nimport it first), and plug in our own function. ``.silly`` handling\nworks now::\n\n >>> templating.render('Hello {name}!', '.silly', name=\"galaxy\")\n 'Hello galaxy!'\n\nAbove we plug into our ``extension_handler`` registry using Python\ncode. Using separate code to manually hook components into registries\ncan get rather cumbersome - each time you write a plugin, you also\nneed to remember you need to register it.\n\nDoing template registration in Python code also poses a maintenance\nrisk. It is tempting to start doing fancy things in Python code such\nas conditional configuration, making the configuration state of a\nprogram hard to understand. Another problem is that doing\nconfiguration at import time can also lead to unwanted side effects\nduring import, as well as ordering problems, where you want to import\nsomething that really needs configuration state in another module that\nis imported later. Finally, it can also make code harder to test, as\nconfiguration is loaded always when you import the module, even if in\nyour test perhaps you don't want it to be.\n\nMartian provides a framework that allows configuration to be expressed\nin declarative Python code. Martian is based on the realization that\nwhat to configure where can often be deduced from the structure of\nPython code itself, especially when it can be annotated with\nadditional declarations. The idea is to make it so easy to write and\nregister a plugin so that even extensive configuration does not overly\nburden the developer.\n\nConfiguration actions are executed during a separate phase (\"grok\ntime\"), not at import time, which makes it easier to reason about and\neasier to test.\n\nConfiguration the Martian Way\n=============================\n\nLet's now transform the above ``templating`` module and the\n``sillytemplating`` module to use Martian. First we must recognize\nthat every template language is configured to work for a particular\nextension. With Martian, we annotate the classes themselves with this\nconfiguration information. Annotations happen using *directives*,\nwhich look like function calls in the class body.\n\nLet's create an ``extension`` directive that can take a single string\nas an argument, the file extension to register the template class\nfor::\n\n >>> import martian\n >>> class extension(martian.Directive):\n ... scope = martian.CLASS\n ... store = martian.ONCE\n ... default = None\n\nWe also need a way to easily recognize all template classes. The normal\npattern for this in Martian is to use a base class, so let's define a\n``Template`` base class::\n\n >>> class Template(object):\n ... pass\n\nWe now have enough infrastructure to allow us to change the code to use\nMartian style base class and annotations::\n\n >>> class templating(FakeModule):\n ...\n ... class InterpolationTemplate(Template):\n ... \"Use %(foo)s for dictionary interpolation.\"\n ... extension('.txt')\n ... def __init__(self, text):\n ... self.text = text\n ... def render(self, **kw):\n ... return self.text % kw\n ...\n ... class TemplateStringTemplate(Template):\n ... \"PEP 292 string substitutions.\"\n ... extension('.tmpl')\n ... def __init__(self, text):\n ... self.template = string.Template(text)\n ... def render(self, **kw):\n ... return self.template.substitute(**kw)\n ...\n ... # the registry, empty to start with\n ... extension_handlers = {}\n ...\n ... def render(data, extension, **kw):\n ... # this hasn't changed\n ... template = extension_handlers[extension](data)\n ... return template.render(**kw)\n >>> from martiantest.fake import templating\n\nAs you can see, there have been very few changes:\n\n* we made the template classes inherit from ``Template``.\n\n* we use the ``extension`` directive in the template classes.\n\n* we stopped pre-filling the ``extension_handlers`` dictionary.\n\nSo how do we fill the ``extension_handlers`` dictionary with the right\ntemplate languages? Now we can use Martian. We define a *grokker* for\n``Template`` that registers the template classes in the\n``extension_handlers`` registry::\n\n >>> class meta(FakeModule):\n ... class TemplateGrokker(martian.ClassGrokker):\n ... martian.component(Template)\n ... martian.directive(extension)\n ... def execute(self, class_, extension, **kw):\n ... templating.extension_handlers[extension] = class_\n ... return True\n >>> from martiantest.fake import meta\n\nWhat does this do? A ``ClassGrokker`` has its ``execute`` method\ncalled for subclasses of what's indicated by the ``martian.component``\ndirective. You can also declare what directives a ``ClassGrokker``\nexpects on this component by using ``martian.directive()`` (the\n``directive`` directive!) one or more times.\n\nThe ``execute`` method takes the class to be grokked as the first\nargument, and the values of the directives used will be passed in as\nadditional parameters into the ``execute`` method. The framework can\nalso pass along an arbitrary number of extra keyword arguments during\nthe grokking process, so we need to declare ``**kw`` to make sure we\ncan handle these.\n\nAll our grokkers will be collected in a special Martian-specific\nregistry::\n\n >>> reg = martian.GrokkerRegistry()\n\nWe will need to make sure the system is aware of the\n``TemplateGrokker`` defined in the ``meta`` module first, so let's\nregister it first. We can do this by simply grokking the ``meta``\nmodule::\n\n >>> reg.grok('meta', meta)\n True\n\nBecause ``TemplateGrokker`` is now registered, our registry now knows\nhow to grok ``Template`` subclasses. Let's grok the ``templating``\nmodule::\n\n >>> reg.grok('templating', templating)\n True\n\nLet's try the ``render`` function of templating again, to demonstrate\nwe have successfully grokked the template classes::\n\n >>> templating.render('Hello %(name)s!', '.txt', name=\"world\")\n 'Hello world!'\n >>> templating.render('Hello ${name}!', '.tmpl', name=\"universe\")\n 'Hello universe!'\n\n``.silly`` hasn't been registered yet::\n\n >>> templating.render('Hello', '.silly', name=\"test\")\n Traceback (most recent call last):\n ...\n KeyError: '.silly'\n\nLet's now register ``.silly`` from an extension module::\n\n >>> class sillytemplating(FakeModule):\n ... class SillyTemplate(Template):\n ... \"Replace {key} with dictionary values.\"\n ... extension('.silly')\n ... def __init__(self, text):\n ... self.text = text\n ... def render(self, **kw):\n ... text = self.text\n ... for key, value in kw.items():\n ... text = text.replace('{%s}' % key, value)\n ... return text\n >>> from martiantest.fake import sillytemplating\n\nAs you can see, the developer that uses the framework has no need\nanymore to know about ``templating.extension_handlers``. Instead we can\nsimply grok the module to have ``SillyTemplate`` be register appropriately::\n\n >>> reg.grok('sillytemplating', sillytemplating)\n True\n\nWe can now use the ``.silly`` templating engine too::\n\n >>> templating.render('Hello {name}!', '.silly', name=\"galaxy\")\n 'Hello galaxy!'\n\nAdmittedly it is hard to demonstrate Martian well with a small example\nlike this. In the end we have actually written more code than in the\nbasic framework, after all. But even in this small example, the\n``templating`` and ``sillytemplating`` module have become more\ndeclarative in nature. The developer that uses the framework will not\nneed to know anymore about things like\n``templating.extension_handlers`` or an API to register things\nthere. Instead the developer can registering a new template system\nanywhere, as long as he subclasses from ``Template``, and as long as\nhis code is grokked by the system.\n\nFinally note how Martian was used to define the ``TemplateGrokker`` as\nwell. In this way Martian can use itself to extend itself.\n\nGrokking instances\n==================\n\nAbove we've seen how you can grok classes. Martian also supplies a way\nto grok instances. This is less common in typical frameworks, and has\nthe drawback that no class-level directives can be used, but can still\nbe useful.\n\nLet's imagine a case where we have a zoo framework with an ``Animal``\nclass, and we want to track instances of it::\n\n >>> class Animal(object):\n ... def __init__(self, name):\n ... self.name = name\n >>> class zoo(FakeModule):\n ... horse = Animal('horse')\n ... chicken = Animal('chicken')\n ... elephant = Animal('elephant')\n ... lion = Animal('lion')\n ... animals = {}\n >>> from martiantest.fake import zoo\n\nWe define an ``InstanceGrokker`` subclass to grok ``Animal`` instances::\n\n >>> class meta(FakeModule):\n ... class AnimalGrokker(martian.InstanceGrokker):\n ... martian.component(Animal)\n ... def execute(self, instance, **kw):\n ... zoo.animals[instance.name] = instance\n ... return True\n >>> from martiantest.fake import meta\n\nLet's create a new registry with the ``AnimalGrokker`` in it::\n\n >>> reg = martian.GrokkerRegistry()\n >>> reg.grok('meta', meta)\n True\n\nWe can now grok the ``zoo`` module::\n\n >>> reg.grok('zoo', zoo)\n True\n\nThe animals will now be in the ``animals`` dictionary::\n\n >>> sorted(zoo.animals.items())\n [('chicken', ),\n ('elephant', ),\n ('horse', ),\n ('lion', )]\n\nMore information\n================\n\nFor many more details and examples of more kinds of grokkers, please\nsee ``src/martian/core.txt``. For more information on directives see\n``src/martian/directive.txt``.\n\nCHANGES\n*******\n\n1.3.post1 (2019-03-14)\n======================\n\n- Fix rendering of PyPI page.\n\n\n1.3 (2019-03-14)\n================\n\n- Add support for Python 3.7 and 3.8.\n\n\n1.2 (2018-05-09)\n================\n\n- Add a new directive ``martian.ignore()`` to explicitly not grok\n something in a module::\n\n class Example:\n pass\n\n martian.ignore('Example')\n\n- Fix the code to be pep 8 compliant.\n\n1.1 (2018-01-25)\n================\n\n- Bypass bootstrap, add coverage to tox\n\n- Fix ``inspect.getargspec()`` deprecation in python3\n\n\n1.0 (2017-10-19)\n================\n\n- Add support for Python 3.5, 3.6, PyPy2 and PyPy3.\n\n- Drop support for Python 2.6 and 3.3.\n\n\n0.15 (2015-04-21)\n=================\n\n- compatibility for python 3\n- adjust egg to work with newer version of setuptools\n- Fix an encoding issue under Python-2.7 in the doctests.\n\n\n0.14 (2010-11-03)\n=================\n\nFeature changes\n---------------\n\n* The computation of the default value for a directive can now be defined inside\n the directive class definition. Whenever there is a ``get_default``\n classmethod, it is used for computing the default::\n\n class name(Directive):\n scope = CLASS\n store = ONCE\n\n @classmethod\n def get_default(cls, component, module=None, **data):\n return component.__name__.lower()\n\n When binding the directive, the default-default behaviour can still be\n overriden by passing a ``get_default`` function::\n\n def another_default(component, module=None, **data):\n return component.__name__.lower()\n\n name.bind(get_default=another_default).get(some_component)\n\n Making the default behaviour intrinsic to the directive, prevents having to\n pass the ``get_default`` function over and over when getting values, for\n example in the grokkers.\n\n0.13 (2010-11-01)\n=================\n\nFeature changes\n---------------\n\n* Ignore all __main__ modules.\n\n* List zope.testing as a test dependency.\n\n0.12 (2009-06-29)\n=================\n\nFeature changes\n---------------\n\n* Changes to better support various inheritance scenarios in combination with\n directives. Details follow.\n\n* ``CLASS_OR_MODULE`` scope directives will be aware of inheritance of\n values that are defined in module-scope. Consider the following case::\n\n module a:\n some_directive('A')\n class Foo(object):\n pass\n\n module b:\n import a\n class Bar(a.Foo):\n pass\n\n As before, ``Foo`` will have the value ``A`` configured for it. ``Bar``,\n since it inherits from ``Foo``, will inherit this value.\n\n* ``CLASS_OR_MODULE`` and ``CLASS`` scope directives will be aware of\n inheritance of computed default values. Consider the following case::\n\n module a:\n class Foo(object):\n pass\n\n module b:\n import a\n class Bar(a.Foo):\n pass\n\n def get_default(component, module, **data):\n if module.__name__ == 'a':\n return \"we have a default value for module a\"\n return martian.UNKNOWN\n\n When we now do this::\n\n some_directive.bind(get_default=get_default).get(b.Bar)\n\n We will get the value \"we have a default value for module a\". This\n is because when trying to compute the default value for ``Bar`` we\n returned ``martian.UNKNOWN`` to indicate the value couldn't be found\n yet. The system then looks at the base class and tries again, and in\n this case it succeeds (as the module-name is ``a``).\n\n* ``martian.ONCE_IFACE`` storage option to allow the creation of\n directives that store their value on ``zope.interface``\n interfaces. This was originally in ``grokcore.view`` but was of\n wider usefulness.\n\nBugs fixed\n----------\n\n* Ignore things that look like Python modules and packages but aren't.\n These are sometimes created by editors, operating systems and\n network file systems and we don't want to confuse them.\n\n* Ignore .pyc and .pyo files that don't have a matching .py file via\n ``module_info_from_dotted_name`` if its ``ignore_nonsource``\n parameter is ``True``. The default is ``True``. To revert to the\n older behavior where .pyc files were honored, pass\n ``ignore_nonsource=False``.\n\n* Pass along ``exclude_filter`` (and the new ``ignore_nonsource``\n flag) to ModuleInfo constructor when it calls itself recursively.\n\n* Replace ``fake_import`` to import fake modules in tests with a real\n python import statement (``from martiantest.fake import\n my_fake_module``). This works by introducing a metaclass for\n ``FakeModule`` that automatically registers it as a module. The\n irony does not escape us. This also means that\n ``martian.scan.resolve()`` will now work on fake modules.\n\n0.11 (2008-09-24)\n=================\n\nFeature changes\n---------------\n\n* Added MULTIPLE_NOBASE option for directive store. This is like MULTIPLE\n but doesn't inherit information from the base class.\n\n0.10 (2008-06-06)\n=================\n\nFeature changes\n---------------\n\n* Add a ``validateClass`` validate function for directives.\n\n* Moved ``FakeModule`` and ``fake_import`` into a ``martian.testing``\n module so that they can be reused by external packages.\n\n* Introduce new tutorial text as README.txt. The text previously in\n ``README.txt`` was rather too detailed for a tutorial, so has been\n moved into ``core.txt``.\n\n* Introduce a ``GrokkerRegistry`` class that is a ``ModuleGrokker``\n with a ``MetaMultiGrokker`` in it. This is the convenient thing to\n instantiate to start working with Grok and is demonstrated in the\n tutorial.\n\n* Introduced three new martian-specific directives:\n ``martian.component``, ``martian.directive`` and\n ``martian.priority``. These replace the ``component_class``,\n ``directives`` and ``priority`` class-level attributes. This way\n Grokkers look the same as what they grok. This breaks backwards\n compatibility again, but it's an easy replace operation. Note that\n ``martian.directive`` takes the directive itself as an argument, and\n then optionally the same arguments as the ``bind`` method of\n directives (``name``, ``default`` and ``get_default``). It may be\n used multiple times. Note that ``martian.baseclass`` was already a\n Martian-specific directive and this has been unchanged.\n\n* For symmetry, add an ``execute`` method to ``InstanceGrokker``.\n\n0.9.7 (2008-05-29)\n==================\n\nFeature changes\n---------------\n\n* Added a ``MethodGrokker`` base class for grokkers that want to grok\n methods of a class rather than the whole class itself. It works\n quite similar to the ``ClassGrokker`` regarding directive\n definition, except that directives evaluated not only on class (and\n possibly module) level but also for each method. That way,\n directives can also be applied to methods (as decorators) in case\n they support it.\n\n0.9.6 (2008-05-14)\n==================\n\nFeature changes\n---------------\n\n* Refactored the ``martian.Directive`` base class yet again to allow\n more declarative (rather than imperative) usage in grokkers.\n Directives themselves no longer have a ``get()`` method nor a\n default value factory (``get_default()``). Instead you will have to\n \"bind\" the directive first which is typically done in a grokker.\n\n* Extended the ``ClassGrokker`` baseclass with a standard ``grok()``\n method that allows you to simply declare a set of directives that\n are used on the grokked classes. Then you just have to implement an\n ``execute()`` method that will receive the data from those\n directives as keyword arguments. This simplifies the implementation\n of class grokkers a lot.\n\n0.9.5 (2008-05-04)\n==================\n\n* ``scan_for_classes`` just needs a single second argument specifying\n an interface. The support for scanning for subclasses directly has\n been removed as it became unnecessary (due to changes in\n grokcore.component).\n\n0.9.4 (2008-05-04)\n==================\n\nFeatures changes\n----------------\n\n* Replaced the various directive base classes with a single\n ``martian.Directive`` base class:\n\n - The directive scope is now defined with the ``scope`` class\n attribute using one of ``martian.CLASS``, ``martian.MODULE``,\n ``martian.CLASS_OR_MODULE``.\n\n - The type of storage is defined with the ``store`` class attribute\n using one of ``martian.ONCE``, ``martian.MULTIPLE``,\n ``martian.DICT``.\n\n - Directives have now gained the ability to read the value that they\n have set on a component or module using a ``get()`` method. The\n ``class_annotation`` and ``class_annotation_list`` helpers have\n been removed as a consequence.\n\n* Moved the ``baseclass()`` directive from Grok to Martian.\n\n* Added a ``martian.util.check_provides_one`` helper, in analogy to\n ``check_implements_one``.\n\n* The ``scan_for_classes`` helper now also accepts an ``interface``\n argument which allows you to scan for classes based on interface\n rather than base classes.\n\nBug fixes\n---------\n\n* added dummy ``package_dotted_name`` to ``BuiltinModuleInfo``. This\n allows the grokking of views in test code using Grok's\n ``grok.testing.grok_component`` without a failure when it sets up the\n ``static`` attribute.\n\n* no longer use the convention that classes ending in -Base will be considered\n base classes. You must now explicitly use the grok.baseclass() directive.\n\n* The type check of classes uses isinstance() instead of type(). This means\n Grok can work with Zope 2 ExtensionClasses and metaclass programming.\n\n0.9.3 (2008-01-26)\n==================\n\nFeature changes\n---------------\n\n* Added an OptionalValueDirective which allows the construction of\n directives that take either zero or one argument. If no arguments\n are given, the ``default_value`` method on the directive is\n called. Subclasses need to override this to return the default value\n to use.\n\nRestructuring\n-------------\n\n* Move some util functions that were really grok-specific out of Martian\n back into Grok.\n\n0.9.2 (2007-11-20)\n==================\n\nBug fixes\n---------\n\n* scan.module_info_from_dotted_name() now has special behavior when it\n runs into __builtin__. Previously, it would crash with an error. Now\n it will return an instance of BuiltinModuleInfo. This is a very\n simple implementation which provides just enough information to make\n client code work. Typically this client code is test-related so that\n the module context will be __builtin__.\n\n0.9.1 (2007-10-30)\n==================\n\nFeature changes\n---------------\n\n* Grokkers now receive a ``module_info`` keyword argument. This\n change is completely backwards-compatible since grokkers which don't\n take ``module_info`` explicitly will absorb the extra argument in\n ``**kw``.\n\n0.9 (2007-10-02)\n=================\n\nFeature changes\n---------------\n\n* Reverted the behaviour where modules called tests or ftests were skipped\n by default and added an API to provides a filtering function for skipping\n modules to be grokked.\n\n0.8.1 (2007-08-13)\n==================\n\nFeature changes\n---------------\n\n* Don't grok tests or ftests modules.\n\nBugs fixed\n----------\n\n* Fix a bug where if a class had multiple base classes, this could end up\n in the resultant list multiple times.\n\n0.8 (2007-07-02)\n================\n\nFeature changes\n---------------\n\n* Initial public release.\n\nDownload\n********\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/zopefoundation/martian", "keywords": "", "license": "ZPL", "maintainer": "", "maintainer_email": "", "name": "martian", "package_url": "https://pypi.org/project/martian/", "platform": "", "project_url": "https://pypi.org/project/martian/", "project_urls": { "Homepage": "https://github.com/zopefoundation/martian" }, "release_url": "https://pypi.org/project/martian/1.3.post1/", "requires_dist": [ "setuptools", "six", "zope.interface", "zope.testing; extra == 'test'" ], "requires_python": "", "summary": "Embedding of configuration information in Python code.", "version": "1.3.post1" }, "last_serial": 4938579, "releases": { "0.10": [ { "comment_text": "", "digests": { "md5": "decc41cadf6457d6b9379b91c6a75828", "sha256": "19d865e2311283a601fe7692537169ec987713e1fca2550bf9195665f9141196" }, "downloads": -1, "filename": "martian-0.10.tar.gz", "has_sig": false, "md5_digest": "decc41cadf6457d6b9379b91c6a75828", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48284, "upload_time": "2008-06-06T16:08:33", "url": "https://files.pythonhosted.org/packages/98/53/533e5f57d9d4cd5d6abc3cb07a7d276a64c65151d2377f82f19fbf095de3/martian-0.10.tar.gz" } ], "0.11": [ { "comment_text": "", "digests": { "md5": "42274cec8e2931da2538c31242be0c5d", "sha256": "20279b0f8c51905b5c986816c2fe7b3b31189dbf2c94fa7435e10274d473ee28" }, "downloads": -1, "filename": "martian-0.11.tar.gz", "has_sig": false, "md5_digest": "42274cec8e2931da2538c31242be0c5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48447, "upload_time": "2008-09-24T14:12:36", "url": "https://files.pythonhosted.org/packages/f6/25/286540021902c2d7fbb87e7d41da96c713de42b648a47af6ed6fe8e2fbf4/martian-0.11.tar.gz" } ], "0.11.1": [ { "comment_text": "", "digests": { "md5": "0ad291f3df7d4c303b44ce46fe1b9491", "sha256": "48b8d5dbd95ad75e8eb63ac8c78a3185e0348a19677ccce2540bfabe43e2e384" }, "downloads": -1, "filename": "martian-0.11.1.tar.gz", "has_sig": false, "md5_digest": "0ad291f3df7d4c303b44ce46fe1b9491", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48791, "upload_time": "2009-10-07T19:53:08", "url": "https://files.pythonhosted.org/packages/58/70/9b0fe63410e4ccebf28bd3be0201b2f46492c105df626f6d86c2751f4edd/martian-0.11.1.tar.gz" } ], "0.11.2": [ { "comment_text": "", "digests": { "md5": "61932d36aa1c8ff8a986cb980b720dfe", "sha256": "61df5ddfe6fa35fb74f5ca32604a56c95cf110df8ffe81ec52b7cde26374a53d" }, "downloads": -1, "filename": "martian-0.11.2.tar.gz", "has_sig": false, "md5_digest": "61932d36aa1c8ff8a986cb980b720dfe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 50705, "upload_time": "2010-03-17T21:31:51", "url": "https://files.pythonhosted.org/packages/51/18/49de154c2e34408bfc37ea7a48cffede651bcafa061cc84400b1ef71e4aa/martian-0.11.2.tar.gz" } ], "0.11.3": [ { "comment_text": "", "digests": { "md5": "865646fcd9dd31613204d5f4c2db943b", "sha256": "d220c26c41ddb935eefa77e3f424ac82a4fa06dae8fd87c5a233601e38297bf6" }, "downloads": -1, "filename": "martian-0.11.3.tar.gz", "has_sig": false, "md5_digest": "865646fcd9dd31613204d5f4c2db943b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46026, "upload_time": "2010-10-07T14:46:05", "url": "https://files.pythonhosted.org/packages/a1/b0/1a740e419fad55bf65ce09e0ae122d934ff4f916bff3d9349d2a0e4ae9ff/martian-0.11.3.tar.gz" } ], "0.12": [ { "comment_text": "", "digests": { "md5": "bce7d64f867220840d7c152775440888", "sha256": "11f631f86ad2c8edd52f5608733155ec3101d976e24944079c2c01a4674d6e85" }, "downloads": -1, "filename": "martian-0.12.tar.gz", "has_sig": false, "md5_digest": "bce7d64f867220840d7c152775440888", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59078, "upload_time": "2009-06-29T13:47:50", "url": "https://files.pythonhosted.org/packages/bd/b4/e4d3ce784806dc6c476f9961348b1aa246da34cebf78750c3a0a71a18d34/martian-0.12.tar.gz" } ], "0.13": [ { "comment_text": "", "digests": { "md5": "b9ceb43553532af520e3789fabb46999", "sha256": "2b22c9550a5a24089e7d2ff1f3dc0d8b6318841e203ca0452256524a72a2b72a" }, "downloads": -1, "filename": "martian-0.13.tar.gz", "has_sig": false, "md5_digest": "b9ceb43553532af520e3789fabb46999", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 64263, "upload_time": "2010-11-01T20:21:43", "url": "https://files.pythonhosted.org/packages/15/ce/ba9184b65f1059f1d0487599d1105db10f988b2fb95eb906e463e546d062/martian-0.13.tar.gz" } ], "0.14": [ { "comment_text": "", "digests": { "md5": "bca590e83b829a42ec027ab459739665", "sha256": "ec2e86da218233249572024165a00a36bbd24a5e23ce410615f52d84e3a43169" }, "downloads": -1, "filename": "martian-0.14.tar.gz", "has_sig": false, "md5_digest": "bca590e83b829a42ec027ab459739665", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 65320, "upload_time": "2010-11-03T12:56:15", "url": "https://files.pythonhosted.org/packages/c9/19/113faf6e7df352330c5fc17b9549099e4e29810ea2d9ba4c263681eca420/martian-0.14.tar.gz" } ], "0.15": [ { "comment_text": "", "digests": { "md5": "6b6855d5cea2a4cf9ca126305c40cfaa", "sha256": "1076c4268afb1dcc8309a94479e201d9d5cdba374748f0a6b85e6f1f5cbc9ee2" }, "downloads": -1, "filename": "martian-0.15.zip", "has_sig": false, "md5_digest": "6b6855d5cea2a4cf9ca126305c40cfaa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 86041, "upload_time": "2015-04-21T11:10:41", "url": "https://files.pythonhosted.org/packages/7c/eb/eb72a70fc06111064303f9eab3b0ea116e0616fc45b028dfc58c85d303f7/martian-0.15.zip" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "87f30a31aa71059ae0c9a6ee0b1aaf29", "sha256": "916d1ef0d97639e29e7818785749fd1111b1dea225e217dd5f98e53a9848d3f4" }, "downloads": -1, "filename": "martian-0.8-py2.4.egg", "has_sig": false, "md5_digest": "87f30a31aa71059ae0c9a6ee0b1aaf29", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 50465, "upload_time": "2007-07-02T13:20:11", "url": "https://files.pythonhosted.org/packages/28/07/4a0955ef1bbb47bbba60e09a62b1da22fafb0433f88f351db44ecdd02860/martian-0.8-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "047436781414865abb8071d962da8fc1", "sha256": "ee5618bf34066aa546bb30cb6e24e9ab37bb794e63783685fd616b0bab2bd3d8" }, "downloads": -1, "filename": "martian-0.8.tar.gz", "has_sig": false, "md5_digest": "047436781414865abb8071d962da8fc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22264, "upload_time": "2007-07-02T13:20:03", "url": "https://files.pythonhosted.org/packages/d6/44/a2bfdc3cc7e41aa26483f130674fee71c11f6abe8a6cf13d8e4e404ab9ce/martian-0.8.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "604ebd078065f2dbc06f5a716dc2162d", "sha256": "5de46e7b380fd0c4190261a76a62ad5acf95ed78be103ada18de32e57fd744bc" }, "downloads": -1, "filename": "martian-0.8.1-py2.4.egg", "has_sig": false, "md5_digest": "604ebd078065f2dbc06f5a716dc2162d", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 64605, "upload_time": "2007-08-13T19:14:55", "url": "https://files.pythonhosted.org/packages/ca/ba/e1c192e8cd87e50d9c460e391190bd650362f975997a418ae428c7d2c3d4/martian-0.8.1-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "5a40f480b8df55f0f2b819b0983c7ce5", "sha256": "5531309072ada9005ddb468ab2427bb8b66a5b876d72af37d217f49a86ad4c12" }, "downloads": -1, "filename": "martian-0.8.1.tar.gz", "has_sig": false, "md5_digest": "5a40f480b8df55f0f2b819b0983c7ce5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41226, "upload_time": "2007-08-13T19:14:33", "url": "https://files.pythonhosted.org/packages/4e/02/179dfb91ced7e796278ef821f03d272b1091f4a9a8accc76359c48939102/martian-0.8.1.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "695519f557f5c1e3114bdabe9daf839d", "sha256": "6920b5690affcad52df2705f4c891807deb29172c6a0ee16434269c2dca9fe9f" }, "downloads": -1, "filename": "martian-0.9-py2.4.egg", "has_sig": false, "md5_digest": "695519f557f5c1e3114bdabe9daf839d", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 64792, "upload_time": "2007-10-02T12:04:03", "url": "https://files.pythonhosted.org/packages/4c/43/18b3fe342882ad18ec43bcb10f9e328b65655f7a0147faacf71ccc3ba81d/martian-0.9-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "37f98265f69bca3b1a5c4bcf5533e3d4", "sha256": "e7bfc8057e5f06ddf13167e00979837752abaaf03ead45a96807457212ccc7ce" }, "downloads": -1, "filename": "martian-0.9.tar.gz", "has_sig": false, "md5_digest": "37f98265f69bca3b1a5c4bcf5533e3d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 43165, "upload_time": "2007-10-02T12:04:42", "url": "https://files.pythonhosted.org/packages/9c/7a/c642b9920b82ceba7228dae61d0ae42c50f7cc2b820af165efa0329ae423/martian-0.9.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "91d4dbe8f1a34cd0754f1012f9c948f9", "sha256": "afac6b18a017088397bfc4efbe99bfc9859fa1c880f1d0039602aae731e538c1" }, "downloads": -1, "filename": "martian-0.9.1.tar.gz", "has_sig": false, "md5_digest": "91d4dbe8f1a34cd0754f1012f9c948f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44501, "upload_time": "2007-10-30T19:12:34", "url": "https://files.pythonhosted.org/packages/f5/b9/0df403a676ab96fbedebf3314312f1be49356768ecc6f16a588b9e30f815/martian-0.9.1.tar.gz" } ], "0.9.2": [ { "comment_text": "", "digests": { "md5": "e470dd92cfb8c4d0649876ba89022da4", "sha256": "51072d81bf1384f0f70acc6109f03ddb2034918aba46e1091464f986a265b001" }, "downloads": -1, "filename": "martian-0.9.2.tar.gz", "has_sig": false, "md5_digest": "e470dd92cfb8c4d0649876ba89022da4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 43382, "upload_time": "2007-11-20T12:20:57", "url": "https://files.pythonhosted.org/packages/e3/12/407cf4f075e73137a14cd78f4182784f5fc178cb42e6f94c5ddc9a37fdc7/martian-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "e47c56b53775e14edbe1171141d06bc8", "sha256": "8288801a77704992697cdb3245239d59b40409c39223f6bc2bd9852ac62fdb9d" }, "downloads": -1, "filename": "martian-0.9.3.tar.gz", "has_sig": false, "md5_digest": "e47c56b53775e14edbe1171141d06bc8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 43722, "upload_time": "2008-01-26T22:18:14", "url": "https://files.pythonhosted.org/packages/ad/c8/bd9167fbaa78c8d89d8457efe81cb9e06d15c3a0260696b177ea6beaeafb/martian-0.9.3.tar.gz" } ], "0.9.4": [ { "comment_text": "", "digests": { "md5": "1bb0a727931da1c5734dd2120dfd34b0", "sha256": "eda5a7038d65714590a94a9084c302a34f9051a3fc61fa9a75a413044f6f5248" }, "downloads": -1, "filename": "martian-0.9.4.tar.gz", "has_sig": false, "md5_digest": "1bb0a727931da1c5734dd2120dfd34b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 50103, "upload_time": "2008-05-04T14:52:40", "url": "https://files.pythonhosted.org/packages/79/7b/c96d0ab118375f85dd2a2a3fbe67dfbb754004984e6d818e990ea8a3d514/martian-0.9.4.tar.gz" } ], "0.9.5": [ { "comment_text": "", "digests": { "md5": "6639d3d41278b90b25eec79d20f9c8f1", "sha256": "eb5198480cd6148718f12f661cd56320bf11527162d660c41510a4948673af54" }, "downloads": -1, "filename": "martian-0.9.5.tar.gz", "has_sig": false, "md5_digest": "6639d3d41278b90b25eec79d20f9c8f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 49424, "upload_time": "2008-05-04T16:16:41", "url": "https://files.pythonhosted.org/packages/14/0e/889f26e325579a847a6d43d341c6ee26896cbf8e97c9d386a976c2a4ffc9/martian-0.9.5.tar.gz" } ], "0.9.6": [ { "comment_text": "", "digests": { "md5": "98cda711bda0c5f45a05e2bdc2dc0d23", "sha256": "674f40e623143c64834fd5aa8c5a22184bef9ad480e36e90cb6d867f27a0e5f4" }, "downloads": -1, "filename": "martian-0.9.6.tar.gz", "has_sig": false, "md5_digest": "98cda711bda0c5f45a05e2bdc2dc0d23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 53524, "upload_time": "2008-05-14T16:03:42", "url": "https://files.pythonhosted.org/packages/b5/59/feff1ee97a3b78154573d12f5ae92fb346e2ef4d021a83257519cd424041/martian-0.9.6.tar.gz" } ], "0.9.7": [ { "comment_text": "", "digests": { "md5": "4a6775c32fea6d4ef9f877c6196d1b3d", "sha256": "b67e253fb427efaab0381fb43d43a447a86554f93717f265b81850ff3a91e4b6" }, "downloads": -1, "filename": "martian-0.9.7.tar.gz", "has_sig": false, "md5_digest": "4a6775c32fea6d4ef9f877c6196d1b3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 56088, "upload_time": "2008-05-29T10:25:58", "url": "https://files.pythonhosted.org/packages/62/93/2ab3e17f299c2d96c6c9dda2e7af3dc4da7f3fbcb8bffef88ca1cc02798f/martian-0.9.7.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "fb6469610a287e37a5cfce7fd527ad71", "sha256": "214c22cca3ede4ae7df4db3d24bfa979bc32460e6bc14cf4875f4533740d3f7e" }, "downloads": -1, "filename": "martian-1.0.tar.gz", "has_sig": false, "md5_digest": "fb6469610a287e37a5cfce7fd527ad71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 68334, "upload_time": "2017-10-19T06:11:44", "url": "https://files.pythonhosted.org/packages/cb/73/39949ad3760139a24288138db11a4882ee575b8074a3e5f9800c853e5c2d/martian-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "b84d7fdc8dbdbc515b7ee39d03ef8581", "sha256": "08befa989bd327c8e4554108bcd985ad41ce6f3c755e82944d023acd9baa804b" }, "downloads": -1, "filename": "martian-1.1.tar.gz", "has_sig": false, "md5_digest": "b84d7fdc8dbdbc515b7ee39d03ef8581", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 68753, "upload_time": "2018-01-25T08:14:16", "url": "https://files.pythonhosted.org/packages/56/ed/822939ca0028f6f012a871b9bebe2102c2cdc8523f6c565c0ad325cc12e4/martian-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "678afac452bbbc3d1d8184509267f04e", "sha256": "0d945d8a5e1c20c02a2bad2faf97bcadd668e2be2dba18b89912261a08d6a199" }, "downloads": -1, "filename": "martian-1.2.tar.gz", "has_sig": false, "md5_digest": "678afac452bbbc3d1d8184509267f04e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66067, "upload_time": "2018-05-09T11:21:08", "url": "https://files.pythonhosted.org/packages/dd/2e/9836e125cf805037b2d8bc28b67bd2e8a93e37aaf3f9ce6a59bbced05782/martian-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "693011d31b828361ce3cefa2cf6c14bf", "sha256": "d9e33e50fefadf6bad35173b0484bc027829e9d01554f1522578bbbe61079b64" }, "downloads": -1, "filename": "martian-1.3.tar.gz", "has_sig": false, "md5_digest": "693011d31b828361ce3cefa2cf6c14bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66375, "upload_time": "2019-03-14T09:18:27", "url": "https://files.pythonhosted.org/packages/32/70/2c17b1bffd5fd23afdc91a5e47f9b68f92204fbb64213ed692bfec0a2d01/martian-1.3.tar.gz" } ], "1.3.post1": [ { "comment_text": "", "digests": { "md5": "f6dc1ac6882d62c09c29fec8350fb8c3", "sha256": "d05b6f77b54aef45fc60225ade5b7bb0d09ca6e3b6c2a90460714a7d461864e1" }, "downloads": -1, "filename": "martian-1.3.post1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f6dc1ac6882d62c09c29fec8350fb8c3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 76007, "upload_time": "2019-03-14T09:24:35", "url": "https://files.pythonhosted.org/packages/8b/fc/f0e541cdd467df6c43de9045982bdd8772e8b886048c91d84b1565705bb3/martian-1.3.post1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fb8bc2326ec0f7d443ba88be32469c26", "sha256": "f022a54b10f5d2c58ed0e66576226b55c266e1268e73de47fc6c68d3d8cb4c42" }, "downloads": -1, "filename": "martian-1.3.post1.tar.gz", "has_sig": false, "md5_digest": "fb8bc2326ec0f7d443ba88be32469c26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66308, "upload_time": "2019-03-14T09:24:37", "url": "https://files.pythonhosted.org/packages/e3/3a/cb4479706d6f373adccd105593a04c8dd0f3cca8909bc70befd70a184ecf/martian-1.3.post1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f6dc1ac6882d62c09c29fec8350fb8c3", "sha256": "d05b6f77b54aef45fc60225ade5b7bb0d09ca6e3b6c2a90460714a7d461864e1" }, "downloads": -1, "filename": "martian-1.3.post1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f6dc1ac6882d62c09c29fec8350fb8c3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 76007, "upload_time": "2019-03-14T09:24:35", "url": "https://files.pythonhosted.org/packages/8b/fc/f0e541cdd467df6c43de9045982bdd8772e8b886048c91d84b1565705bb3/martian-1.3.post1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fb8bc2326ec0f7d443ba88be32469c26", "sha256": "f022a54b10f5d2c58ed0e66576226b55c266e1268e73de47fc6c68d3d8cb4c42" }, "downloads": -1, "filename": "martian-1.3.post1.tar.gz", "has_sig": false, "md5_digest": "fb8bc2326ec0f7d443ba88be32469c26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66308, "upload_time": "2019-03-14T09:24:37", "url": "https://files.pythonhosted.org/packages/e3/3a/cb4479706d6f373adccd105593a04c8dd0f3cca8909bc70befd70a184ecf/martian-1.3.post1.tar.gz" } ] }