{ "info": { "author": "Mindey", "author_email": "mindey@qq.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: Public Domain", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Utilities" ], "description": ".. image:: https://raw.githubusercontent.com/mindey/subfiles/master/misc/subfiles.png\n :alt: Subfiles Illustration\n :width: 100%\n :align: center\n \n**Make files parsible!**\n\nSay you're editing a wiki using default ``.txt`` files, but you are using some specific syntax, e.g., ``markdown``, or ``zimwiki``, or some other... How can another program know what schema you use in your ``.txt`` files, or your ``.json`` files, ``.xls`` files, any kind of other files? For all what we know, your pogram that you generated your files with might have a specific **version of program**, and the different versions of the program might use **specific schemas** (file formats) for these simple files (records stored in our disks). How do we make sure that the future generation can automatically know what schema was used, and what software can be used to automatically and 100% correctly parse them, or convert them to other types? One way would be to add ``Content-Type`` and ``Softare Version`` to each file. However, what if you want to do that without changing the files or their content? What if these are binary files? Well, the solution proposed here is that you just place ``.ftypes`` file into the directory where your files are, and describe, what these type of files are. for example::\n\n [*.txt]\n \n \n [*.json]\n \n\nThat's the main principle of ``.ftypes`` file. Our files are records in some databases, and if we want to organize them, we have to describe what record types they are...\n\nNow, let's say you have multiple ``.txt`` files in a project, with different kind of internal format. Well, you can describe that in ``.ftypes`` too, if you give them a different subtype name e.g.::\n \n [*.kind1.txt]\n \n \n [*.kind2.txt]\n \n\nWe're introducing something like a second level of file extension here, like a namespacing in file extensions, and ``.ftypes`` is all about utilizing this to encode meaningful meta information, such as the file schema, and the ``subfiles`` package here is just a helper program to find and list all the existing file extensions, sub-extensions, etc. in current directory and all its subdirectories.\n\nSo what?\n--------\n\nSo, now, I simply put the file ``.ftypes`` file in my folder where I keep my ``zimwiki``, and this way say, that my ``.txt`` files have a specific format in that folder, and happily use ZimWiki, knowing that later these files will be automatically convertable to whatever othe format that becomes popular.\n\n\nPurpose\n-------\n\nIntroduce command ``ftypes`` to extract ftypes of files in a directory, so as to have a list of file **sub**-extensions appearing in directory. \n\nUsage\n-----\n\nSet up::\n\n $ pip install subfiles\n\nIn any project, or directory, run to preview what files with subextensions are::\n\n $ ftypes -l [level]\n\nThis will output files grouped by different file sub-extensions in the project. The default ``[level]=2``. You can output standard extensions by choosing ``[level]=1``.\n\nTo preview what the ``.ftypes`` file would be generated, type::\n\n $ ftypes -s [level]\n\nAgain, the default is ``[level]=2``, and if you want to start defining the meaning for the 2nd level subextensions, just do::\n\n $ ftypes -s > .ftypes\n\nThen, edit the generated ``.ftypes`` file to suit your needs, in the following format:\n\nThe basic format of the .subfiles is a wildcard map of file extensions within a ``[]``, an optional short description after double underscores ``__``, more information after it, and a new-line separator between the diffrent file format descriptions, that is:\n\n.. code::\n\n [*.my_type.csv]\n __: SHORT DESCRIPTION\n MORE INFORMATION\n\n [*.my_other_type.json]\n __: SHORT DESCRIPTION\n MORE INFORMATION\n\nCoded this way, it is easy to read with a config parser.\n\n.. code::\n\n # Python3\n import configparser\n config = configparser.ConfigParser()\n config.optionxform=str\n config.read('.ftypes')\n # Sections\n config.sections()\n # Keys\n for key in config['*.my_type.csv']: print(key)\n # Values\n config['*.my_type.csv']['__']\n\n.. code::\n\n # Python2\n import ConfigParser\n config = ConfigParser.RawConfigParser()\n config.optionxform=str\n config.readfp(open('.ftypes'))\n config.get('*.my_type.csv', '__')\n\nHowever, this does not have to be limited to config format, as the 'more information' part could be almost any text.\n\nUsage to Encode Schemas\n-----------------------\nOne very useful case for ``.ftypes``, is encoding the information about the data schemas stored in files with sub-extensions. For this use-case, we might even agree to use a special kind of subtype, which is ``.schema.ftypes``:\n\n.. code::\n\n [*.graph.json]\n __: https://www.wikidata.org/wiki/Q182598\n cat: https://www.wikidata.org/wiki/Q146\n dog: https://www.wikidata.org/wiki/Q144\n love: https://www.wikidata.org/wiki/Q316\n \n [*.products.csv]\n __: https://www.wikidata.org/wiki/Q278425\n url: https://www.wikidata.org/wiki/Q42253\n currency: https://www.wikidata.org/wiki/Q8142\n price: https://www.wikidata.org/wiki/Q160151\n name: https://www.wikidata.org/wiki/Q1786779\n\nIn the schema ftypes we could agree to have the links to concepts, the instance of which the thing in the file of this subextension is.\n\nCustom Schemas\n--------------\n\nIt may be that you are not entirely satisfied with the schema provided by http://schema.org, e.g., or want to define your own schemas in terms of concepts from custom or other ontologies, you could simply include them as a file subtype in your project. You can do it with a ``.ftypes``.\n\n\nWhy?\n----\n\nThe idea here is that our file extensions don't have to end with one dot, and we can create multi-level namespaces for file extensions for all kind of uses based on dot notation. There are many potential uses. For example, you might want to use secondary level extensions represent and map files with schemas of data instances that they contain.\n\nSo, the idea here is to introduce a ``.ftypes`` dot file to contain any metadata that data developer assumes for files with subextensions to carry beyond what the traditional file extension represents to help any other programs or humans to understand the files in any project.\n\nThe ``ftypes`` command is simply a helper to extract **ftypes of files** in a directory, so as to have a list of file \"subextensions\" appearing in directory for any purpose. A subextension is an extension of second or greater level (e.g., ``'hello.world.txt'`` has top level extension ``.txt``, and second level subextension ``.world``).\n\nDevelopment reminder\n====================\n\nTo publish new version on PyPI::\n\n $ python setup.py sdist bdist_wheel\n $ twine upload dist/*\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mindey/subfiles", "keywords": "cli", "license": "UNLICENSE", "maintainer": "", "maintainer_email": "", "name": "subfiles", "package_url": "https://pypi.org/project/subfiles/", "platform": "", "project_url": "https://pypi.org/project/subfiles/", "project_urls": { "Homepage": "https://github.com/mindey/subfiles" }, "release_url": "https://pypi.org/project/subfiles/1.1.1/", "requires_dist": null, "requires_python": "", "summary": "A command line program to generate list of file subextensions.", "version": "1.1.1" }, "last_serial": 4433907, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "7e631b0a32eb1e9c97ecc91d8323d6f1", "sha256": "d3d7749027729f0c83645213e6c8b7cd112f1ef7de8aa57a4876dcd70d8b0fd9" }, "downloads": -1, "filename": "subfiles-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7e631b0a32eb1e9c97ecc91d8323d6f1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4972, "upload_time": "2017-01-25T14:04:42", "url": "https://files.pythonhosted.org/packages/db/02/92831027c263fda53acc78d8fb3e38ffc8de20a1b3bbbb65f554bbb04064/subfiles-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4964177d50e932f7efa0a5e3d2d0f3a7", "sha256": "498aaaf1aa860ad4e9e9d168a1903e9a1622f55f128d242c47b0b13528b1061d" }, "downloads": -1, "filename": "subfiles-1.0.0.tar.gz", "has_sig": false, "md5_digest": "4964177d50e932f7efa0a5e3d2d0f3a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4054, "upload_time": "2017-01-25T14:04:45", "url": "https://files.pythonhosted.org/packages/95/c4/d38591e7ecfac5b3c3f7226a7324f7b03eb4ab086c3713345c444ba9835d/subfiles-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "798482107c36fec24070dc2b40d9761b", "sha256": "54c7770713d1b91b74c0d4ffcf3e70f6ad4b796b0f4351994709451fee902508" }, "downloads": -1, "filename": "subfiles-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "798482107c36fec24070dc2b40d9761b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5050, "upload_time": "2017-01-25T14:18:36", "url": "https://files.pythonhosted.org/packages/9c/71/3065d5a3c293321fb6e7a0f9f059dad9cdf5e8f76ce3ef333c82a9bcbaa0/subfiles-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b12fd713f2c35a4cf832d723f4513559", "sha256": "e09cb5a95dd9eaf15c8c7f88d9882b57b05107170f9306f70afb03c6f588f760" }, "downloads": -1, "filename": "subfiles-1.0.1.tar.gz", "has_sig": false, "md5_digest": "b12fd713f2c35a4cf832d723f4513559", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4002, "upload_time": "2017-01-25T14:18:37", "url": "https://files.pythonhosted.org/packages/51/85/66281cfdda7321876827d9fde606bbcc27e986992a51dad65f067007fc15/subfiles-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "4c01ed425f57b23934d08aae9f497454", "sha256": "c951f13a2f1e8a32ff7d1e6406d5c9e48d988fbcc46abd0b2b909d512bac4628" }, "downloads": -1, "filename": "subfiles-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4c01ed425f57b23934d08aae9f497454", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5579, "upload_time": "2017-01-25T15:35:11", "url": "https://files.pythonhosted.org/packages/88/17/8db893ce293b86aeac4bfa5ac4435f6b57f86a2dae7682414f5a9928b9eb/subfiles-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "510224a2977c81601528e004c5c59095", "sha256": "757235435c7242d0a9590cb1261718f03994b028c56ed320b0be4117df8ddf70" }, "downloads": -1, "filename": "subfiles-1.0.2.tar.gz", "has_sig": false, "md5_digest": "510224a2977c81601528e004c5c59095", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4396, "upload_time": "2017-01-25T15:35:13", "url": "https://files.pythonhosted.org/packages/94/93/724f38be1d9563cb2053f410405e1b4a24a56df0272d6e7db7036ca81920/subfiles-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "dd190dc12fbdbd8db927399cb352eddd", "sha256": "336f22a52c1700bf2ade0bc0da62f1b32d85b909d2555137e0bb2953972ce069" }, "downloads": -1, "filename": "subfiles-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dd190dc12fbdbd8db927399cb352eddd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7738, "upload_time": "2017-01-26T00:20:51", "url": "https://files.pythonhosted.org/packages/ea/2a/b1ad4a813952e6ac18864cffec83035b98f8aab253cf4763ba8f2a12190c/subfiles-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a34afbdf884e8f858a7f91ef7c8a3fb7", "sha256": "fb65306d78531bf72929bedc102d6267de119934994e8fe38836554e332e4040" }, "downloads": -1, "filename": "subfiles-1.0.3.tar.gz", "has_sig": false, "md5_digest": "a34afbdf884e8f858a7f91ef7c8a3fb7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5056, "upload_time": "2017-01-26T00:20:52", "url": "https://files.pythonhosted.org/packages/15/1b/96d1937053ec2b259e15970d79bbe787dd14b11505ea7c96af72eaaa094a/subfiles-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "8d22d28973a40b1190852d58b021e2fc", "sha256": "dcb8ac9d5139f61312966ae41d271de2220ef6c5914e6822b02a0dd46922a32d" }, "downloads": -1, "filename": "subfiles-1.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8d22d28973a40b1190852d58b021e2fc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8039, "upload_time": "2017-01-26T10:07:06", "url": "https://files.pythonhosted.org/packages/4d/13/bdda0aa667ee1c2a0fe57512a5cdde67e736e75a2aea1aecb88e784ea252/subfiles-1.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "40e02e17b358b07289709f7422c49ba3", "sha256": "f1a3077a3d242eb3f75bde69a017f3d9a3fd1e9e16d10767c253836115469e45" }, "downloads": -1, "filename": "subfiles-1.0.4.tar.gz", "has_sig": false, "md5_digest": "40e02e17b358b07289709f7422c49ba3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5242, "upload_time": "2017-01-26T10:07:07", "url": "https://files.pythonhosted.org/packages/4c/2b/99582da9c2b0a2653b6bf23a0c4bbfad94b486a6caa7ff439810c710ffe3/subfiles-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "0d6fd01e2c4cedd1546a1d339cf9b4db", "sha256": "401e195c7b4d043deae22fa06d8a9acb43c3288414a13de2fde17360ab32de70" }, "downloads": -1, "filename": "subfiles-1.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0d6fd01e2c4cedd1546a1d339cf9b4db", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8065, "upload_time": "2017-01-26T10:15:18", "url": "https://files.pythonhosted.org/packages/b7/88/234451352fe4ae7a2d739648c193617be4fadc9179b4357371b06abd8a08/subfiles-1.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9ca06a9afa58f328c550d119a8f47f3b", "sha256": "5b79d679269146a4abc004c1badea6a685d3bd2fadacbadb8d856806bef427a6" }, "downloads": -1, "filename": "subfiles-1.0.5.tar.gz", "has_sig": false, "md5_digest": "9ca06a9afa58f328c550d119a8f47f3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5271, "upload_time": "2017-01-26T10:15:19", "url": "https://files.pythonhosted.org/packages/1c/7c/ac7606d4f61d88f4b133407c6ee97b016df46c937d628c8e6722f8d1e91a/subfiles-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "900e75abe9b09445320b8e785345f131", "sha256": "b7ab675f0eca8a1e348aaf4a35a54615476e5c8ffc542ab0a6fae10f9e6d00b7" }, "downloads": -1, "filename": "subfiles-1.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "900e75abe9b09445320b8e785345f131", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8111, "upload_time": "2017-01-26T10:38:22", "url": "https://files.pythonhosted.org/packages/38/ea/7b78d9eb4b42b36f6c29dbec9d6fd39c198e05155edbd8fa71fb90ecfd8b/subfiles-1.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a8df6572641bc7034903fb93df887363", "sha256": "a8e8749d27751220e369ffea9039eac8b380d7c05a4c7d185666a90878dc1c06" }, "downloads": -1, "filename": "subfiles-1.0.6.tar.gz", "has_sig": false, "md5_digest": "a8df6572641bc7034903fb93df887363", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5302, "upload_time": "2017-01-26T10:38:23", "url": "https://files.pythonhosted.org/packages/05/75/ab879bdbc622c3feb0e9c66df579e5d1722013cd81789059177d9e6771ff/subfiles-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "0167711d0f0d6525817b1c2fab8ddc59", "sha256": "44abd0b318156f6b05e5529d2a98b23095c2bfef7181979faf981bb5dd2dbbb4" }, "downloads": -1, "filename": "subfiles-1.0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0167711d0f0d6525817b1c2fab8ddc59", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9250, "upload_time": "2017-01-27T12:27:48", "url": "https://files.pythonhosted.org/packages/1d/c9/dbe79583b26485347fbba300a2bd3e2d55d7e0423fc9424445efc2a9577a/subfiles-1.0.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "01e5f1affe63b96cc27dba62ef4f5aa7", "sha256": "27d53846b5d342fc1ca1fad7609374dd54838233482900b34cfcf8353ed21616" }, "downloads": -1, "filename": "subfiles-1.0.7.tar.gz", "has_sig": false, "md5_digest": "01e5f1affe63b96cc27dba62ef4f5aa7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4901, "upload_time": "2017-01-27T12:27:49", "url": "https://files.pythonhosted.org/packages/a7/83/1cf37b8af657388d6c9af38ac2419d6900af2377977c35cbb0e99bacea8f/subfiles-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "ade8296e5d5154c63240685236895a5e", "sha256": "96d37b9149c779bf90d8f7f2f1255b20a94b55a56ea65a8e8ba75bfe361dc13c" }, "downloads": -1, "filename": "subfiles-1.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ade8296e5d5154c63240685236895a5e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8682, "upload_time": "2017-01-27T12:44:08", "url": "https://files.pythonhosted.org/packages/23/22/cdf831267692bdd0558194cae0ba88d16724552f7eb109d0f7eaeaa12495/subfiles-1.0.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "113f952d778ca502fc800cb0dc1014eb", "sha256": "b2ededaa5fb672d22fc6de4454cfe06b4727a629c8ce8f7963ba9d496b408584" }, "downloads": -1, "filename": "subfiles-1.0.8.tar.gz", "has_sig": false, "md5_digest": "113f952d778ca502fc800cb0dc1014eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4875, "upload_time": "2017-01-27T12:44:10", "url": "https://files.pythonhosted.org/packages/d1/ca/520bedf37280d5cc0f73b90d543329547569c3cf33b6ec192037b2ff1038/subfiles-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "e68ea95123a88da3cd223bbd31c20e5f", "sha256": "fdeaaa68e37198815cb158669e6a821c8df164b35df544b77f17986ed61074fc" }, "downloads": -1, "filename": "subfiles-1.0.9.tar.gz", "has_sig": false, "md5_digest": "e68ea95123a88da3cd223bbd31c20e5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7451, "upload_time": "2018-10-31T00:58:35", "url": "https://files.pythonhosted.org/packages/e0/df/20cf5f2e43d8d108ee65a8cb1e8534f101934843ef736adb9eef4942a055/subfiles-1.0.9.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "193f9015de5a6d3c24d993ec78e87f2c", "sha256": "e5f08d2aa92cfe7597d403d732314c43bc5b7dbad4caaac6d7b574c5731f194c" }, "downloads": -1, "filename": "subfiles-1.1.0.tar.gz", "has_sig": false, "md5_digest": "193f9015de5a6d3c24d993ec78e87f2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7447, "upload_time": "2018-10-31T01:03:13", "url": "https://files.pythonhosted.org/packages/a5/74/fa1f9046f4c1aa95b2fa739acf4a062d09a933df449efc1c92bc7ef6162b/subfiles-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "745b89735912d00840be1266889752d3", "sha256": "70ad4cd687ff16e3af78e781595a7742bb4d2061df734f48094dac160dd14d14" }, "downloads": -1, "filename": "subfiles-1.1.1.tar.gz", "has_sig": false, "md5_digest": "745b89735912d00840be1266889752d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7446, "upload_time": "2018-10-31T01:05:13", "url": "https://files.pythonhosted.org/packages/f4/f5/6b6c4da19010cbf5635b5b5dc8337d228cbe56d5975bfc815aedf57eb154/subfiles-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "745b89735912d00840be1266889752d3", "sha256": "70ad4cd687ff16e3af78e781595a7742bb4d2061df734f48094dac160dd14d14" }, "downloads": -1, "filename": "subfiles-1.1.1.tar.gz", "has_sig": false, "md5_digest": "745b89735912d00840be1266889752d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7446, "upload_time": "2018-10-31T01:05:13", "url": "https://files.pythonhosted.org/packages/f4/f5/6b6c4da19010cbf5635b5b5dc8337d228cbe56d5975bfc815aedf57eb154/subfiles-1.1.1.tar.gz" } ] }