{ "info": { "author": "Samuele Santi", "author_email": "samuele@samuelesanti.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Topic :: Utilities" ], "description": "################################\nConfiguration generator\n################################\n\n\nThis project was born to generate dhcp/dns configuration files on a machine\nwhich resources are too limited to run a LDAP server.\n\nWhat it basically does is:\n\n* Load a bunch of files from a directory, and make them accessible in\n a dictionary.\n* Render a bunch of files through some template engine, passing the context.\n\n\n.. image:: https://travis-ci.org/rshk/config-gen.png\n :alt: Build status\n :target: https://travis-ci.org/rshk/config-gen\n\n\n\nInstallation\n============\n\nProduction version::\n\n $ pip install config-gen\n\nDevelopment version::\n\n $ pip install -e git+git@github.com:rshk/config-gen.git#egg=config-gen\n\nOr just run ``python setup.py install`` from the source directory.\n\n\nTrying out\n==========\n\nThe fastest way to get started with config-gen is the quickstart script,\nthat takes care of creating all the needed directories plus a Makefile,\nin the current directory::\n\n $ confgen-quickstart\n $ make\n $ cat build/example.html\n

Hello, world!

\n\n\nHow does it work?\n=================\n\nIn a very simple way: all files in the ``templates`` directory are built\ninto files in ``build``, with the original extension stripped. Eg::\n\n templates/hello.jinja -> build/hello\n templates/hello.html.jinja -> build/hello.html\n templates/example.html.jinja -> build/example.html\n\nThe context for rendered files is built from files in the ``data`` directory.\nTo each file in that directory, a \"reader\" is associated, by reading the\nfile extension.\n\nThen, a context variable with the same name of the file (without extension)\nwill be made available in the template.\n\n\nIncluded readers\n================\n\nReaders are used to read data files and make them accessible\nin the template context.\n\nTheir name (without extension) must be unique all around the ``data``\ndirectory, to prevent conflicts.\n\n**txt** (``config_gen.readers.read_txt.txt_reader``)\n Loads a plain text file, returning its raw content directly.\n\n\n**py** (``config_gen.readers.read_py.PyFileAccessor``)\n Loads and returns a Python module.\n\n The module content will then be fully accessible from the template.\n\n\n**json** (``config_gen.readers.read_json.json_reader``)\n Reads a JSON file and returns it directly. It will then be accessible as\n usual from the template.\n\n\n**csv** (``config_gen.readers.read_csv.csv_reader``)\n Reads a Comma-Separated Values file into a list of tuples.\n\n The CSV file must be comma-separated (semicolons are not supported). Fields\n containing commas must be enclosed in double quotes.\n\n\n**ini** (``config_gen.readers.read_ini.IniFileReader``)\n Reader for configuration/.ini files.\n\n Files will be accessible as::\n\n {{ filename.section.option }}\n\n Or, for sections/options containing dots::\n\n {{ filename[\"my.sect.ion\"][\"my.opt.ion\"] }}\n\n\nTemplate engines\n================\n\nTo render the templates into configuration files, the awesome Jinja2_\ntemplate engine has been used.\n\nI once thought about allowing pluggable template engines, but the\nawesomeness of Jinja made me rethink that decision :)\n\n(By the way, just let me know if you'd absolutely need support for\nanother template engine, and why..)\n\n.. _Jinja2: http://jinja.pocoo.org/\n\n\nTesting\n=======\n\nTo run the complete test suite::\n\n $ python -m unittest discover -s tests\n\nTo run only tests in a specific sub-module::\n\n $ python -m unittest tests.test_something\n\n\nTODO-List\n=========\n\n* Add support for XML/YAML files\n* Add support for database connections (sqlite, mysql, postgres, mongo..)\n* Add support for \"custom cases\", through some kind of configuration file\n * Eg. for semicolon-separated CSV files\n* Add support for importing external readers (add a ``--load`` option?)\n* Write the missing test cases\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rshk/config-gen", "keywords": null, "license": "GNU General Public License v3 or later (GPLv3+)", "maintainer": null, "maintainer_email": null, "name": "Config-gen", "package_url": "https://pypi.org/project/Config-gen/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Config-gen/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/rshk/config-gen" }, "release_url": "https://pypi.org/project/Config-gen/1.0-alpha6/", "requires_dist": null, "requires_python": null, "summary": "Utility to generate configuration files", "version": "1.0-alpha6" }, "last_serial": 829114, "releases": { "1.0-alpha4": [ { "comment_text": "", "digests": { "md5": "8ca42a006e2848976a185ccfc9a3db2b", "sha256": "3fb2bcf89bf52a4ddc9da65e097bb989bf93bc0bd1cdf6aa756fcc1488e36274" }, "downloads": -1, "filename": "Config-gen-1.0-alpha4.tar.gz", "has_sig": false, "md5_digest": "8ca42a006e2848976a185ccfc9a3db2b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4615, "upload_time": "2013-02-21T00:01:10", "url": "https://files.pythonhosted.org/packages/56/ae/0d8604d376a7fd53819c3d619db12dbf4655483e6fe059d99e5695f0b669/Config-gen-1.0-alpha4.tar.gz" } ], "1.0-alpha5": [ { "comment_text": "", "digests": { "md5": "759cf6c1ac5687bc33c253d884c43a24", "sha256": "fbee36df73b7d2d799351392cbea99f65660882ec9b12a81f5fbde03384c95bc" }, "downloads": -1, "filename": "Config-gen-1.0-alpha5.tar.gz", "has_sig": false, "md5_digest": "759cf6c1ac5687bc33c253d884c43a24", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4815, "upload_time": "2013-02-21T00:58:00", "url": "https://files.pythonhosted.org/packages/71/0c/310e15eb9811ba5ecfa24f4d96de2dfe95f0b1f036be4a29acf243d09f67/Config-gen-1.0-alpha5.tar.gz" } ], "1.0-alpha6": [ { "comment_text": "", "digests": { "md5": "74e88890e3e96022655fd3ad5551acba", "sha256": "e409e8c42dbb2a58123735c176826612a9a79f532298c4fc45f472ec997cad8c" }, "downloads": -1, "filename": "Config-gen-1.0-alpha6.tar.gz", "has_sig": false, "md5_digest": "74e88890e3e96022655fd3ad5551acba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7090, "upload_time": "2013-07-31T10:15:30", "url": "https://files.pythonhosted.org/packages/84/9a/ec8327b904fad4a37a485d301e8226abe1ba81f410c6513f3c3935a7b405/Config-gen-1.0-alpha6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "74e88890e3e96022655fd3ad5551acba", "sha256": "e409e8c42dbb2a58123735c176826612a9a79f532298c4fc45f472ec997cad8c" }, "downloads": -1, "filename": "Config-gen-1.0-alpha6.tar.gz", "has_sig": false, "md5_digest": "74e88890e3e96022655fd3ad5551acba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7090, "upload_time": "2013-07-31T10:15:30", "url": "https://files.pythonhosted.org/packages/84/9a/ec8327b904fad4a37a485d301e8226abe1ba81f410c6513f3c3935a7b405/Config-gen-1.0-alpha6.tar.gz" } ] }