{ "info": { "author": "natanaelfneto", "author_email": "natanaelfneto@outlook.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "

\n \n \"pythontail-logo\"\n \n

\n\n**PythonTail**: a Unix tail implementation in python.\nVersion: **0.7**\n***\n# Table of Contents\n* [Getting Started](#getting-started)\n * [Unix version comparison](#unix-version-comparison)\n * [Installation process](#installation-process)\n * [Usage](#usage)\n * [Examples](#examples)\n* [License](#license)\n***\n## Getting Started\n### Unix version comparison\n#### Unix tail implementation list (adapted)\n- item: `default output line = 10`\\\n descrtption: default output with 10 lines for each tailed file\\\n status: [**OK**]\n- item: `-c, --bytes=[+]NUM`\\\n description: output the last NUM bytes; or use -c +NUM to output starting\\\n with byte NUM of each file\\\n status: [**PENDING**]\n- item: `-f, --follow`\\\n description: output appended data as the file grows;\\\n status: [**OK**]\n- item: `-n, --lines=NUM`\\\n description: output the last NUM lines, instead of the last 10; or use -n\\\n \n status: [**OK**]\n- item: `--max-unchanged-stats=N`\\\n description: with --follow=name, reopen a FILE which has not\\\n changed size after N (default 5) iterations to see if it has\\\n been unlinked or renamed (this is the usual case of rotated\\\n log files); with inotify, this option is rarely useful\\\n status: [**PENDING**]\n- item: `--pid=PID`\\\n description: with -f, terminate after process ID, PID dies\\\n status: [**PENDING**]\n- item: `-q, --quiet, --silent`\\\n description: never output headers giving file names\\\n status: [**OK**]\n- item: `--retry`\\\n description: keep trying to open a file if it is inaccessible\\\n status: [**PENDING**]\n- item: `-s, --sleep-interval=N`\\\n description: with -f, sleep for approximately N seconds (default 0)\\\n between iterations; at least once every N seconds\\\n status: [**OK**]\n- item: `-v, --verbose`\\\n description: always output headers giving file names\\\n status: [**PENDING**]\n- item: `-z, --zero-terminated`\\\n description: line delimiter is NUL, not newline\\\n status: [**PENDING**]\n- item: `--help`\\\n description: display this help and exit\\\n status: [**OK**]\n- item: `--version`\\\n description: output version information and exit\\\n status: [**OK**]\n- item: `multiple files support`\\\n description: tail as many files as wanted with all available parameters working as well\\\n status: [**OK**]\n#### Unique tail implementations\n- item: `usage as both terminal command and as python module`\\\n description: the use of all parameters within terminal command line\\\n and by importing as a module inside a python script\\\n status: [**OK**]\n- item: `-d, --debug`\\\n description: create a log file and register all ocurrencies of regular\\\n behavior information, debug and errors as the timestamp and logged user\\\n status: [**OK**]\n- item: `?`\\\n description: tail files over tcp/ip\\\n status: [**PENDING**]\n### Via Bash\n#### Installation Process\n_install as a module:_\n```Shell\npip install pythontail\n```\n_and use it as:_\n```Python\nfrom pythontail import tail\ntail.run(['dir/log/file.log'])\n```\n_use as terminal command:_\n```Shell\ngit clone https://github.com/natanaelfneto/pythontail.git\npython pythontail.py -h\n```\n_enjoy_\n***\n## Usage\n_this messagem can also be found with_ **python pythontail.py -h** _command_\n```ShellSession\nusage: pythontail.py [-h] [-f | -n LINES] [-q] [-s SLEEP] [-d] [-v] sources [sources ...]\n\nUnix tail implementation in python \n\noptional arguments:\n-h, --help show this help message and exit\n-f, --follow flag to not limit number of lines tailed\n-n LINES, --lines LINES number of lines to follow in total array of sources\n\n-q, --quiet, --silent never output headers giving file names\n\n-s SLEEP, --sleep SLEEP, --sleep-interval SLEEP\n with --follow, sleep for approximately N seconds\n (default 0) between iterations; least once every N seconds\n\n-d, --debug process debug flag\n-v, --version output software version\n```\n## Examples\n### First we need a fake log file\nGenerate many live fake logs files by running:\n```Shell\npython pythontail/test/fake_log_generator.py &\n```\n_for the example1.py, generate the minimum of 2 fake log files_\\\nThis will create two **fake_n.log** files in _~/log/fake_n.log_ that can be tailed\n### Using it as console command for tail files\n```\npython pythontail/pythontail.py -f ~/log/fake_1.log ~/log/fake_2.log\n```\n### Using it as python module for tail files\nCreate a virtual env and activate it (can be pyenv or virtualenv or any other)\n```Shell\nmkvirtualenv pythontail\nworkon pythontail\n```\nInstall pythontail module\n```Shell\npip install pythontail\n```\nCreate your code as the available in _pythontail/examples/example1.py_\\\n```Python\nfrom pythontail import tail\nfrom pathlib import Path\n\nimport os\n\n\n# get as many valid files paths you want to be tailed\nlog_file_1 = str(Path(\"{0}/log/fake_1.log\".format(os.path.expanduser('~'))))\nlog_file_2 = str(Path(\"{0}/log/fake_2.log\".format(os.path.expanduser('~'))))\n\n# tail them\ntail.run(\n # debug=False,\n # quiet=False,\n # lines=10,\n # sleep=0,\n sources=[\n log_file_1, \n log_file_2\n ]\n)\n\n# for a --follow atribute, set the maximum number of lines to zero [lines=0]\n# optional --sleep atribute only works with --follow flag, done by making [lines=0]\n```\nCheck the output of example1 by running the script file:\n```Shell\npython pythontail/examples/example1.py\n```\n## License\nMIT License\n\nCopyright (c) 2017 Natanael F. Neto (natanaelfneto)\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", "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/natanaelfneto/pythontail", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pythontail", "package_url": "https://pypi.org/project/pythontail/", "platform": "", "project_url": "https://pypi.org/project/pythontail/", "project_urls": { "Homepage": "https://github.com/natanaelfneto/pythontail" }, "release_url": "https://pypi.org/project/pythontail/0.7/", "requires_dist": null, "requires_python": "", "summary": "a unix tail implementation in python", "version": "0.7" }, "last_serial": 4310814, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "05af6ae74a59feaa451fb6793c147fbc", "sha256": "ddd44b740f0bac5ad87b780c59edd8ee47e06bf0889d4bfcfb6ef4b075ff2ac4" }, "downloads": -1, "filename": "pythontail-0.1.tar.gz", "has_sig": false, "md5_digest": "05af6ae74a59feaa451fb6793c147fbc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2208, "upload_time": "2018-09-09T20:09:08", "url": "https://files.pythonhosted.org/packages/f4/0a/79cfd1dffd8c6bc55feb0bf0c8dca4f304e8e15030f9ce1534ca6b7e9c65/pythontail-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "e1abf52bef3d5519e1e5dd28fe71c5b3", "sha256": "45ac3cb9dcca8a1820d299a1a360f00c8f1611816fbad73e09d10efae1eceec1" }, "downloads": -1, "filename": "pythontail-0.2.tar.gz", "has_sig": false, "md5_digest": "e1abf52bef3d5519e1e5dd28fe71c5b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2204, "upload_time": "2018-09-09T20:49:19", "url": "https://files.pythonhosted.org/packages/a1/c3/d26d6ddecd4182bc6f37d09043e2bc0b8ae527518614bd5886cfcc5a303e/pythontail-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "31bd1bda7697d0844d7fed75f0e8004a", "sha256": "305209e09d072e335ed41620f3b81d02c07a9d1e6eb12ffffeba519c2426d230" }, "downloads": -1, "filename": "pythontail-0.3.tar.gz", "has_sig": false, "md5_digest": "31bd1bda7697d0844d7fed75f0e8004a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2205, "upload_time": "2018-09-09T21:05:31", "url": "https://files.pythonhosted.org/packages/e9/fa/b70082ddf317ae4c91b2b6fd6f01255825990fe1387c1fc51e5c19b1d4f7/pythontail-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "700ae315dababd0d949273db3a449ff9", "sha256": "0a2928f342b31896371bc4e9ac1798691c480e2c926d0c7163ffaaf11840f947" }, "downloads": -1, "filename": "pythontail-0.4.tar.gz", "has_sig": false, "md5_digest": "700ae315dababd0d949273db3a449ff9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3952, "upload_time": "2018-09-09T22:13:24", "url": "https://files.pythonhosted.org/packages/78/e1/fbcd7b136b9802676ed1965ab2ff023962dadaa73d8a4061c793f07d4f48/pythontail-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "a81818a87106c8758ef7f33c08ec41da", "sha256": "494bf29924a3ac8d1e63e1c8ebd8aff53a1a3aebcc8bbed8e0261a91adb4cab9" }, "downloads": -1, "filename": "pythontail-0.5.tar.gz", "has_sig": false, "md5_digest": "a81818a87106c8758ef7f33c08ec41da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4211, "upload_time": "2018-09-10T01:39:58", "url": "https://files.pythonhosted.org/packages/5f/d8/0684a6f281bf824c0efe498739fd21ed1e32abe8584813afb51387215200/pythontail-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "18700ab91fe8f787b0470278f8e6fb09", "sha256": "7385b530983aa291ebb64ea8192a78559dfc119839f836bbcf0c2fdeed890f31" }, "downloads": -1, "filename": "pythontail-0.6.tar.gz", "has_sig": false, "md5_digest": "18700ab91fe8f787b0470278f8e6fb09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7098, "upload_time": "2018-09-11T23:43:19", "url": "https://files.pythonhosted.org/packages/70/97/ebad1dfbc0965d2cd1a4b33bf8c3a6827dd7205e3305a559416eeca255b5/pythontail-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "eb11a112213dad2bae58cbda52896884", "sha256": "5f6f98a3125ae468e2eeb0d361f16cf75a439e1dfae91ab7d7863eb8fa085861" }, "downloads": -1, "filename": "pythontail-0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "eb11a112213dad2bae58cbda52896884", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8949, "upload_time": "2018-09-26T01:46:36", "url": "https://files.pythonhosted.org/packages/20/96/d3d50e4472296b34740d1dff75a328a55acba82ce35d1b32d6a6cee5f782/pythontail-0.7-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "eb11a112213dad2bae58cbda52896884", "sha256": "5f6f98a3125ae468e2eeb0d361f16cf75a439e1dfae91ab7d7863eb8fa085861" }, "downloads": -1, "filename": "pythontail-0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "eb11a112213dad2bae58cbda52896884", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8949, "upload_time": "2018-09-26T01:46:36", "url": "https://files.pythonhosted.org/packages/20/96/d3d50e4472296b34740d1dff75a328a55acba82ce35d1b32d6a6cee5f782/pythontail-0.7-py3-none-any.whl" } ] }