{ "info": { "author": "Druta Ruslan", "author_email": "r.druta@dekart.com", "bugtrack_url": null, "classifiers": [], "description": "Module name: script_create_pdf.py\n\nPackage: reportlab\nDocs: https://www.reportlab.com/docs/reportlab-userguide.pdf\nCyrillic fonts: http://code.activestate.com/recipes/438817-how-to-use-cyrillic-fonts-in-reportlab-pdf-library/\n\nIn this module are `GeneratePdf` class, on every init\n\n1) We give to attribute `table` of the class a list with lists of x1,x2,y1,y2 params\nthis params create table borders, there are two type of borders in, and out:\n\n +------------------------+ <- out\n |+----------------------+|\n || <- in ||\n || ||\n || ||\n |+----------------------+|\n +------------------------+\n\n# dont change values of table manualy in __init__: it is default params\n to create first table borders in left top side of pdf page\n# or change it if you know what do to\nexample : of params \ntable = [\n #out\n [15,785,248,785], # top horizontal line\n [15,660,248,660], # bottom horizontal line\n [15,785,15,660], # left horizontal line\n [248,785,248,660], # right horizontal line\n #in\n [18,782,245,782], # top horizontal line\n [18,663,245,663], # bottom horizontal line\n [18,782,18,663], # left horizontal line\n [245,782,245,663] # right horizontal line\n]\n\n\n2) We give to attribute `table_info` of the class params where will be setup our \n table information\n\nDefault table information are in this position, also created in\nleft top side of the pdf page\n\n# coords for table info\nself.table_info = {\n # key : value[x1,x2]\n 'name': [128, 750],\n 'price_str': [28, 700],\n 'currency': [220, 700],\n 'firm': [19, 667],\n 'barcode': [128, 687],\n 'date_str': [152, 667],\n 'date': [202, 667],\n 'price': [215, 702],\n 'total': [242, 677]\n}\n\n### Important ### this default values are in __init__ method, they are given by default when class are init,\n don't move this default values from __init__ method to simple class attributes, because we will rewrite this values in gen() method\n and if this values will be in class attributes but not in __init__ method wi will take not default params, but changed params that was \n changed last time.\n\n3) init params\n 3.1) path_dir: where to save PDF file\n 3.2) product_list: a list of product objects\n product_lists example:\n [{\n 'name': 'Dorna',\n 'barcode': 2345,\n ....\n }]\n\n4) call gen() method\n\nHow it works:\n we use for loop statment to go through all `product_lists`,\n draw first table_info with default params and also draw first table borders ( this will be on top left side )\n\n in for statment we check if `x` # x is the number of current product object in for statment, \n if `x % 12 == 0` this mean that if `x == 12` we already create 12 tables and we need to create another\n pdf page to continue our table draws, for this we execute `canvas.showPage()` method, it will create another\n clear pdf page where we need to draw() another tables, \n\n another if is `x % 6 == 0` this means that if `x == 6` we need to create a table on the top, but how we know what \n table we need to draw ? on the left side or on the right side, for this in this if statment we have another \n if statment, where we check if `table[0][0] == 365` that means that we already created the top right side table\n and now we need to create a left one, if `table[0][0] != 365` we create a table on top left side\n\n after this checks on each iteration we go down and draw our table borders and table info \n\n save() it and it is all.\n\n Total: we have 6 table on the left side and 6 on ther right side\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "gen-pdf-prices", "package_url": "https://pypi.org/project/gen-pdf-prices/", "platform": "", "project_url": "https://pypi.org/project/gen-pdf-prices/", "project_urls": null, "release_url": "https://pypi.org/project/gen-pdf-prices/0.0.5/", "requires_dist": [ "reportlab" ], "requires_python": "", "summary": "Generate pdf file with prices", "version": "0.0.5" }, "last_serial": 4057989, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "87206202f2a33b7659088e9b5d5a4884", "sha256": "cd1c0b8f6794cbad7c9c4ea32d0b88d93c6f20934e751483f07f7299dbd8e156" }, "downloads": -1, "filename": "gen_pdf_prices-0.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "87206202f2a33b7659088e9b5d5a4884", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 4403, "upload_time": "2018-06-28T13:21:08", "url": "https://files.pythonhosted.org/packages/92/d0/646017aba922f8245ecc411c0a83e6ead4047d1e5dd5d9a0993711de0b9d/gen_pdf_prices-0.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "10518b404f0f54404aa1590fdcbcc2f0", "sha256": "7db28886f1914c6ffeda7353cecbc05cd6a68530f11ee12d6748d149f5a43adf" }, "downloads": -1, "filename": "gen_pdf_prices-0.0.1.tar.gz", "has_sig": false, "md5_digest": "10518b404f0f54404aa1590fdcbcc2f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3884, "upload_time": "2018-06-28T13:21:10", "url": "https://files.pythonhosted.org/packages/b6/96/faff7476f42a029a979036bb0371afbd18105230b572b3b712fb7a39dab6/gen_pdf_prices-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "02484ce4cdf819889ae244f4aa3c1ecc", "sha256": "65cd8018e53156a7ccb4c9aad4bfbd9a468092414b7bdac4fb7e8e9cd991e5a0" }, "downloads": -1, "filename": "gen_pdf_prices-0.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "02484ce4cdf819889ae244f4aa3c1ecc", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 5520, "upload_time": "2018-07-13T13:03:18", "url": "https://files.pythonhosted.org/packages/15/b5/82751f7a38e2c98c68ebf8b4f85a9230c7301566baca049c2c8f402b9cdd/gen_pdf_prices-0.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "34abaccfd528fe65d321c4bd571310d0", "sha256": "e19c8c1b88e0147746fcc64de8c78318fc9bd21b3e82b705ede3e6892c4ac3a7" }, "downloads": -1, "filename": "gen_pdf_prices-0.0.2.tar.gz", "has_sig": false, "md5_digest": "34abaccfd528fe65d321c4bd571310d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5017, "upload_time": "2018-07-13T13:03:20", "url": "https://files.pythonhosted.org/packages/27/6a/303866bfa11b1a4f72f4e523cdcd96f95ca1228b4a46af22389a1da7271d/gen_pdf_prices-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "97f33d1f7b53c2b9da74c54fb48cdcbb", "sha256": "f066bc76505e73f36cd4ea68cd6471a4d5d77b40094a87b3c9ce852e6053fda7" }, "downloads": -1, "filename": "gen_pdf_prices-0.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "97f33d1f7b53c2b9da74c54fb48cdcbb", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 79328, "upload_time": "2018-07-13T13:29:45", "url": "https://files.pythonhosted.org/packages/8c/f5/4cf553aac2266719cada1545b8a94b2366c0e7746660181fdee27b487233/gen_pdf_prices-0.0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf49238c035eebc4aac630ecc16d95ae", "sha256": "482b735a3b4b9a051098914cf4ed0d83bba7833d9ed743d126f8773a99dcf354" }, "downloads": -1, "filename": "gen_pdf_prices-0.0.3.tar.gz", "has_sig": false, "md5_digest": "cf49238c035eebc4aac630ecc16d95ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 79715, "upload_time": "2018-07-13T13:29:47", "url": "https://files.pythonhosted.org/packages/9d/44/b91ff981a8c08d5bdbf9bdc1d4831fd9333c1324d2617c312d56e5c11d27/gen_pdf_prices-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "0a1637260090086253a43ede0f2231dc", "sha256": "4304f4733933909aa82b4c51e7bd950d9b7e491449dd4c545f1a59b734c00d03" }, "downloads": -1, "filename": "gen_pdf_prices-0.0.4-py2-none-any.whl", "has_sig": false, "md5_digest": "0a1637260090086253a43ede0f2231dc", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 79336, "upload_time": "2018-07-13T13:47:50", "url": "https://files.pythonhosted.org/packages/b2/8d/2d1135562a150b8e757d491806943ddd640e34c5f54f685f3b9b744fb7c3/gen_pdf_prices-0.0.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6a2be82a65ef77579efd4e863381581", "sha256": "8fd6ff856a30d7af73a5ce752b0ede5dfb018eefa58fa399ba196bc3fb5e7214" }, "downloads": -1, "filename": "gen_pdf_prices-0.0.4.tar.gz", "has_sig": false, "md5_digest": "b6a2be82a65ef77579efd4e863381581", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 79742, "upload_time": "2018-07-13T13:47:52", "url": "https://files.pythonhosted.org/packages/ae/f5/9151fd4d78d61219eaeea9d8a95c04b055790bf6200d75b5e03a31090a5a/gen_pdf_prices-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "b7d2aa432b7daf4004ef45b4461122eb", "sha256": "67369e54147fe61a244b9c4588d77a8795ffda9c5026062c6b28a5fb4627c1d7" }, "downloads": -1, "filename": "gen_pdf_prices-0.0.5-py2-none-any.whl", "has_sig": false, "md5_digest": "b7d2aa432b7daf4004ef45b4461122eb", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 79333, "upload_time": "2018-07-13T13:54:53", "url": "https://files.pythonhosted.org/packages/9f/9a/45dbc5b2cd04f5ebd6b37c6cedc6a06cf1264ed93e11c989b4278d51d342/gen_pdf_prices-0.0.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "25227bb7947d2c8cd37a49df4d45c830", "sha256": "97f9736ccea4e5e3768433ad878966011614cc546cc2fb7a8cb260cfc9e703e8" }, "downloads": -1, "filename": "gen_pdf_prices-0.0.5.tar.gz", "has_sig": false, "md5_digest": "25227bb7947d2c8cd37a49df4d45c830", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 79741, "upload_time": "2018-07-13T13:54:54", "url": "https://files.pythonhosted.org/packages/1b/07/250df7696b34954ac8fc4cc1c2321c76302db76d5e5613989155655057ca/gen_pdf_prices-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b7d2aa432b7daf4004ef45b4461122eb", "sha256": "67369e54147fe61a244b9c4588d77a8795ffda9c5026062c6b28a5fb4627c1d7" }, "downloads": -1, "filename": "gen_pdf_prices-0.0.5-py2-none-any.whl", "has_sig": false, "md5_digest": "b7d2aa432b7daf4004ef45b4461122eb", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 79333, "upload_time": "2018-07-13T13:54:53", "url": "https://files.pythonhosted.org/packages/9f/9a/45dbc5b2cd04f5ebd6b37c6cedc6a06cf1264ed93e11c989b4278d51d342/gen_pdf_prices-0.0.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "25227bb7947d2c8cd37a49df4d45c830", "sha256": "97f9736ccea4e5e3768433ad878966011614cc546cc2fb7a8cb260cfc9e703e8" }, "downloads": -1, "filename": "gen_pdf_prices-0.0.5.tar.gz", "has_sig": false, "md5_digest": "25227bb7947d2c8cd37a49df4d45c830", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 79741, "upload_time": "2018-07-13T13:54:54", "url": "https://files.pythonhosted.org/packages/1b/07/250df7696b34954ac8fc4cc1c2321c76302db76d5e5613989155655057ca/gen_pdf_prices-0.0.5.tar.gz" } ] }