{ "info": { "author": "Nikita Sivakov", "author_email": "cryptomaniac.512@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Python static API generator\n===========================\n\n|Build Status| |Coverage Status| |Python versions| |PyPi|\n\nThis library allows you to generate from source text files a static API\nas json-files.\n\nHow it works\n------------\n\n\"Core\" of library is the ``APIGenerator`` that finds the source files\nfor converting in the specified directory, passes them to the loader,\nand writes converted content of them to the target directory.\n\nLoader is a class that takes a path to a file with a supported\nextension, performs data conversion, and returns the resulting\ndictionary (``dict``), which after that will be accepted by the\ngenerator and written to the destination file as json.\n\nTo develop your own loaders, a basic one is implemented ``BaseLoader``\nthat describes the basic logic for working with files, validation and\nsimple conversion. As an example implemented ``TxtLoader``, it supports\nthe processing of txt-files.\n\nUsage examples\n--------------\n\n.. code:: python\n\n from static_api_generator.generator import APIGenerator\n from static_api_generator.loaders import TxtLoader\n\n\n api_gen = APIGenerator('/home/user/some_text_files/', '/home/user/static_api/', TxtLoader)\n api_gen.generatre()\n\nTxt files located in ``/home/user/some_text_files/`` will be written as\njson to a directory ``/home/user/static_api/`` with the hierarchy saved.\n\nIf the source text file looks like this\n\n::\n\n ---\n title: What is Lorem Ipsum?\n category: Lorem Ipsum\n ...\n Lorem Ipsum is simply dummy text of the printing and typesetting industry.\n Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.\n It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.\n It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\n\nthen the conversion result will be\n\n.. code:: json\n\n {\n \"title\": \"What is Lorem Ipsum?\",\n \"category\": \"Lorem Ipsum\",\n \"content\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry.\\nLorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.\\nIt has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.\\nIt was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\"\n }\n\nYou can notice that the source files can contain additional metadata in\nthe yaml format, separated ``---`` at the beginning and ``---`` or\n``...`` at the end. For metadata reading used\n`PyYaml `__, which means the conversion\nis completely in accordance with yaml. For example, metadata can contain\nnested dictionaries, lists, and so on.\n\nWhat for?\n---------\n\nI wanted to write myself a static blog, which I could host, for example,\non GitHub Pages. The best option I thought was\n`Pelican `__, but that means\nreturning to the past with html template layout, while I wanted an\ninterface on a reactive framework (like Vue.js) with the ability to\ndesign components and re-use them.\n\nFor the frontend, I decided to use Nuxt.js, because it knows how to\ngenerate static, but there was a need for an API. To avoid the need to\ndeploy a server with the API, I started developing this library.\n\n.. |Build Status| image:: https://travis-ci.org/cryptomaniac512/python-static-api-generator.svg?branch=master\n :target: https://travis-ci.org/cryptomaniac512/python-static-api-generator\n.. |Coverage Status| image:: https://coveralls.io/repos/github/cryptomaniac512/python-static-api-generator/badge.svg\n :target: https://coveralls.io/github/cryptomaniac512/python-static-api-generator\n.. |Python versions| image:: https://img.shields.io/badge/python-3.6-blue.svg\n.. |PyPi| image:: https://img.shields.io/badge/PyPi-0.0.2-yellow.svg\n :target: https://pypi.python.org/pypi/static_api_generator", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cryptomaniac512/python-static-api-generator", "keywords": "static api generator", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "static-api-generator", "package_url": "https://pypi.org/project/static-api-generator/", "platform": "", "project_url": "https://pypi.org/project/static-api-generator/", "project_urls": { "Homepage": "https://github.com/cryptomaniac512/python-static-api-generator" }, "release_url": "https://pypi.org/project/static-api-generator/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "Library for generating static API", "version": "0.0.2" }, "last_serial": 4849241, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b64707f14a4621e4cd4458696e0197c9", "sha256": "c94b7ad63158011f8e63456e3e7c2ea420d848c1994ed9e43a81eaa30c1d024c" }, "downloads": -1, "filename": "static_api_generator-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b64707f14a4621e4cd4458696e0197c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5584, "upload_time": "2017-10-23T10:12:01", "url": "https://files.pythonhosted.org/packages/d7/0e/596aea7f199f3fda068ddc0df195b49c1f18898cd3cab092854fc927773f/static_api_generator-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "0d8bd51a4f79f9ebae4244c61a5533ef", "sha256": "1b0cad97fb235efdbc085f7e0e11329b1af8c2ecf54a8347f1f0d8f68895bb7a" }, "downloads": -1, "filename": "static_api_generator-0.0.2.tar.gz", "has_sig": false, "md5_digest": "0d8bd51a4f79f9ebae4244c61a5533ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5715, "upload_time": "2017-10-29T12:44:19", "url": "https://files.pythonhosted.org/packages/71/94/43958041fdc47daacef9849de2410bff8a16aa02f48e12f57e10757ec0cb/static_api_generator-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0d8bd51a4f79f9ebae4244c61a5533ef", "sha256": "1b0cad97fb235efdbc085f7e0e11329b1af8c2ecf54a8347f1f0d8f68895bb7a" }, "downloads": -1, "filename": "static_api_generator-0.0.2.tar.gz", "has_sig": false, "md5_digest": "0d8bd51a4f79f9ebae4244c61a5533ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5715, "upload_time": "2017-10-29T12:44:19", "url": "https://files.pythonhosted.org/packages/71/94/43958041fdc47daacef9849de2410bff8a16aa02f48e12f57e10757ec0cb/static_api_generator-0.0.2.tar.gz" } ] }