{ "info": { "author": "Matt O.", "author_email": "matt@mattscodecave.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development", "Topic :: Utilities" ], "description": "# Py3tftp\n\nPy3tftp is an asynchronous [TFTP][1] server written in Python 3.5. It was written for the pure joy of working with Python 3 and implements [RFC 1350][2] (except _mail_ mode), [RFC 2347][3] (options), [RFC 2348][4] (blksize option), [RFC 2349][5] (timeout, tsize), and [RFC 7440][10] (windowsize) for RRQ. Additionally, it supports block number roll over, so files of any size can be transferred over.\n\nWhile a toy project, it does adhere to enough of the standards to be useful in real life.\n\nSome Py3k stuff it uses:\n- asyncio - [Transports and Protocols][6] for networking.\n- asyncio - [Tasks][7] for spinning up extra handlers.\n- [New unpacking methods][8] - some sweet stuff right there (3.5+)\n- [Tracebacks attached to exceptions][9] - woo!\n- Strings are now bytes because all text is unicode\n\n### Installation\n\n```\npip install py3tftp\n```\n\n### Usage\n\nInvoking pyt3tftp will start a server that will interact with the current working directory - it will read and write files from it so don't run it in a place with sensitive files!\n\nTFTP has no security features, except for its simplicity:\n- It won't overwrite files.\n- Won't create non-existant directories.\n- Cannot write outside of the directory it's running from.\n\n```\nusage: py3tftp [-h] [--host HOST] [-p PORT] [--ack-timeout ACK_TIMEOUT]\n [--timeout TIMEOUT] [-l FILE_LOG] [-v] [--version]\n\noptional arguments:\n -h, --help show this help message and exit\n --host HOST IP of the interface the server will listen on.\n Default: 0.0.0.0\n -p PORT, --port PORT Port the server will listen on. Default: 9069. TFTP\n standard-compliant port: 69 - requires superuser\n privileges.\n --ack-timeout ACK_TIMEOUT\n Timeout for each ACK of the lock-step. Default: 0.5.\n --timeout TIMEOUT Timeout before the server gives up on a transfer and\n closes the connection. Default: 3.\n -l FILE_LOG, --file-log FILE_LOG\n Append output to log file.\n -v, --verbose Enable debug-level logging.\n --version\n```\n\n#### Testing\n\nI wrote some simple acceptance tests in `tests/acceptance/*_test.py`. The code is messy as it's meant to be thrown away.\n\n```\n# runs the server with python -m py3tftp\n# runs unittests under tests/\n# kills the server\n./.travis/run.sh\n```\n\n#### Extending py3tftp\n\nThe way that this module works is that there's a subclass of `BaseTFTPServerProtocol` scheduled on the IO loop that listens for incoming TFTP requests and decides what kind of `BaseTFTPProtocol` to schedule on the IO loop to handle the incoming request.\n\nThe way this works in the default scenario is that `TFTPServerProtocol` listens to incoming requests. When a request comes in, it selects either the `WRQProtocol` or the `RRQProtocol` to create a task in the IO loop and passes the request to the selected protocol upon instantiation. From then on, the instantiated protocol handles all of the communication with the client and the _TFTPServerProtocol_ goes back to listening for requests.\n\nThis amazing diagram illustrates the above process in the case of a RRQ request:\n\n![py3tftp rrq process diagram](tftp_graph.png)\n\nExtending py3tftp is as easy as:\n\n- Subclassing `BaseTFTPServerProtocol`, mainly to implement the `select_protocol` method to select your custom protocol.\n- Subclassing either `RRQProtocol` or `WRQProtocol` to implement your own logic (new options, file handling, etc.) for standard WRQ and RRQ requests, OR...\n- Subclassing `BaseTFTPProtocol` to implement your own logic for a custom type of request.\n\n#### Roadplan\n\n- ~~fix off-by-one blksize error ie. if you transfer a file 1000 bytes long and set blksize to 1000 bytes, the server won't ack it.~~\n- ~~Pull out file reader/writer from protocol classes~~.\n- ~~Add tsize from RFC 2349~~ (added by schrd).\n- Add ~~blksize~~, ~~timeout~~, and tsize tests.\n- Possibly implement RFCs 906 and 951 for fun!\n- Refactor the code, get rid of some duplication, optimize some low-hanging fruit.\n\n#### LICENSE\n\nThe MIT License (MIT)\n\nCopyright (c) 2016-2018 sirMackk\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n[1]: https://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol\n[2]: https://tools.ietf.org/html/rfc1350\n[3]: https://tools.ietf.org/html/rfc2347\n[4]: https://tools.ietf.org/html/rfc2348\n[5]: https://tools.ietf.org/html/rfc2349\n[6]: https://docs.python.org/3/library/asyncio-protocol.html\n[7]: https://docs.python.org/3/library/asyncio-task.html#task\n[8]: https://www.python.org/dev/peps/pep-0448/\n[9]: http://legacy.python.org/dev/peps/pep-3109/\n[10]: https://tools.ietf.org/html/rfc7440\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/sirMackk/py3tftp", "keywords": "async asynchronous tftp", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "py3tftp", "package_url": "https://pypi.org/project/py3tftp/", "platform": "", "project_url": "https://pypi.org/project/py3tftp/", "project_urls": { "Homepage": "http://github.com/sirMackk/py3tftp" }, "release_url": "https://pypi.org/project/py3tftp/1.2.1/", "requires_dist": null, "requires_python": "", "summary": "Python 3 asynchronous TFTP server.", "version": "1.2.1" }, "last_serial": 4323189, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "bd87137350f928e54b5b84f242f861b0", "sha256": "1ca946be203a51dbb501becd8fc6676a5246c6341dc1920b92f437f733c239d7" }, "downloads": -1, "filename": "py3tftp-0.0.2.tar.gz", "has_sig": false, "md5_digest": "bd87137350f928e54b5b84f242f861b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7009, "upload_time": "2016-02-25T16:52:28", "url": "https://files.pythonhosted.org/packages/55/b8/1c0ff75b102a4fcc3321371c1d8a15ddd51418c89ea1a6a9d0680b6903d4/py3tftp-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "2f3124cfbca588f673be5b5202772edd", "sha256": "29ef5567233ba899e6101eca5aafefe651779222c21fd5dc1bef4e0f937676a5" }, "downloads": -1, "filename": "py3tftp-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2f3124cfbca588f673be5b5202772edd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9136, "upload_time": "2016-03-01T17:43:08", "url": "https://files.pythonhosted.org/packages/1a/8d/1e3343828ab83070116db727e35d16bcd70181ec2d677abbf3b51222b323/py3tftp-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "e185b7040657bbb7508b549d1d184f19", "sha256": "2a57d3d167e672d2174edd90625260cb7e9f5d2de3a081073b55bb12d858bbdf" }, "downloads": -1, "filename": "py3tftp-0.0.4.tar.gz", "has_sig": false, "md5_digest": "e185b7040657bbb7508b549d1d184f19", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9424, "upload_time": "2016-03-10T11:20:11", "url": "https://files.pythonhosted.org/packages/b0/0d/d27e5d45827c876ed58a2a209138637f85e09c1038c4a26b1ab2acf8a272/py3tftp-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "13f68f83f472a871354af90471444950", "sha256": "69d1cd931c87f8ba5e451b0711dac1e4dcfbee61977444a13571e1f7bfdd9ca2" }, "downloads": -1, "filename": "py3tftp-0.0.5.tar.gz", "has_sig": false, "md5_digest": "13f68f83f472a871354af90471444950", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10416, "upload_time": "2016-03-21T11:44:41", "url": "https://files.pythonhosted.org/packages/f9/f8/17283c0590480a0c3b4f8de44f8de112cff8b20320967a24581e96e66e98/py3tftp-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "20f27610b8e9698a02fe4e19b3c25625", "sha256": "bb42338a77418a70b55501f7d4ab254617ab4c57dc1a6e85371b5789c611fc1c" }, "downloads": -1, "filename": "py3tftp-0.0.6.tar.gz", "has_sig": false, "md5_digest": "20f27610b8e9698a02fe4e19b3c25625", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11012, "upload_time": "2016-10-17T14:30:23", "url": "https://files.pythonhosted.org/packages/26/7c/ff6d3b43fa1b2812cf57ed1e6933ada213c1f7bf9f720721640f08863e7b/py3tftp-0.0.6.tar.gz" } ], "1.0.0a0": [ { "comment_text": "", "digests": { "md5": "7eef1240136977ffa8d40f82c62ca30f", "sha256": "89da85e7d284db8879ab497a23600c1fc8e550512946bea7ab46e2e3e79ea8a9" }, "downloads": -1, "filename": "py3tftp-1.0.0a0.tar.gz", "has_sig": false, "md5_digest": "7eef1240136977ffa8d40f82c62ca30f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11169, "upload_time": "2017-11-27T21:47:23", "url": "https://files.pythonhosted.org/packages/66/3c/f5d31d9e34909d1247a3a5d6ffc1c0c240cace4cdf75048ab8e122485981/py3tftp-1.0.0a0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "0d6dd161f111238d48b34dead9270a6a", "sha256": "638daeb4ac149981e7c77fec5d3eff7924c515d20e24b1827a75f17a8182cc6f" }, "downloads": -1, "filename": "py3tftp-1.0.1.tar.gz", "has_sig": false, "md5_digest": "0d6dd161f111238d48b34dead9270a6a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11196, "upload_time": "2018-02-10T14:55:52", "url": "https://files.pythonhosted.org/packages/3a/28/bed5a20942cc111638dde1da2d15ca80e265463decc70ef639b47fb14d91/py3tftp-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "b0f62d8feaf5d3c675e20c6d085c3a77", "sha256": "7a133b515e2b6755f601c866508ebb9130c582ca3c9de290734877ad5a148b22" }, "downloads": -1, "filename": "py3tftp-1.0.2.tar.gz", "has_sig": false, "md5_digest": "b0f62d8feaf5d3c675e20c6d085c3a77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11211, "upload_time": "2018-03-05T12:40:57", "url": "https://files.pythonhosted.org/packages/ec/55/ed2692012c4f97cf9a8a354e3c4e04c140de3b91a6216cdebf7fc01ecca6/py3tftp-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "530f8340fc46e31218095fefd7ea1846", "sha256": "c2e763ac66a8745a2e192dab533418b5affc7dc35b3382b4256b42e2d8424f1c" }, "downloads": -1, "filename": "py3tftp-1.1.0.tar.gz", "has_sig": false, "md5_digest": "530f8340fc46e31218095fefd7ea1846", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11683, "upload_time": "2018-08-25T03:34:25", "url": "https://files.pythonhosted.org/packages/38/bb/73bc032c53d5f26bbd84901ce4e01dfeb17334fe902ad25d4e75bb7e56dc/py3tftp-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "4d2c9093d5c0b952d5a94e51e6c8a5d5", "sha256": "9a07c092a5d200829ae9c3db7fcb1e1975c0c1c6bc78b42dc6ddf6a3db3422a2" }, "downloads": -1, "filename": "py3tftp-1.2.0.tar.gz", "has_sig": false, "md5_digest": "4d2c9093d5c0b952d5a94e51e6c8a5d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12463, "upload_time": "2018-09-08T18:39:45", "url": "https://files.pythonhosted.org/packages/8e/c8/80e07d76cfa13dd30370aa95c409dfc55a7853f82ee3b55e2b4577ebf082/py3tftp-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "60bb0163f9c3d7b823bf454b10ae34c1", "sha256": "b72e14f22f0072aaa709379286e35a156f9be8607f1f47f239b4b989df8f6624" }, "downloads": -1, "filename": "py3tftp-1.2.1.tar.gz", "has_sig": false, "md5_digest": "60bb0163f9c3d7b823bf454b10ae34c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12505, "upload_time": "2018-09-29T17:24:28", "url": "https://files.pythonhosted.org/packages/4d/80/5a101783a317614cf791f7bbac7f186ae70e313c6bf437a0985516a0cd91/py3tftp-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "60bb0163f9c3d7b823bf454b10ae34c1", "sha256": "b72e14f22f0072aaa709379286e35a156f9be8607f1f47f239b4b989df8f6624" }, "downloads": -1, "filename": "py3tftp-1.2.1.tar.gz", "has_sig": false, "md5_digest": "60bb0163f9c3d7b823bf454b10ae34c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12505, "upload_time": "2018-09-29T17:24:28", "url": "https://files.pythonhosted.org/packages/4d/80/5a101783a317614cf791f7bbac7f186ae70e313c6bf437a0985516a0cd91/py3tftp-1.2.1.tar.gz" } ] }