{ "info": { "author": "Cristian N\u0103v\u0103lici", "author_email": "ncristian@lemonsoftware.eu", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Other Environment", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "PyBencoder - your bencoded strings module\n--------------------------------------------\n\nWhat is a Bencoded String?\n===========================\n\nBencode (pronounced like B encode) is the encoding used by the peer-to-peer file sharing system BitTorrent\nfor storing and transmitting loosely structured data.\n\nFor more info on bencoding check out http://en.wikipedia.org/wiki/Bencode/.\n\nIt provides:\n - decoding of the different bencoded elements\n - encoding of the allowed types (byte strings, integers, lists, and dictionaries).\n\n\nRequirements\n===========================\n\nRequires Python 3 or later\n\n\nInstallation\n===========================\n\npython setup.py install\n\nTo run test suite:\n\npython setup.py test\n\nUsage\n===========================\n\nImport the module\n------------------\n\nfrom pybencoder.bencoder import PyBencoder\n\n\nEncoding\n---------\n\nEncoding is very easy to do. Just pass as an argument your data to encode method.\nIt will automagically call the right encoder for you.\n\nben = PyBencoder()\n\nben.encode(123) # encode an integer 'i123e'\nben.encode('123') # encode a string '3:123'\nben.encode([1, 2, 3]) # encode a list 'li1ei2ei3ee'\nben.encode([1, 2, [ 4, 5]]) # encode a slightly more complex list 'li1ei2eli4ei5eee'\nben.encode({ 'one': 1, 'two': 2, 'three': 3 }) # encode a dictionary 'd5:threei3e3:twoi2e3:onei1ee'\n\n\nDecoding\n---------\n\nDecoding is also easy to deal with. Just pass the bencoded string to decode method.\nTwo mentions:\n- the first char of your bencoded string must be actually bencoded data, no garbage is allowed\n- at the end of the bencoded string it might be garbage data; after the extraction, you can also retrieve it\n\nben = PyBencoder()\n\nben.decode('i123e') # decode an integer 123\nben.decode('i123esomeothergarbagedata') # decode an integer with garbage data at the end\nben.get_left() # gets what's left -> 'someothergarbagedata'\n\nben.decode('3:123somegarbage') # decode a 3 chars string\n\nben.decode('li1ei2eli4ei5eee') # decode a list [1, 2, [4, 5]]", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/cristianav/PyBencoder/zipball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cristianav/PyBencoder", "keywords": "bencoding,encode,decode,bittorrent", "license": "LGPL", "maintainer": null, "maintainer_email": null, "name": "PyBencoder3", "package_url": "https://pypi.org/project/PyBencoder3/", "platform": "POSIX,Windows", "project_url": "https://pypi.org/project/PyBencoder3/", "project_urls": { "Download": "https://github.com/cristianav/PyBencoder/zipball/master", "Homepage": "https://github.com/cristianav/PyBencoder" }, "release_url": "https://pypi.org/project/PyBencoder3/1.0/", "requires_dist": null, "requires_python": null, "summary": "Module to work with bencoded strings.", "version": "1.0" }, "last_serial": 1225160, "releases": { "1.0": [] }, "urls": [] }