{ "info": { "author": "Yuri V. Yakovlev", "author_email": "krotos139@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# pytemplate - \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432\n\n\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f latex, xetex, \u0438 \u0434\u0440.) \u0438\u043b\u0438 ODF \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0438 \u043d\u0430\u0431\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445.\n\n\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0443, \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u041f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432.\n\n\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044f\u0437\u044b\u043a \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 Jinja2, \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u043d\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438, \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432.\n\n\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445:\n* CSV \u0442\u0430\u0431\u043b\u0438\u0446\u0430 (\u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432 Exel \u043f\u0440\u0438 \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b)\n* XML \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\n* \u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b\n* SQLite \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445\n* \u0424\u0443\u043d\u043a\u0446\u0438\u044f MD5 \u043e\u0442 \u0444\u0430\u0439\u043b\u0430\n* \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0444\u0430\u0439\u043b\u0435\n\n# \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445\n\n## load_xml\n\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 XML \u0444\u0430\u0439\u043b\u0430\n\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 - \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430\n\u0412\u043e\u0437\u0440\u0430\u0449\u0430\u0435\u0442 - root element\n\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:\n```\n {%- set root = load_xml(\"database1.xml\") %}\n {%- for item in root.findall(\"hardware/i\") %}\n {{ item.find(\"name\").text }} & {{ item.find(\"sign\").text }} / {{ item.find(\"version\").text }} & {{ item.find(\"fullname\").text }} \\\\\\hline\n {%- endfor %}\n```\n\n## load_csv\n\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 CSV \u0444\u0430\u0439\u043b\u0430\n\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 - \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430\n\u0412\u043e\u0437\u0440\u0430\u0449\u0430\u0435\u0442 - \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\n\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:\n```\n {%- set docs = load_csv(\"database2.csv\") %}\n {%- for item in docs %}\n {{ item.id }} & {{ item.name }} & {{ item.ref }} & {{ item.sign }} & {{ item.inv }} \\\\\\hline\n {%- endfor %}\n```\n\n## load_sqlite\n\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 SQLite \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445\n\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 - \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430\n\u0412\u043e\u0437\u0440\u0430\u0449\u0430\u0435\u0442 - \u043a\u0443\u0440\u0441\u043e\u0440\n\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:\n```\n {%- set db = load_sqlite(\"database3.sqlite\") %}\n {%- set alboum = db.execute(\"select * from Album\") %}\n {%- for item in alboum %}\n {{ item[0] }} & {{ le(item[1]) }} \\\\\\hline\n {%- endfor %}\n```\n\n## load_text\n\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430\n\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 - \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430\n\u0412\u043e\u0437\u0440\u0430\u0449\u0430\u0435\u0442 - \u0441\u0442\u0440\u043e\u043a\u0443\n\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:\n```\n {%- set content = load_text(\"database4.txt\") %}\n {{ content }}\n```\n\n## file_md5\n\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u0444\u0430\u0439\u043b\u0430\n\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 - \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430\n\u0412\u043e\u0437\u0440\u0430\u0449\u0430\u0435\u0442 - \u0441\u0442\u0440\u043e\u043a\u0443\n\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:\n```\n {%- set md5 = file_md5(sourcefile) %}\n {{md5}}\n```\n\n## file_stat\n\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0444\u0430\u0439\u043b\u0435 (\u0440\u0430\u0437\u043c\u0435\u0440)\n\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 - \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430\n\u0412\u043e\u0437\u0440\u0430\u0449\u0430\u0435\u0442 - \u043e\u0431\u044a\u0435\u043a\u0442, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f:\n* st_mode - protection bits,\n* st_ino - inode number,\n* st_dev - device,\n* st_nlink - number of hard links,\n* st_uid - user id of owner,\n* st_gid - group id of owner,\n* st_size - size of file, in bytes,\n* st_atime - time of most recent access,\n* st_mtime - time of most recent content modification,\n* st_ctime - platform dependent; time of most recent metadata change on Unix, or the time of creation on Windows)\n* st_blocks - number of 512-byte blocks allocated for file\n* st_blksize - filesystem blocksize for efficient file system I/O\n* st_rdev - type of device if an inode device\n* st_flags - user defined flags for file\n* st_gen - file generation number\n* st_birthtime - time of file creation\n* st_ftype (file type)\n* st_attrs (attributes)\n* st_obtype (object type).\n\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:\n```\n {%- set stat = file_stat(sourcefile) %}\n {{ stat.st_size }}\n```\n\n## log\n\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0440\u0438 \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\n\u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 - \u0441\u0442\u0440\u043e\u043a\u0430\n\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:\n```\n {%- do log(\"Add alboum %s (authorid=%d)\" % (item[1], item[2])) %}\n```\n\n## getargs\n\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438\n\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 - \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043d\u0430 python \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 \"arg\"\n\n# \u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b\nUsage: pytemplate.py [options]\n\u041e\u043f\u0446\u0438\u0438:\n* --version \n\u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e\n* -h, --help\n\u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043b\u044e\u0447\u0430\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\n* -t TEMPLATE, --template=TEMPLATE \n\u0423\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\n* -o OUTPUT, --output=OUTPUT\n\u0423\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u0434\u043e \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430\n* -f FORMAT, --format=FORMAT\n\u0424\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (odt \u0438 text)\n* -a ARG, --arg=ARG\n\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430\n\n# \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432:\n* Latex document: [IN](/examples/out_doc1.tex) + [IN 1](/examples/out_doc1_part1.template.tex) + [IN 2](/examples/out_doc1_part2.template.tex) + [IN 3](/examples/out_doc1_part3.template.tex) + [IN 4](/examples/out_doc1_part4.template.tex) + [IN 5](/examples/out_doc1_part5.template.tex) -> [OUT](/examples/output/out_doc1.pdf)\n* ODT document: [IN](/examples/out_doc2.odt) -> [OUT](/examples/output/out_doc2_ready.odt)", "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/krotos139/pytemplate", "keywords": "jinja2 odt text template", "license": "GPL v3", "maintainer": null, "maintainer_email": null, "name": "pytemplateproc", "package_url": "https://pypi.org/project/pytemplateproc/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pytemplateproc/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/krotos139/pytemplate" }, "release_url": "https://pypi.org/project/pytemplateproc/0.4.2/", "requires_dist": null, "requires_python": null, "summary": "Template processor", "version": "0.4.2" }, "last_serial": 2035494, "releases": { "0.4": [ { "comment_text": "", "digests": { "md5": "6517846e2be588a05e18a4906c054ca8", "sha256": "f4ef6d865621b130523ec59ab00dceb02382cc362d4b6e425f23c3aa6fa8f8c7" }, "downloads": -1, "filename": "pytemplateproc-0.4.tar.gz", "has_sig": false, "md5_digest": "6517846e2be588a05e18a4906c054ca8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13876, "upload_time": "2016-03-29T13:37:00", "url": "https://files.pythonhosted.org/packages/13/e5/a9d971ea8bc36e380afa3add57db4ca3f9439eb8d12729b4cb34c3aeeca2/pytemplateproc-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "10bafa0f878660b485c3ba665f9e2ee1", "sha256": "22c83d7b6ed751439ccdafc8ad4d0852148f917127ec1a42d249a57d5991fb60" }, "downloads": -1, "filename": "pytemplateproc-0.4.1.tar.gz", "has_sig": false, "md5_digest": "10bafa0f878660b485c3ba665f9e2ee1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9822, "upload_time": "2016-03-29T13:44:20", "url": "https://files.pythonhosted.org/packages/36/46/1717e2ec71efd979fd07dfc80eca0acbf0105126dbbfdd92c095e978c8a1/pytemplateproc-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "e5b228e1ecc78dc64f73c58d082bc177", "sha256": "84223c0b38fcd4340f26a9ef6d929f213ac4b1f9700c19c3c0f75015ba07cfbe" }, "downloads": -1, "filename": "pytemplateproc-0.4.2.tar.gz", "has_sig": false, "md5_digest": "e5b228e1ecc78dc64f73c58d082bc177", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14919, "upload_time": "2016-03-30T08:14:56", "url": "https://files.pythonhosted.org/packages/6a/30/86a12a8a4065f6e59b437ffabbd8ed56e55ec47bb9dd0a69a5b2ca5dabd5/pytemplateproc-0.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e5b228e1ecc78dc64f73c58d082bc177", "sha256": "84223c0b38fcd4340f26a9ef6d929f213ac4b1f9700c19c3c0f75015ba07cfbe" }, "downloads": -1, "filename": "pytemplateproc-0.4.2.tar.gz", "has_sig": false, "md5_digest": "e5b228e1ecc78dc64f73c58d082bc177", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14919, "upload_time": "2016-03-30T08:14:56", "url": "https://files.pythonhosted.org/packages/6a/30/86a12a8a4065f6e59b437ffabbd8ed56e55ec47bb9dd0a69a5b2ca5dabd5/pytemplateproc-0.4.2.tar.gz" } ] }