{ "info": { "author": "Fictive Kin (mostly of previous work by Parth Bhatt)", "author_email": "systems@fictivekin.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: Other Audience", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Communications", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "===========\npyshorturl\n===========\n\nA python library to shorten urls using various url shortening serices. Republished from the previously released library by `Parth Bhatt`_.\n\nFollowing table lists details for each of the supported services:\n\n +--------------+----------------------+-----------+\n | Domain | Shorten/Expand URLs | QR code |\n +--------------+----------------------+-----------+\n | bit.ly | YES | NO |\n +--------------+----------------------+-----------+\n | bitly.com | YES | NO |\n +--------------+----------------------+-----------+\n | gim.ie | YES | NO |\n +--------------+----------------------+-----------+\n | git.io | YES | NO |\n +--------------+----------------------+-----------+\n | goo.gl | YES | YES |\n +--------------+----------------------+-----------+\n | is.gd | YES | NO |\n +--------------+----------------------+-----------+\n | j.mp | YES | NO |\n +--------------+----------------------+-----------+\n | tinyurl.com | YES | NO |\n +--------------+----------------------+-----------+\n | v.gd | YES | NO |\n +--------------+----------------------+-----------+\n\n\nInstall\n=======\n\nTo install pyshorturl:\n\n::\n\n python setup.py install\n\n\nUsing pyshorturl\n================\n\npyshorturl provides simple APIs that your python applications can use. Following\nare some examples that show how you can use pyShortUrl with goo.gl.\n\nUsing pyshorturl for URL shortening with *goo.gl*\n-------------------------------------------------\n\nShorten a URL using goo.gl:\n\n::\n\n from pyshorturl import Googl, GooglError\n\n long_url = 'http://www.parthbhatt.com/blog/'\n service = Googl(api_key=)\n try:\n short_url = service.shorten_url(long_url)\n print short_url\n except GooglError, e:\n print 'Error: %s' %e\n\n\nExpand a goo.gl short url back to the original long url:\n\n::\n\n from pyshorturl import Googl, GooglError\n\n short_url = 'http://goo.gl/RwsEG'\n service = Googl(api_key=)\n try:\n long_url = service.expand_url(short_url)\n print long_url\n except GooglError, e:\n print 'Error: %s' %e\n\n\n\nGet QR code for a goo.gl short url:\n\n::\n\n from pyshorturl import Googl, GooglError\n\n short_url = 'http://goo.gl/RwsEG'\n qr_img_path = '/path/to/qr_code.png'\n service = Googl()\n try:\n service.write_qr_image(short_url, qr_img_path)\n except GooglError, e:\n print 'Error: %s' %e\n\n\nUsing pyshorturl for URL shortening with *bit.ly*, *j.mp* and *bitly.com*\n-------------------------------------------------------------------------\n\nYou can use bit.ly exactly like you'd use goo.gl. Just initialize the *service*\nobject in the snippets above using *Bitly* instead of *Googl*.\n\n::\n\n from pyshorturl import Bitly, BitlyError\n\n service = Bitly(, )\n\n\nNote that it is mandatory to associate every call to bit.ly with a valid\naccount and an API Key. Hence, to use URL shortening with bit.ly you will need\nto provide an account name and API key.\n\nTo shorten a url using *j.mp* or *bitly.com*, specify the domain as an argument\nto the `shorten` function call as shown below:\n\n::\n\n from pyshorturl import Bitly, BitlyError\n\n long_url = 'http://www.parthbhatt.com/blog/'\n service = Bitly(, )\n try:\n short_url = service.shorten_url(long_url, domain='j.mp')\n print short_url\n except BitlyError, e:\n print '%s' %e\n\nUsing pyshorturl for URL shortening with *tinyurl.com*\n------------------------------------------------------\n\n::\n\n from pyshorturl import TinyUrlcom\n \n service = TinyUrlcom()\n\nYou dont need any account name or api key to use TinyUrl.\n\n\nUsing the pyshorturl-cli.py utility\n===================================\n\npyshorturl ships with a command-line utility called `pyshorturl-cli.py` that\nallows you to use all the features of the library from the command line.\n\n::\n\n $ python pyshorturl-cli.py -h\n Options:\n -h, --help show this help message and exit\n -r SERVICE, --service=SERVICE\n One of the shortening services\n goo.gl,bit.ly,tinyurl.com,v.gd,is.gd. Defaults to\n goo.gl\n -d DOMAIN, --domain=DOMAIN\n Domain bit.ly, j.mp or bitly.com to use while\n shortening with bit.ly. Defaults to bit.ly\n -u LOGIN, --login=LOGIN\n The user account to use with the url shortening\n service.\n -l LONG_URL, --long-url=LONG_URL\n Shorten the specified URL.\n -k SVC_API_KEY, --api-key=SVC_API_KEY\n Use API Key while communicating with the url\n shortening service.\n -s SHORT_URL, --short-url=SHORT_URL\n Expand the specified Short URL.\n -q QR_IMG_PATH, --qr-code-file=QR_IMG_PATH\n Used with -s. Writes the QR code for the corresponding\n short url.\n\n\nSome examples of using the pyshorturl-cli.py utility:\n\nShorten a long url using goo.gl:\n\n::\n\n $ python pyshorturl-cli.py --service goo.gl --long-url http://www.parthbhatt.com/blog/2011/geolocation-with-google-maps-javascript-api/ --api-key \n http://goo.gl/NMdyG\n\nObtain the original long url for a goo.gl short url:\n\n::\n\n $ python pyshorturl-cli.py --short-url http://goo.gl/NMdyG --api-key \n http://www.parthbhatt.com/blog/2011/geolocation-with-google-maps-javascript-api/\n\nGet the QR code for a goo.gl short url:\n\n::\n\n $ python pyshorturl-cli.py --short-url http://goo.gl/NMdyG --qr-code-file qr_code.png\n Wrote the qr code for http://goo.gl/NMdyG to qr_code.png\n\nShorten a long url using bit.ly:\n\n::\n\n $ python pyshorturl-cli.py --service bit.ly --login --api-key -l http://www.parthbhatt.com/blog/\n http://bit.ly/xJHGkJ\n\nShorten a long url using j.mp:\n\n::\n\n $ python pyshorturl-cli.py --service bit.ly --login --api-key --domain j.mp -l http://www.parthbhatt.com/blog/\n http://j.mp/xJHGkJ\n\nObtain the original long url for a bit.ly short url:\n\n::\n\n $ python pyshorturl-cli.py --service bit.ly --login --api-key -s http://bit.ly/xJHGkJ\n http://www.parthbhatt.com/blog/\n\nGet the QR code for a bit.ly short url:\n\n::\n\n $ python pyshorturl-cli.py --service bit.ly --login --api-key --short-url http://bit.ly/xJHGkJ --qr-code-file qr_code.png\n Wrote the qr code for http://bit.ly/xJHGkJ to qr_code.png\n\n\nShorten a long url using tinyurl.com:\n\n::\n\n $ python pyshorturl-cli.py --service tinyurl.com --long-url http://www.parthbhatt.com/blog/\n http://tinyurl.com/8yuvzl5\n\nObtain the original long url for a tinyurl.com short url:\n\n::\n\n $ python pyshorturl-cli.py --service tinyurl.com --short-url http://tinyurl.com/8yuvzl5\n http://www.parthbhatt.com/blog/\n\n\nShorten a long url using git.io:\n\n::\n\n $ python pyshorturl-cli.py --service git.io --long-url https://github.com/parthrbhatt/pyShortUrl\n https://git.io/sUX2IQ\n\nRetrieve the original long url with git.io:\n\n::\n\n $ python pyshorturl-cli.py --service git.io --short-url https://git.io/sUX2IQ\n https://github.com/parthrbhatt/pyShortUrl\n\n\n.. _Parth Bhatt: https://github.com/parthrbhatt", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/fictivekin/pyshorturl", "keywords": "url shortening qrcode qr goo.gl bit.ly tinyurl.com j.mp bitly.com v.gd is.gd", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyShortUrl", "package_url": "https://pypi.org/project/pyShortUrl/", "platform": "Linux", "project_url": "https://pypi.org/project/pyShortUrl/", "project_urls": { "Homepage": "https://github.com/fictivekin/pyshorturl" }, "release_url": "https://pypi.org/project/pyShortUrl/0.9.2/", "requires_dist": null, "requires_python": "", "summary": "A python library to shorten urls using one of the url shortening services", "version": "0.9.2" }, "last_serial": 4882083, "releases": { "0.9.2": [ { "comment_text": "", "digests": { "md5": "4cf36eee1430b431461616450c49136d", "sha256": "b18de61e9e1e798ba3236c006fb4a2198ed5720bb6f5a2744cfc8469b4a40843" }, "downloads": -1, "filename": "pyShortUrl-0.9.2.tar.gz", "has_sig": false, "md5_digest": "4cf36eee1430b431461616450c49136d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10432, "upload_time": "2019-03-01T03:18:37", "url": "https://files.pythonhosted.org/packages/4e/b4/33ccc066db92b8624c2a15c6ffa9f6ae2a87f40adb117777b60f3304cfe3/pyShortUrl-0.9.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4cf36eee1430b431461616450c49136d", "sha256": "b18de61e9e1e798ba3236c006fb4a2198ed5720bb6f5a2744cfc8469b4a40843" }, "downloads": -1, "filename": "pyShortUrl-0.9.2.tar.gz", "has_sig": false, "md5_digest": "4cf36eee1430b431461616450c49136d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10432, "upload_time": "2019-03-01T03:18:37", "url": "https://files.pythonhosted.org/packages/4e/b4/33ccc066db92b8624c2a15c6ffa9f6ae2a87f40adb117777b60f3304cfe3/pyShortUrl-0.9.2.tar.gz" } ] }