{ "info": { "author": "Tom Ackland", "author_email": "ackland.thomas@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows :: Windows 10", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Laundry: Folding spreadsheets into neat shapes\n\nSpreadsheets are easy to record and manipulate data with but do a poor job of displaying the data in an easy to read way. Laundry provides a simple way of converting spread data into Word files by by specifying the output document's format within the spreadsheet itself.\n\nLaundry provides two modes in which to generate the Word files:\n\n* Single file mode, where details of a single output file are defined and passed at the CLI, and\n* Multi file mode. where multiple output files can be defined and batched from a worksheet within the orignal Excel spreadheet.\n\nWhile spreadsheets are, in many aspects, similar to database tables, Laundry is only a formatting tool and not a database.\n\n### Overview\n\nA general overview of how Laundry operates is:\n\n1. Having a spreadsheet containing some organised data stored in the `data_worksheet`. There is no restriction on how the data stored is the `data_worksheet` other than it must be a flat table.\n\n2. Defining the output structure within a separate worksheet contained within the spreadsheet. This is known as the `structure_worksheet`.\n\n3. The `structure_worksheet` references data to be formatted by using the the data's column names, the styles contained within the `template_file`, and how the data will be arranged, for example, as a table, paragraph or photo. The `structure_worksheet` does have a specific format that must be used to ensure that the conversion process takes place. \n\n4. A `template_file` Word document (`.docx` file) is used as the basis of the output file. This file will contain the styles that will be used to format the output file.\n\n5. If a batch process is desired a `batch_worksheet` will be required to define the above requirements.\n\n6. The app is run using the command line interface (CLI). This is as easy as:\n\n - `laundry single -t `, or\n - `laundry multi `\n\n## Running the App\n\nLaundry is operated from the commeand line, so if you're not familiar with command line then you'll need to familarise youself with it first.\n\nThere are two ways of running Laundry, single mode and and multi mode. \n\nSingle mode will convert a single `data_worksheet` into a `output_file` based on the `template_file` using the structure defined in the `structure_worksheet`. You may need to define the `data-header` if the data is not in the first row of the `data_worksheet`.\n\nMulti mode allows one or more `output_files` based on information defined in the `format_worksheet`. This mode still requires the same information as single mode but it is stored within a worksheet in the `input_file`.\n\n## Manual\n\n### Input File\n\nThe `input_file` is the spreadsheet that contains the data to be formatted and exported to the `output_file`.\n\nThe `input_file` __must__ contain worksheets that contain:\n\n* The structure or output formatting requirements of the output file: this is the `structure_worksheet`.\n* When the `multi` sub-command a `format_worksheet` is required to allow the batch operation to take place.\n\nThe `input_file`'s data is stored in the `data_worksheet`. This worksheet can be given any name provided it doesn't clash with the `structure_worksheet` name.\n\n### Structure Worksheet\n\nA `structure worksheet` must be defined for each output file that will be produced. In `single` mode the worksheet is assumed to be associated with the `data worksheet` that is passed to the app. In `multi` mode a single `structure worksheet` can be used for multiple output files, however it must be explicitly referenced for each output file. \n\nThe following column names __must__ implemented in the `structure_worksheet`. If they are not used the app will not work.\n\n#### `sectiontype`\nThis defines the type of section that will be inserted with the output document. The top-to-bottom order will determine the order of the types in the `output_file`. The options that are currently supported are:\n\n- `para`: This will insert a paragraph with the column header being the paragraph title styled using the style defined in `sectionstyle`.\n\n- `table`: Will insert a table that contains the data contained in `sectioncontains` cell with the table column containing the same column heading as the original data (with any underscores removed).\n\n- `heading`: Will use the data contained within the cell as a section heading made up of a title (column heading) and a paragraph (cell contents).\n\n- `photo`: Inserts one or more photos (images) into the paragraph. Multiple images can be added by including them in the `sectioncontains` column. The `photo` column heading is used to provide a file path to the directory containing the files. Including the photo's file extension is not required. The app will sequence through a number of popular formats before providing an error message to the standard output and adding the error message to the output document.\n\n#### `sectioncontains`\nThis contains one or more of the column names used in the `data` worksheet. Multiple column names can be used with `table` using `sectiontypes` provided the are separated by `new lines` (alt + enter) in the cell, or commas. `new lines` are the preferred method.\n\n#### `sectionstyle`\nThis Word *style* contained within the `template_file`'s `.docx` file. If this style is not in the `template_file` then Word's default styles will be used. *This is a limitation of Word*.\n\n#### `titlestyle`\nThe Word formatting style to be used for titles within the document. This column does not apply to tables.\n\n#### `sectionbreak`\nMust be either `True` or `False`. If `True` it will insert an empty paragraph provide a visual break between it and the following paragraph.\n\n#### `pagebreak`\nMust be either `True` or `False`. If `True` it will insert a page break (that is, start a new page) after the paragraph. This is useful for clearly separating information that is related to different `data_worksheet` rows.\n\n##### `path`\nThis defines the relative file path to the directory (folder) containing the photos. All photos referenced in the cell must be stored in the same directory.\n\n### `sectiontype` Limits\n\nEach of the `sectiontypes` have some limit regarding their operation.\n\n- Where `heading` is used it should be a single column heading per paragraph.\n\n- Where `paragraph` is used it should be a single column heading per paragraph.\n\n- `table` can use any number of columns headings. Each column heading should be separated by a `newline` (preferred option) or by a comma (`,`).\n\n- `sectionstyles` _can_ only be a single value. This is a string (text) that can contain spaces. Make sure that the spelling and capitalisation is correct.\n\n- `titlestyles` _can_ only be a single value. This is a string (text) that can contain spaces. Make sure that the spelling and capitalisation is correct.\n\n- `pagebreak` is a `True`/`False` value.\n\n## Arranging Spreadsheet Data\n\nThe following applies to the both `sinlge` and `multi` subcommands.\n\n### `data_worksheet`\n\nThe `data_worksheet` contains the data that will be formatted into the `output_file`.\n\n1. The column headers should be in row 0 (that is, the first row) in the worksheet. If not, \n\n * When using `single` sub-command the `--data-head` option must to be used, *and* the row number specified. For example if the column headers start on row 5:\n\n `laundry single -df=5 -t `\n\n * When using `multi` mode the row must be recorded in the `header row` column.\n\n `laundry multi -f `\n\n2. Do not use numbers for column header names. This will cause problems.\n\n3. Column header names *should* avoid spaces, and either use underscores (`_`) or use camel case (`ThisIsAnExampleOfCamelCase`). Stick numbers at the end of the names if you need numbers in the name.\n\n4. If you want multiple paragraphs or bullet points, or more than one image, then use alt-enter in an Excel cell to allow this to take place.\n\n5. Include the file extension (for example `.jpg`, `.png`) when entering including images in the cell. File extensions are part of the file name and the app expects them to be included.\n\n### `structure_worksheet`\n\n1. The column headers must be in row 0 (that is, the first row) in the worksheet. If not, the app will not work.\n\n2. The `sectiontype` must be one of the following:\n\n - `photo`\n - `para`\n - `table`\n - `heading`\n\n3. `table` sections do not require a value for `titlestyle`.\n\n4. `photo` sections do not require a value for `titlestyle` or `sectionstyle`, however they do require `path` to be completed.\n\n5. `sectionbreak` and `pagebreak` must be `TRUE` or `FALSE`.\n\n### `batch_worksheet`\n\nThe `batch_worksheet` defines the requirements for each of the output files. The spreadsheet will require a row for each file that is to be output.\n\n#### `data_worksheet` requirements\n\nThis is the name of the `data_worksheet` that contains the data to be exported as described above. \n\n#### `structure_worksheet` requirements\n\nThe`structure_worksheet`defines how the output file will be structured. This is the same as described above.\n\n#### `header_row` requirements\n\nThe number of the row that defines the header row in the `data_worksheet`. This functionally identical to the `-dh` flag used with the `single` sub-command as described above.\n\n#### `remove_columns` requirements\n\nNot currently used.\n\n#### `drop_empty_columns` requirements\n\nNot currently used.\n\n#### `template_file` requirements\n\nThe name of the `.docx`file being used as the template for the output file. Different template files can be used provided that the are all stored in the directory that the `laundry` command is run from.\n\n#### `filter_rows`\n\nThis allows rows to be filtered from the output file by only including the rows that meet the criteria defined in the filter. More than one row can be specified to filter by.\n\nThe row requires a particular format `:`. The heading row must be separated from the filter criteria by a colon (`:`). The filters criteria *must* be separated by commas (`,`), and each row must be separated by a newline (`alt-enter` in Excel).\n\nThe filter criteria must be _identical_ to the cell values. If the criteria can take different forms, that either:\n- All forms must be included in the filter, or\n- Correct all the values so that they take common form (probably the better option). \n\n#### `output_file`\n\nThe name of the file that is produced by the app. The file will be saved in the directory that the app is run from. The file name can be a relative or absolute file path.\n\n## FAQs\n\nThe following is a list of commonly experienced issues.\n\n### I get something containing `KeyError` and what looks like a column header\n\nThe likely culprit is an incorrectly spelt column header in the `structure_worksheet` or you haven't allowed for the conversion of underscores (`_`) replacing spaces within the column headers.\n\n\n### Something like `No sheet named <[some_worksheet_name]>`\n\nCheck the `data_worksheet` and `structure_worksheet` names that you've used when running the app from the CLI. Check for spelling mistakes.\n\n### `Error: Invalid value for \"input_file\"` appears\n\nCheck the spelling of the `input_file`'s name and that the file path is correct. The app will check that the `input_file` exists before attempting to run the app.\n\n### `AttributeError: 'int' object has no attribute 'lower'`\n\nThe likely issue here is the column headers are not contained in the first row of the `data_worksheet`. Also check that none of the column headers are numbers.\n\n### `Error: Invalid value for \"--template\" / \"-t\": Path \"[some_path_&_filename].docx\" does not exist.`\n\nThe `template_file` filename is incorrect. This could also be the path to the file. Check both.\n\n### I have a heap of formatted empty pages at the bottom of my `converted_file`.\n\nFor each row of your `data_worksheet` that contains some data the app will produce a formatted section. By removing all the rows that you don't want at the bottom of the `data_worksheet` you can prevent this from occurring. There is a way to drop rows that are missing data, however this requires some work to enable this feature.\n\n### `KeyError: \"no style with name '[some_Word_style]'\"`\n\nThe Word formatting style is not present in the `template_file`. Check that the style name matches exactly its name in Word.\n\nSome Word styles appear to be concatenations of other styles within Word, e.g. 'Heading 3, List'. These styles don't work as expected and the reason for this has not been determined.\n\n### How do I use a specific Word style?\n\nDue to limitations with Word user specific styles need to be saved to the `template_file` for them to be available. If the specified name is not present in the `template_file` then the app will not function.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tomackl/laundry", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "laundry", "package_url": "https://pypi.org/project/laundry/", "platform": "", "project_url": "https://pypi.org/project/laundry/", "project_urls": { "Homepage": "https://github.com/tomackl/laundry" }, "release_url": "https://pypi.org/project/laundry/2019.0.6/", "requires_dist": [ "Click", "Pandas", "python-docx", "pyjanitor" ], "requires_python": ">=3.6", "summary": "Folding spreadsheets into neat shapes.", "version": "2019.0.6" }, "last_serial": 5434014, "releases": { "2019.0.2": [ { "comment_text": "", "digests": { "md5": "bfc0a66bd9488f07ee6689ef406fe333", "sha256": "fa415591d4678b83afcfdf53723507b80b99720c0e9f151b3289180791bff737" }, "downloads": -1, "filename": "laundry-2019.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bfc0a66bd9488f07ee6689ef406fe333", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 12472, "upload_time": "2019-04-29T11:13:57", "url": "https://files.pythonhosted.org/packages/08/c1/37d32bff59a92dedd67d6296f03c0f32d2de0336c19293d2a10831315a2f/laundry-2019.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0871f865d0e1b6b6013304a8b68ecef6", "sha256": "8a37e0a15e09478759429c6b17c3bb999b8cf7e5e88a69cfef68ceb9dba5fffc" }, "downloads": -1, "filename": "laundry-2019.0.2.tar.gz", "has_sig": false, "md5_digest": "0871f865d0e1b6b6013304a8b68ecef6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8954, "upload_time": "2019-04-29T11:14:21", "url": "https://files.pythonhosted.org/packages/12/66/5f109968af131a0d405fde20c6ef3d7d17f0006c5288f0f9d361063e4a20/laundry-2019.0.2.tar.gz" } ], "2019.0.3": [ { "comment_text": "", "digests": { "md5": "09de53942c062847656de37b4e9be22a", "sha256": "28c630104b80594c424e69726c115e5d4f53a88f9ebd09281d96bef76a478c6c" }, "downloads": -1, "filename": "laundry-2019.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "09de53942c062847656de37b4e9be22a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 12472, "upload_time": "2019-04-29T11:19:22", "url": "https://files.pythonhosted.org/packages/76/7f/2f7081b359e64df05efd03d84c204d10c502d3e3d0feb23d5759935a1f35/laundry-2019.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1669672e5ec53bdfb0b51d7bfbe1e90a", "sha256": "16d162f22093124e8d0356d3594790e4f6fc8dab5e957666ff125ec034d829be" }, "downloads": -1, "filename": "laundry-2019.0.3.tar.gz", "has_sig": false, "md5_digest": "1669672e5ec53bdfb0b51d7bfbe1e90a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8953, "upload_time": "2019-04-29T11:19:29", "url": "https://files.pythonhosted.org/packages/21/a2/b3c9783aa1aea4b7b4075cc98eef1ed871c388cccbfc0d95e9333e8a694e/laundry-2019.0.3.tar.gz" } ], "2019.0.4": [ { "comment_text": "", "digests": { "md5": "abb3f112371acc542d9273cf004f9313", "sha256": "33cfdad894960d61b8bfab6b5bbcb648ccd9672208b141e1260eb6d60e8e2543" }, "downloads": -1, "filename": "laundry-2019.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "abb3f112371acc542d9273cf004f9313", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 12833, "upload_time": "2019-05-13T10:26:38", "url": "https://files.pythonhosted.org/packages/de/88/3066934b8bf630add3d2746f43053461130f360d2567443d61d03e7bd4b3/laundry-2019.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e956408c63641f73ae13516b5cf25723", "sha256": "56e957619d439117667dee857d4bc49f7101defd161d704ec933bddb3508fa03" }, "downloads": -1, "filename": "laundry-2019.0.4.tar.gz", "has_sig": false, "md5_digest": "e956408c63641f73ae13516b5cf25723", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9310, "upload_time": "2019-05-13T10:26:41", "url": "https://files.pythonhosted.org/packages/a4/97/071fb9d18250164e5877d88c64901ca139dabfc6fb23e55684ff32af6835/laundry-2019.0.4.tar.gz" } ], "2019.0.5": [ { "comment_text": "", "digests": { "md5": "c300a2088b852a7d6429e5e0a5655466", "sha256": "c32a0b6a01e3cc8cb5545e8a1512ae6a7076fcf564865fbc216c516a3ffd27a4" }, "downloads": -1, "filename": "laundry-2019.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c300a2088b852a7d6429e5e0a5655466", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 14550, "upload_time": "2019-06-05T07:59:35", "url": "https://files.pythonhosted.org/packages/cb/9c/a0ab96ca60b2749c90d9b208098f09f7d3da566a55f2e5d7bc0d390f5841/laundry-2019.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a1572d478bd0f6e11755cd2aeabf3d34", "sha256": "aa59d3f18dfee0fb04f95cfe6c7eeff1d81630ab70c13be6a449fafeb443588d" }, "downloads": -1, "filename": "laundry-2019.0.5.tar.gz", "has_sig": false, "md5_digest": "a1572d478bd0f6e11755cd2aeabf3d34", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 14653, "upload_time": "2019-06-05T07:59:48", "url": "https://files.pythonhosted.org/packages/7f/16/9b51fdbe9f21f17d2d2e82490c706e4d578f220823880bced1b23617a5c0/laundry-2019.0.5.tar.gz" } ], "2019.0.6": [ { "comment_text": "", "digests": { "md5": "55c1efe39c520ca68c4720a48eea1279", "sha256": "fb78e3e198a2dfe4c2bbcbc111dd8e331e53ba85170fb9bbb32ff314fdf7b565" }, "downloads": -1, "filename": "laundry-2019.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "55c1efe39c520ca68c4720a48eea1279", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 15380, "upload_time": "2019-06-22T07:12:26", "url": "https://files.pythonhosted.org/packages/01/0e/c69636829ee812128963f0d980e069351d6132355ebd32b5b57c0a53393a/laundry-2019.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "965175fa60bfd70476df6a2570f03265", "sha256": "79b51df71b08e71de0f1ab1adc30b984899d8a800c831f2a5125d83167d844cc" }, "downloads": -1, "filename": "laundry-2019.0.6.tar.gz", "has_sig": false, "md5_digest": "965175fa60bfd70476df6a2570f03265", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 15718, "upload_time": "2019-06-22T07:12:28", "url": "https://files.pythonhosted.org/packages/6f/87/2059e8e4cdb02afcbc52ee69e68e16124e08f815e9ec1bb8bd13636b2381/laundry-2019.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "55c1efe39c520ca68c4720a48eea1279", "sha256": "fb78e3e198a2dfe4c2bbcbc111dd8e331e53ba85170fb9bbb32ff314fdf7b565" }, "downloads": -1, "filename": "laundry-2019.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "55c1efe39c520ca68c4720a48eea1279", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 15380, "upload_time": "2019-06-22T07:12:26", "url": "https://files.pythonhosted.org/packages/01/0e/c69636829ee812128963f0d980e069351d6132355ebd32b5b57c0a53393a/laundry-2019.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "965175fa60bfd70476df6a2570f03265", "sha256": "79b51df71b08e71de0f1ab1adc30b984899d8a800c831f2a5125d83167d844cc" }, "downloads": -1, "filename": "laundry-2019.0.6.tar.gz", "has_sig": false, "md5_digest": "965175fa60bfd70476df6a2570f03265", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 15718, "upload_time": "2019-06-22T07:12:28", "url": "https://files.pythonhosted.org/packages/6f/87/2059e8e4cdb02afcbc52ee69e68e16124e08f815e9ec1bb8bd13636b2381/laundry-2019.0.6.tar.gz" } ] }