{ "info": { "author": "Laurent Peuch", "author_email": "cortex@worlddomination.be", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python" ], "description": "Pipe Tool Kit\n=============\n\nThis tool kit is an attempt to compile a set of tools I've created to solve\nproblems for La Quadrature du Net. Those tools are designed to works with unix\nshell pipe. They follow the unix philosophy and aim to stay simple.\n\nI'm going to try to keep them at least a bit documented but since I'm always in\nan hurry I can't guaranteed this will always be the case.\n\nYou can have an idea of the power of this kind of problems solving approach\nhere: http://blog.worlddomination.be/projects/ungarage.html (this tuto doesn't\nfeatures those tools for the moment).\n\nFor organisation reason all the commands starts with the letter \"p\".\n\nThere is place for a lots of ameliorations, most of those tools are very\nsimplistic and could be generalised (for example pdetinyfy or purltitle could\nbe apply to each urls of a sentence, purls could use regex and could be\ngeneralised for anything by accepting regex as an argument).\n\nIt's possible I'm reinventing the wheel for some of those commands. Don't\nhesitate to tell me if it's the case.\n\nCurrent tools\n=============\n\n* pipetk: list the available commands with the informations bellow.\n\n* puniq: eliminate duplications in real time via a shell unix pipe.(| sort |\n uniq waits for the full stream to be completed and also sort it, therefor it,\n for example, won't works between a rsstail|feedstail and an ii file).\n Example:\n\n ::\n\n $ feedstail -u http://reddit.com/.rss | puniq\n\n* pmerge: open a named pipe and write to stdout everything written in the named\n pipe. The first argument given is the name of the named pipe. It doesn't\n managed in any way the possible conflicts between multiple process that write\n on that pipe at the same time.\n Silly example:\n\n ::\n\n $ pmerge PIPE > irc.freenode.net/#laquadrature & echo \"pouet\" > PIPE\n\n* purls: really simple url extracting tools. It split each line it receives by\n white space then display on a new line each words that starts with either\n \"http\" or \"https\".\n Example:\n\n ::\n\n $ echo \"there is 2 urls in this sentence: this one http://blog.worlddomination.be and this one http://laquadrature.net\" | purls\n http://blog.worlddomination.be\n http://laquadrature.net\n\n* pdetinyfy: get the real url of a shortened url. FIXED: works on urls inside a string\n Example:\n\n ::\n\n $ echo \"foo http://ur1.ca/4110r bar\" | pdetinyfy\n foo http://laquadrature.net bar\n\n* purltitle: get an url in input and output the url followed by it's title.\n FIXED: works on urls inside a string\n Example:\n\n ::\n\n $ echo \"foo http://laquadrature.net bar\" | purltitle\n foo http://laquadrature.net La Quadrature du Net | Internet et Libert\u00e9s bar\n\n* plag: slow down the displaying of a stream by sleeping a give time beetwen each line\n Can have the number of seconds the sleep as arg (accept float value).\n Example:\n\n ::\n\n dmseg | plag\n\n or:\n\n ::\n\n dmesg | plag 60\n\n* puniqrt: try to avoid duplications of similar tweets. For example by removing\n RT tweets of a tweet that has already been displayed.\n Behave in the same way that puniq.\n\n* premoveurls: remove the urls from a string. This is more an example script\n for the URLPipeTemplate class than something really usefull.\n Example:\n\n ::\n\n $ echo \"foo http://laquadrature.net bar\" | premoveurls\n \"foo bar\"\n\n\n* pcleanurls: clean urls by removing useless informations like tracking stuff\n like \"?utm_*\" args added to urls.\n\n* ptweetlen: return the len a string will have on tweeter with it's urls\n tinyfied by the t.do domain\n\nCoding new pipe utils\n=====================\n\nThe PipeToolKit comes with 2 template python Class for coding new pipe\nutilities for your need. Here are 2 simple example on how to use each ones. I\ndon't think that you'll need to now anything more. If you want to, just read\nthe code, it's not long.\n\nPipeTemplate\n------------\n\nThis is the standard template.\n\n ::\n\n from pipetk import PipeTemplate\n\n class Example(PipeTemplate):\n # Options: displayed here with their default value, you can change it by redefining it\n\n # FAIL_ON_EXCEPTION = False # define if the pipe will stop when an exception is raised\n\n # DISPLAY_ERROR = True # define if the exception backtrace and message are displayed\n\n # RETRY = False # define if the pipe must retry it's processing on an exception\n\n # MAX_RETRY = 3 # define the number of time the pipe must retry to process it's input on an exception\n\n # UNMODIFIED_TO_STDOUT_ON_FAIL = False # define if on an exception the unmodified text must be written\n\n # WITH_ENDL = True # define if the endl char must be sended to the process function\n\n def process(self, line):\n # called everytime a line is written on stdin, you must implement it\n\n # VERY IMPORTANT: process must return something iterable, either a\n\n # list or by being a decorator (by using yield). This allow you to\n\n # return severals different things.\n\n # do you stuff\n\n yield line\n\n # or\n\n return [a, b, c, d]\n\n if __name__ == \"__main__\":\n Example().run()\n\nURLPipeTemplate\n---------------\n\nThis is a template to work on every urls of a stream.\n\n ::\n\n from pipetk import URLPipeTemplate\n\n class Example(URLPipeTemplate):\n # Inherite from all the options of the PipeTemplate\n\n # Other option:\n\n # WITH_EXTRA_SPACE=False # define if the space that may follow the url in the string is send to the processing function\n\n # CAREFULL: this is process_URL, not process, you can't implement\n\n # process since it's already implemented to build this new template.\n\n def process_url(self, url):\n # called on every url encoutered\n\n # you must return a string\n\n return \"\"\n\n if __name__ == \"__main__\":\n Example().run()\n\nMore example?\n-------------\n\nJust read the code of the existing tools. Most of it are very simple.\n\nChangelog\n=========\n\n0.2\n---\n\n* pdetinyfy now works for urls inside a string\n\n* new script: puniqrt to try to eliminate duplications for tweets\n\n* new template to build pipes utils that works on the urls of a string\n\n* add premoveurls as en example script for the new template\n\n* new script: pcleanurls to remove useless tracking pieces of urls (like utm_* stuff)\n\n* various bug fixs\n\n* add doc on how to write new pipe utils\n\n0.1\n---\n\n* Init\n\nLicence\n=======\n\nAll those tools are released under the `GNU General Public License v3`_ or later.\n\n.. _GNU General Public License v3 : http://www.gnu.org/licenses/gpl-3.0.html\n\nFeedback\n========\n\nFor any feedback you can contact me at .\n\nLaurent Peuch", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://worlddomination.be/projects/pipetk.html", "keywords": "sh bash shell pipe stream cli", "license": "GPLv3+", "maintainer": null, "maintainer_email": null, "name": "PipeTK", "package_url": "https://pypi.org/project/PipeTK/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/PipeTK/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://worlddomination.be/projects/pipetk.html" }, "release_url": "https://pypi.org/project/PipeTK/0.2.5.1/", "requires_dist": null, "requires_python": null, "summary": "Collection of small scripts that modify input received via shell pipe", "version": "0.2.5.1" }, "last_serial": 784916, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "b4945e23f95cd3bdc0e002bd482d0d10", "sha256": "9b41e059e144422c452b07af87f887cff186c3a9e263dce4750347e73d2d2ab7" }, "downloads": -1, "filename": "PipeTK-0.1.tar.gz", "has_sig": false, "md5_digest": "b4945e23f95cd3bdc0e002bd482d0d10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4138, "upload_time": "2011-04-27T14:01:33", "url": "https://files.pythonhosted.org/packages/4b/69/f288f8ac4b49ec64de2659adfc9adbb724134e4d3b8085b86234d3fae7e8/PipeTK-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "585f0862c48d229e5ed32a646dcef21f", "sha256": "3ed42cea317641a1083f6207cce00f8e26d21044cb551784e6d9f0924dd1666f" }, "downloads": -1, "filename": "PipeTK-0.1.1.tar.gz", "has_sig": false, "md5_digest": "585f0862c48d229e5ed32a646dcef21f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4709, "upload_time": "2011-07-02T22:00:14", "url": "https://files.pythonhosted.org/packages/cf/9b/301cac116824cff6677364799b71736796eb572428a377829e1b88bcbef7/PipeTK-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "5e2b070327a79f0826e7ebd5128c141a", "sha256": "fac4d2a1e3e70ab997ee644c83c8604e52470d56bbfaf4c48055b05f798ec48b" }, "downloads": -1, "filename": "PipeTK-0.1.2.tar.gz", "has_sig": false, "md5_digest": "5e2b070327a79f0826e7ebd5128c141a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5174, "upload_time": "2011-07-03T11:52:55", "url": "https://files.pythonhosted.org/packages/f4/72/ad54a914addbae21f029ee928fd440d47506c9f1dac0b429fa1bd855b3ee/PipeTK-0.1.2.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "cd96c9adb049676202666e0ee23b70f1", "sha256": "3d5758b117efcf3446a7098563a1f29911a87395eeae05f1e4eed84cc007a021" }, "downloads": -1, "filename": "PipeTK-0.2.tar.gz", "has_sig": false, "md5_digest": "cd96c9adb049676202666e0ee23b70f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6263, "upload_time": "2011-11-02T02:52:55", "url": "https://files.pythonhosted.org/packages/65/b7/15a5a69774528db0c090b567298fedc2671413f7a7170df0a2c168815d44/PipeTK-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "ba9a489830b273a744d97b21ce065b33", "sha256": "29b66a429865276819de062f0578b0882b482ae2be015e54a4e92f804797b12e" }, "downloads": -1, "filename": "PipeTK-0.2.1.tar.gz", "has_sig": false, "md5_digest": "ba9a489830b273a744d97b21ce065b33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7038, "upload_time": "2012-02-09T07:44:15", "url": "https://files.pythonhosted.org/packages/41/11/8b6b36fa0c03a2ba75a8960c4a578b0fd115d3bf71361790813c4644add9/PipeTK-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "611ad66a2cbbfbe0a1dfa69abe2a8d16", "sha256": "12c9779a23659b937553b12c77fe5613620ea39a3f27ce44e298bbbd95de1301" }, "downloads": -1, "filename": "PipeTK-0.2.2.tar.gz", "has_sig": false, "md5_digest": "611ad66a2cbbfbe0a1dfa69abe2a8d16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7339, "upload_time": "2012-04-09T18:04:02", "url": "https://files.pythonhosted.org/packages/f4/1d/f460fc6cc9b58c14b86b45d655289f29c9f06ab6ca3fb0e18140de950672/PipeTK-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "1386371cee85928549bc050662ae05d2", "sha256": "040ab67c3e3fd4b68be2c7e563bff216a8fcb640d4e9ef13de2c1d0f5827774e" }, "downloads": -1, "filename": "PipeTK-0.2.3.tar.gz", "has_sig": false, "md5_digest": "1386371cee85928549bc050662ae05d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7213, "upload_time": "2012-07-04T09:27:37", "url": "https://files.pythonhosted.org/packages/78/7e/af3c42ea99dd4a73a00098766081444ae182c8ddd7214cb7c29d6016e780/PipeTK-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "927cb734657f36d70012656ff56f24d6", "sha256": "83a0675cda62663bccd4580c2ae80676f2e022d544ed921c4a0ea6d7334c9358" }, "downloads": -1, "filename": "PipeTK-0.2.4.tar.gz", "has_sig": false, "md5_digest": "927cb734657f36d70012656ff56f24d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7227, "upload_time": "2012-09-19T00:32:37", "url": "https://files.pythonhosted.org/packages/76/26/10525cfd6cdbe4b4a177cccad6a83af83db5de4f079e39ec752dd5e1c250/PipeTK-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "ed5f49a3c360d7d6996e5e87b4814a17", "sha256": "51613cd877e5bb65521ff8778404900c7fb1614ffdb9904b2f07b72642282692" }, "downloads": -1, "filename": "PipeTK-0.2.5.tar.gz", "has_sig": false, "md5_digest": "ed5f49a3c360d7d6996e5e87b4814a17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6689, "upload_time": "2013-04-17T11:10:52", "url": "https://files.pythonhosted.org/packages/6c/9b/5bebd4d88d051ecc62e60d1ccda6d99f478ef19c1c7d7c135eb8d4a97ff3/PipeTK-0.2.5.tar.gz" } ], "0.2.5.1": [ { "comment_text": "", "digests": { "md5": "183a3cfaea05ad87fd093c9cd0ccb6e7", "sha256": "cbabbaa0fe5ea5a57cfa7ec27169b538dc8d197275babcc366d8c96dbadfd8e6" }, "downloads": -1, "filename": "PipeTK-0.2.5.1.tar.gz", "has_sig": false, "md5_digest": "183a3cfaea05ad87fd093c9cd0ccb6e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7235, "upload_time": "2013-05-21T21:19:07", "url": "https://files.pythonhosted.org/packages/87/09/fe96f9c41ca8c6df5ecc77a3791cc55586f6db540631bc1a2ac82cf4f609/PipeTK-0.2.5.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "183a3cfaea05ad87fd093c9cd0ccb6e7", "sha256": "cbabbaa0fe5ea5a57cfa7ec27169b538dc8d197275babcc366d8c96dbadfd8e6" }, "downloads": -1, "filename": "PipeTK-0.2.5.1.tar.gz", "has_sig": false, "md5_digest": "183a3cfaea05ad87fd093c9cd0ccb6e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7235, "upload_time": "2013-05-21T21:19:07", "url": "https://files.pythonhosted.org/packages/87/09/fe96f9c41ca8c6df5ecc77a3791cc55586f6db540631bc1a2ac82cf4f609/PipeTK-0.2.5.1.tar.gz" } ] }