{ "info": { "author": "Jeff Hammel", "author_email": "k0scist@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "pyloader\n===========\n\nLoad python attributes from strings\n\nJSON Format\n-----------\n\npyloader uses a JSON-serializable format for the canonical\n(serializable) form of python objects::\n\n {'foo': # (arbitrary) object name,\n {'args': ['positional', 'arguments'],\n 'kwargs': {'keyword': 'arguments},\n 'path': 'dotted.or.file.path:ObjectName'},\n 'bar': ... } # etc \n\nObjects are instantiated like::\n\n ObjectName(*args, **kwargs)\n\nIn the case that the object is not to be instantiated (e.g. a\nstandalone function, ``args`` and ``kwargs`` will either not be\npresent or will be None (``null`` in JSON).\n\n\nINI Format\n----------\n\npyloader also features an INI format which is translated to the JSON\nFormat but adds a few convenience features. A simple object is\nexpressed as::\n\n [foo:dotted.or.file.path:ObjectName]\n . = positional, arguments\n keyword = arguments\n\n``.`` expresses positional arguments which is a comma-separated\nlist. The remaining (key, value) pairs become keyword arguments. The\nsection name contains the object name (e.g. ``foo``) followed by a\n``:`` followed by a loading path. Like JSON, a dotted path or a file\npath may be used. In addition, other (pluggable) loading paths are\navailable:\n\n- override loader: you can use a section name like ``[foo:bar]`` to\n override variables from the ``bar`` object with variables from\n ``foo``::\n\n [foo:bar]\n . = cats, dogs\n type = count\n\n [bar:%(here)s/some/path.py:MyObject]\n . = elephants\n type = concatenate\n\n The above results in a JSON blob for foo like::\n\n {'foo': {'args': ['elephants', 'cats', 'dogs'],\n 'kwargs': {'type': 'concatenate'},\n 'path': '/location/of/ini/file/some/path.py:MyObject'}}\n\n ``args`` is extended. ``kwargs`` will be overridden.\n\n- wrappers: in addition to the override pattern, you can also wrap an\n object::\n\n [foo:bar:baz]\n\n This will create an object, ``foo`` which wraps the object ``baz`` in\n by the pattern given by ``bar``. In this case, ``bar`` is provided\n a special variable, `%(app)s`.\n\n You can also do::\n\n [foo:bar:hi,hello,x=1,y=2:%(here)/objects.py:MyClass]\n\n\nIn addition, .ini files may include other .ini files. This allows for\nencapsulation of intent of specific .ini files::\n\n [include:%(here)s/some/file.ini]\n\nINI files have a few convenience variables:\n\n- %(here)s : the location of the directory the .ini file lives in\n- %(object)s : used for wrappers\n\nAdditional variables may be provided by the consumer.\n\nSummary of .ini decorator syntax\n--------------------------------\n\n1. ``[foo:%(here)s/objects.py:MyClass]``: create object ``foo`` of type\n ``MyClass`` using arguments given from the section\n\n2. ``[foo:bar]``: create object ``foo`` using the pattern from section\n ``bar`` but overriding any arguments in the ``bar`` section with\n those from this section \n\n3. ``[foo:bar:%(here)s/objects.py:MyClass]``: create object ``foo``\n which is an instance of ``MyClass`` wrapped in the object created by\n the ``bar`` pattern. ``bar`` is passed a special argument,\n ``%(object)s`` which is the instance of the wrapped object (the\n ``MyClass`` instance). Internally, the wrapped object is known by\n the whole section name (``foo:bar:%(here)s/objects.py:MyClass``). The \n arguments in this section apply to ``MyClass(...)``\n\n4. ``[foo:bar:app=%(object)s,value=1:%(here)s/objects.py:MyClass]``:\n the same as 3. but override the values in the ``bar`` section with\n ``app=%(object)s`` and ``value=1``\n\nSection Name Syntax\n-------------------\n\n- *[name:resource]* : create an object named *name* , where resource\n is either a section name or a *path* as described in `JSON Format`_ .\n In the case where *resouce* is another section name, the options\n will overide the options given in the *resource* section and a new\n object named *name* will be created. In the case where *section* is\n a path, an object will be created as given by the *path* with the\n given options.\n- *[name:decorator:resource]* : create an object named *name* where\n the object given by *resource* is passed to *decorator*. Overrides\n and loading is as described for *[name:reource]* . An anonymous\n object is created of the whole section name for the wrapped\n object. So this form results in two sections for the `JSON Format`_ .\n *decorator* is a section in the same namespace as *name*.\n- *[name:decorator:overrides:resource]* : similar to\n *[name:decorator:resource]* , but apply *overides* to the\n *decorator* section. *overrides* is a string of the format\n ``foo,bar,fleem=5``.\n\n----\n\nJeff Hammel\nhttp://k0s.org/\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://k0s.org/hg/pyloader", "keywords": "", "license": "MPL", "maintainer": "", "maintainer_email": "", "name": "pyloader", "package_url": "https://pypi.org/project/pyloader/", "platform": "", "project_url": "https://pypi.org/project/pyloader/", "project_urls": { "Homepage": "http://k0s.org/hg/pyloader" }, "release_url": "https://pypi.org/project/pyloader/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "Load python attributes from a string", "version": "0.1.4" }, "last_serial": 2799947, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "94cb763c30b7016c8d45480f3fff0ff3", "sha256": "82c159dd2d47d4850c0f136bdf5a784d659863b37f779d3f7679d1f4df52e32b" }, "downloads": -1, "filename": "pyloader-0.1.tar.gz", "has_sig": false, "md5_digest": "94cb763c30b7016c8d45480f3fff0ff3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1587, "upload_time": "2011-05-03T17:08:01", "url": "https://files.pythonhosted.org/packages/99/32/e3dcd12a856ec5e7c845431a2f84e7d51695d0ae95f1aac7ecbe3d7a5fbd/pyloader-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e638f27f80895129bd6a56beebae7f7c", "sha256": "490c48ff3a8679d94df3205022df1d6599c27e0c06303bcc0ee0cbca481dfe82" }, "downloads": -1, "filename": "pyloader-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e638f27f80895129bd6a56beebae7f7c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1620, "upload_time": "2011-05-03T23:31:26", "url": "https://files.pythonhosted.org/packages/f7/f5/d89727c1f1e35cf45730c2a948964f65e94f7ebbccbad6fcab656e2d910e/pyloader-0.1.1.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "7edd2fb8ce5c9dd13b4f1fa3aa1a07c9", "sha256": "bcd5c5935eb87f9e449192c0f128a4103dfce609fc6ac9cb1e45377ab38176be" }, "downloads": -1, "filename": "pyloader-0.1.3.tar.gz", "has_sig": false, "md5_digest": "7edd2fb8ce5c9dd13b4f1fa3aa1a07c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8044, "upload_time": "2011-07-29T02:00:23", "url": "https://files.pythonhosted.org/packages/07/8b/0b813250652bd110a091a972ac8f8eed2621d21f9887eea5df9e380c7478/pyloader-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "f43280f6f088b69ebd723363bb326a6b", "sha256": "4af67b1ee2115e3e90191849ff95c859e7db725d70a46d09f69faa729b0236e9" }, "downloads": -1, "filename": "pyloader-0.1.4.tar.gz", "has_sig": false, "md5_digest": "f43280f6f088b69ebd723363bb326a6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8116, "upload_time": "2017-04-12T19:41:43", "url": "https://files.pythonhosted.org/packages/75/4a/377dd444de6f7f651b10294ea86b041e71fbb56e2cd8d2c26ba462a206ae/pyloader-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f43280f6f088b69ebd723363bb326a6b", "sha256": "4af67b1ee2115e3e90191849ff95c859e7db725d70a46d09f69faa729b0236e9" }, "downloads": -1, "filename": "pyloader-0.1.4.tar.gz", "has_sig": false, "md5_digest": "f43280f6f088b69ebd723363bb326a6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8116, "upload_time": "2017-04-12T19:41:43", "url": "https://files.pythonhosted.org/packages/75/4a/377dd444de6f7f651b10294ea86b041e71fbb56e2cd8d2c26ba462a206ae/pyloader-0.1.4.tar.gz" } ] }