{ "info": { "author": "David Brodsky, Chris Ballinger", "author_email": "dbro@dbro.pro, chrisballinger@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP" ], "description": "django-broadcast\n======================================\n\n[![Build Status](https://img.shields.io/travis/PerchLive/django-broadcast.svg)](https://travis-ci.org/PerchLive/django-broadcast) [![PyPI Page](https://img.shields.io/pypi/v/django-broadcast.svg)](https://pypi.python.org/pypi/django-broadcast) [![Coverage Status](https://img.shields.io/coveralls/PerchLive/django-broadcast.svg)](https://coveralls.io/github/PerchLive/django-broadcast?branch=master) [![Python Versions](https://img.shields.io/pypi/pyversions/django-broadcast.svg)](https://pypi.python.org/pypi/django-broadcast) [![Downloads per Day](https://img.shields.io/pypi/dd/django-broadcast.svg)](https://pypi.python.org/pypi/django-broadcast)\n\n\nOverview\n--------\n\nVideo broadcasting support for Django apps. Designed to abstract provisioning backend storage for video streaming clients behind\nsimple \"Start Stream\" and \"Stop Stream\" API calls.\n\nAPI\n---\n\nThese endpoints are all `POST`. Parameters are URL encoded for request, and JSON encoded for response.\n\n## /stream/start/\n\n#### Request (url encoded)\n\n```\n{\n 'type' : 'hls' (this is the only option currently supported)\n\t'name' : 'some_name' (optional)\n}\n\n```\n\ne.g: `https://endpoint.tld/stream/start/?name=some_name&type=hls`\n\t\n\n#### Response (json encoded)\n\n```javascript\n{\n\t'stream' : {\n\t\t'id' : 'stream_id', (generally a UUID or similar)\n\t\t'name' : 'some_name',\n\t\t'start_date' : '2015-10-22 15:27:40', (time always in GMT)\n\t},\n\t'endpoint': {\n\t\t'S3': {\n\t\t\t'aws_access_key_id': 'key'\n\t\t\t'aws_secret_access_key': 'secret',\n\t\t\t'aws_session_token': 'token',\n\t\t\t'aws_expiration': 3600.0 // in seconds\n\t\t\t's3_bucket_name': 'bucket',\n\t\t\t's3_bucket_path': 'path',\n\t\t\t's3_bucket_region': 'us-west-1' // valid amazon region string\n\t\t}\n\t\t// future endpoints could go here, like RTMP, WebRTC, etc\n\t}\n}\n\n```\n\n## /stream/stop/\n\n#### Request (url encoded)\n\n```\n{\n\t'id' : 'stream_id'\n}\n\n```\ne.g: `https://endpoint.tld/stream/start/?id=B8C2401D-B2F8-47CD-90BD-53B608D47F3F`\n\t\n\n#### Response (json encoded)\n\n```javascript\n{\n 'stream': {\n 'id' : 'stream_id',\n 'name' : 'some_name',\n 'start_date' : '2015-10-22 15:27:40', (time always in GMT)\n 'stop_date' : '2015-10-22 16:27:40', (time always in GMT)\n }\n}\n\n```\n\nUsage\n---\nWe currently recommend your hosting Django application setup the URL and views for `/stream/start` and `/stream/stop`.\nWithin those views, you can yield to built-in methods to handle most of the work for you while leaving you ultimate control\nover the request and response formats.\n\nFor example, your `/stream/start` view may look like:\n\n```python\n\n from django.http import JsonResponse\n from django_broadcast.api import start_hls_stream, prepare_start_hls_stream_response\n\n def your_start_stream_view(request):\n\n # Do request validation, etc.\n\n # Prepare for new Stream : This handles creating storage credentials\n # and preparing data needed by mobile client\n start_result = start_hls_stream(request=request)\n # start_result is a python dictionary with format:\n # {'stream': ..., 'storage': ...}\n\n # Use built-in function for standard dictionary representation\n # as specified in API section above.\n serialized_response = prepare_start_hls_stream_response(start_result)\n\n return JsonResponse({'success': true, 'response': serialized_response})\n\n```\n\n\nRequirements\n------------\n\n- Python (2.7, 3.3, 3.4)\n- Django (1.6, 1.7, 1.8)\n- Django REST Framework (2.4, 3.0, 3.1)\n\nInstallation\n------------\n\nInstall using `pip`\n\n $ pip install django-broadcast\n\nSetup\n-----\n\nCurrently django-broadcast supports an `S3` backend:\n\n```python\nBROADCAST_SETTINGS = {\n \"STREAM_MODEL\": \"home.Stream\",\n \"S3\": {\n \"AWS_ACCESS_KEY_ID\": os.environ.get('DJ_BROADCAST_AWS_ACCESS_KEY', ''),\n \"AWS_SECRET_ACCESS_KEY\": os.environ.get('DJ_BROADCAST_AWS_ACCESS_SECRET', ''),\n \"BUCKET\": os.environ.get('DJ_BROADCAST_S3_BUCKET', '')\n }\n}\n\n```\n\nTesting\n-------\n\nInstall testing requirements.\n\n $ pip install -r requirements.txt\n\nRun with runtests.\n\n $ ./runtests.py\n\nYou can also use the excellent `tox`_ testing tool to run the tests\nagainst all supported versions of Python and Django. Install tox\nglobally, and then simply run:\n\n\n $ tox\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/PerchLive/django-broadcast", "keywords": null, "license": "Apache License 2.0", "maintainer": null, "maintainer_email": null, "name": "django-broadcast", "package_url": "https://pypi.org/project/django-broadcast/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-broadcast/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/PerchLive/django-broadcast" }, "release_url": "https://pypi.org/project/django-broadcast/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Video broadcasting support for Django apps", "version": "0.1.1" }, "last_serial": 2011176, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "4e7780b65119bbb6c526254a13bfc768", "sha256": "e5f49da7418a09ff53a1bcd1a7ffd766dcb4975ce7474573e4e36c51ce697374" }, "downloads": -1, "filename": "django-broadcast-0.1.tar.gz", "has_sig": false, "md5_digest": "4e7780b65119bbb6c526254a13bfc768", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13746, "upload_time": "2016-03-08T19:47:08", "url": "https://files.pythonhosted.org/packages/55/9b/ff1f258906f6d89a175696397cc760b1027611a1656fdfbf4a7dbb165568/django-broadcast-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6af00a869fe0d72efc746124fbaacd3a", "sha256": "dfb43a8152ec15f31c33e5d0d8b926304c421c2737e646f336c55c07abdd3dcb" }, "downloads": -1, "filename": "django-broadcast-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6af00a869fe0d72efc746124fbaacd3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13765, "upload_time": "2016-03-16T22:27:02", "url": "https://files.pythonhosted.org/packages/85/5c/7d9cf8f9d19cb8833c1f38b57700b9434ee7e0015689ed3522093f047985/django-broadcast-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6af00a869fe0d72efc746124fbaacd3a", "sha256": "dfb43a8152ec15f31c33e5d0d8b926304c421c2737e646f336c55c07abdd3dcb" }, "downloads": -1, "filename": "django-broadcast-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6af00a869fe0d72efc746124fbaacd3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13765, "upload_time": "2016-03-16T22:27:02", "url": "https://files.pythonhosted.org/packages/85/5c/7d9cf8f9d19cb8833c1f38b57700b9434ee7e0015689ed3522093f047985/django-broadcast-0.1.1.tar.gz" } ] }