{
"info": {
"author": "Josh Brandoff",
"author_email": "josh@storj.io",
"bugtrack_url": null,
"classifiers": [],
"description": "StorjTorrent\n============\n\n|Build Status| |Coverage Status| |PyPi Version|\n\nStorjTorrent is a wrapper library for libtorrent's Python bindings. It\nallows Storj packages to create torrents, seed files to other Storj\nnodes, and retrieve files using their hashes.\n\nBuilding\n========\n\nYou will need to ensure `Boost `__ is properly\ninstalled so you can properly build and install ``libtorrent``:\n\n::\n\n $ wget http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.gz\n $ tar -zxvf boost_*.tar.gz\n $ cd boost_*\n $ ./bootstrap.sh\n $ ./b2\n $ sudo ./b2 install\n\nAfter Boost is successfully built, you can build and install\n``libtorrent``:\n\n::\n\n $ wget http://downloads.sourceforge.net/project/libtorrent/libtorrent/libtorrent-rasterbar-1.0.3.tar.gz\n $ tar -zxvf libtorrent-*.tar.gz\n $ cd libtorrent-rasterbar-1.0.3\n $ ./configure --enable-python-binding\n $ make\n $ sudo make install\n\nYou may also need to run:\n\n::\n\n $ cd bindings/python\n $ sudo python setup.py install\n\nOSX\n---\n\nYou may need to have XCode's command line tools installed if you don't\nalready have them set up:\n\n::\n\n $ xcode-select --install\n\nIf you are using OSX, you can use the `Homebrew `__\nsystem to install Boost (with Python support) and libtorrent:\n\n::\n\n $ ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n $ brew install boost-python \n $ brew install libtorrent-rasterbar --with-python\n\nInstalling Inside a Virtual Environment\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nEnsure your virtual environment is using Brew's python:\n\n::\n\n $ mkvirtualenv -p /usr/local/bin/python storjtorrent\n\nIf you are installing inside a virtual environment, you can try the\nfollowing (after you install boost-python with homebrew):\n\n::\n\n $ brew install boost --with-python\n $ brew install boost-build\n $ wget http://downloads.sourceforge.net/project/libtorrent/libtorrent/libtorrent-rasterbar-1.0.3.tar.gz\n $ tar -zxvf libtorrent-*.tar.gz\n $ cd libtorrent-rasterbar-1.0.3\n $ ./configure --disable-debug --disable-dependency-tracking --disable-silent-rules --enable-encryption --prefix=$VIRTUAL_ENV --with-boost=/usr/local/opt/boost --enable-python-binding --with-libiconv --with-boost-python=boost_python-mt PYTHON=python PYTHON_LDFLAGS=\"$(python-config --libs)\"\n $ make\n $ make install\n\nUbuntu\n------\n\nInstall supporting tools and libraries:\n\n::\n\n $ apt-get install build-essential libboost-all-dev\n $ apt-get source python-libtorrent\n $ apt-get build-dep python-libtorrent\n\nCreate a new virtual environment. For example, if you have\n``virtualenvwrapper`` installed, you can use the following to create and\nenter a new virtual environment called ``storjtorrent``:\n\n::\n\n $ mkvirtualenv storjtorrent\n\nThen, once inside the virtual environment, run the following commands:\n\n::\n\n $ wget http://downloads.sourceforge.net/project/libtorrent/libtorrent/libtorrent-rasterbar-1.0.3.tar.gz\n $ tar -zxvf libtorrent-rasterbar-1.0.3.tar.gz\n $ cd libtorrent-rasterbar-1.0.3\n $ ./configure --disable-debug --disable-dependency-tracking --disable-silent-rules --enable-encryption --prefix=$VIRTUAL_ENV --with-boost-python --enable-dht --with-libiconv --with-boost-libdir=/usr/lib/x86_64-linux-gnu/ --enable-python-binding PYTHON=python PYTHON_LDFLAGS=\"$(python-config --libs)\"\n $ make\n $ make install\n\nYou may also need to run:\n\n::\n\n $ python setup.py install\n $ export LD_LIBRARY_PATH=/usr/local/lib/\n\nCompiling Issues\n~~~~~~~~~~~~~~~~\n\nIf g++ freezes or errors while building libtorrent, you may not have\nenough memory on your instance (can be a problem with small Digital\nOcean instances). You can try to bypass this issue by creating and\nenabling a swap file at least 1GB in size:\n\n::\n\n $ dd if=/dev/zero of=/var/swap.img bs=1024k count=1000\n $ mkswap /var/swap.img\n $ swapon /var/swap.img\n\nThen, try building again.\n\nWindows\n-------\n\nIf you are on Windows, after you install Boost and libtorrent, you can\nuse `installation\npackages `__\nprovided by the libtorrent project to install the Python bindings.\n\nUsage\n=====\n\nGenerate a New Torrent File\n---------------------------\n\n::\n\n >>> from storjtorrent import StorjTorrent as st\n\n >>> st.generate_torrent([], shard_directory='../storj/data/myshards')\n\n``generate_torrent()`` is a static method you can use to generate a\ntorrent file from a specified folder. At a minimum, you will need to\ndefine the folder location. Additional parameters include\n``piece_size``, ``pad_size_limit``, ``flags``, ``comment``, ``creator``,\n``private``, ``bootstrap_node``, ``bootstrap_port``, ``torrent_name``\nand ``verbose``.\n\nRetrieve Hash of Torrent File\n-----------------------------\n\n::\n\n >>> from storjtorrent import StorjTorrent as st\n\n >>> st.get_hash([], '../path/to/your/torrentfile')\n 'e90e06f2a2461801ac6f7a4b4bccd7f1f16393d3'\n\n``get_hash()`` retrieves the SHA1 hash of the specified torrent file as a libtorrent sha1_hash object. You can apply `.to_str()\nto the result to get an encoded string. This string can be used with a magnet link to let others find and download\nyour torrent via DHT. For example, if the command returns\n``e90e06f2a2461801ac6f7a4b4bccd7f1f16393d3``, you could use a\ncorresponding magnet link of\n``magnet:?xt=urn:btih:e90e06f2a2461801ac6f7a4b4bccd7f1f16393d3``.\n\nAdding a Torrent to the Session\n-------------------------------\n\n::\n\n >>> from storjtorrent import StorjTorrent\n\n >>> st = StorjTorrent()\n >>> st.add_torrent([], '../path/to/your/torrentfile', True)\n\nOnce you create a ``StorjTorrent()`` object, a torrent management\nsession is automatically created for you and awaits the addition of a\ntorrent. The first string parameter is the local path, magnet link or\nURL of the torrent you wish to add. The boolean parameter indicates\nwhether you are seeding a torrent you created (and have all the data\nfor). By setting ``seeding=True``, you enable\n`super-seeding `__.\n\nRemoving a Torrent from the Session\n-----------------------------------\n\n::\n\n >>> st.remove_torrent([], path='../path/to/your.torrent', delete_files=false)\n\n``remove_torrent()`` indicates that StorjTorrent should no longer be\nmanaging this torrent. You can indicate which torrent to stop managing\nby passing its corresponding SHA1 hash object (which can be determined\nusing ``get_hash()``) or path. You also have the option of deleting all\nassociated torrent data files or not.\n\nHalting a Session\n-----------------\n\n::\n\n >>> st.halt_session()\n\n``halt_session()`` indicates that StorjTorrent should sleep or stop\nactively managing torrents. StorjTorrent attempts to automatically\nmanage its sleep state most of the time. For example, if you remove the\n'last' torrent that StorjTorrent was managing, it will automatically put\nitself to sleep. If you then add a new torrent, it will 'wake up' again.\n\nIt is important to use ``halt_session()`` before you terminate a process\nusing StorjTorrent as the session management is running in a separate\nthread and won't be terminated automatically if it is still managing\ntorrents.\n\nRetrieving Status of Torrents and Alerts\n----------------------------------------\n\n::\n\n >>> st.get_status()\n {'alerts': ['incoming dht get_peers: ce90f455c3b4928d66006f569b16e2018e405fd2'], 'torrents': {'fake': {'download_rate': 0, 'distributed_copies': -1.0, 'state_str': 'seeding', 'upload_rate': 0, 'progress': 1.0, 'num_peers': 0, 'num_seeds': 0}}}\n\n``get_status()`` returns a dictionary with with an array of ``alerts``\nand sub-dictionary of torrent statuses. The status dictionary updates\nevery five seconds (though this can be reconfigured). The alerts\nindicate recent events occuring with StorjTorrent (passed via\nlibtorrent), such as new DHT peers. The ``torrents`` dictionary contains\ninformation about each torrent that StorjTorrent is managing. It in\ncludes information such as download rate, upload rate, state (e.g.\nseeding, downloading, uploading, etc.) and overall progress.\n\n.. |Build Status| image:: https://travis-ci.org/Storj/storjtorrent.svg\n :target: https://travis-ci.org/Storj/storjtorrent\n.. |Coverage Status| image:: https://img.shields.io/coveralls/Storj/storjtorrent.svg\n :target: https://coveralls.io/r/Storj/storjtorrent\n.. |PyPi Version| image:: https://badge.fury.io/py/storjtorrent.svg\n :target: http://badge.fury.io/py/storjtorrent",
"description_content_type": null,
"docs_url": null,
"download_url": "https://github.com/storj/storjtorrent/tarball/v0.1.2-alpha",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/Storj/storjtorrent",
"keywords": "storj,storjtorrent,bittorrent",
"license": "The MIT License (MIT)\n\nCopyright (c) 2014 Storj Labs\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.",
"maintainer": null,
"maintainer_email": null,
"name": "storjtorrent",
"package_url": "https://pypi.org/project/storjtorrent/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/storjtorrent/",
"project_urls": {
"Download": "https://github.com/storj/storjtorrent/tarball/v0.1.2-alpha",
"Homepage": "https://github.com/Storj/storjtorrent"
},
"release_url": "https://pypi.org/project/storjtorrent/0.1.2/",
"requires_dist": null,
"requires_python": null,
"summary": "StorjTorrent is a wrapper library for libtorrent.",
"version": "0.1.2"
},
"last_serial": 1422874,
"releases": {
"0.1.0": [],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "19cc374328ef8a3b36ca171ec798b89d",
"sha256": "da0a25bbb69e69f67c8c253af36ccd2f5e8b90f6956ef9376628bcbb5641ea2c"
},
"downloads": -1,
"filename": "storjtorrent-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "19cc374328ef8a3b36ca171ec798b89d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14833,
"upload_time": "2015-01-25T01:40:26",
"url": "https://files.pythonhosted.org/packages/ca/f1/388d0bba48f4b37d8b8e47e26b54cc2f498e3fd05caf30a0f2237018acf5/storjtorrent-0.1.1.tar.gz"
}
],
"0.1.2": [
{
"comment_text": "",
"digests": {
"md5": "65249efe8ce19ecc54fe1879b4ea2f8d",
"sha256": "60e247d7e0b5acc6aee33f2f00a13dd2a9185228e931c384191eb0cbfb957aad"
},
"downloads": -1,
"filename": "storjtorrent-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "65249efe8ce19ecc54fe1879b4ea2f8d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14848,
"upload_time": "2015-02-14T03:41:31",
"url": "https://files.pythonhosted.org/packages/9e/15/bd8962dd38713a65e8a03840113e34181dfbea25446b02862d2abb72c437/storjtorrent-0.1.2.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "65249efe8ce19ecc54fe1879b4ea2f8d",
"sha256": "60e247d7e0b5acc6aee33f2f00a13dd2a9185228e931c384191eb0cbfb957aad"
},
"downloads": -1,
"filename": "storjtorrent-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "65249efe8ce19ecc54fe1879b4ea2f8d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14848,
"upload_time": "2015-02-14T03:41:31",
"url": "https://files.pythonhosted.org/packages/9e/15/bd8962dd38713a65e8a03840113e34181dfbea25446b02862d2abb72c437/storjtorrent-0.1.2.tar.gz"
}
]
}