{ "info": { "author": "xica development team", "author_email": "info@xica.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Pyramid", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Topic :: Communications :: Chat", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application" ], "description": "djehuty\n=======\n\npost webhook manager written in Python\n\nenvironment\n-----------\n\n- Python2.7 expected.\n\ninstall\n-------\n\nYou can use pip.\n\n::\n\n $ pip install djehuty\n\ncreate djehuty app on heroku\n----------------------------\n\n::\n\n $ pcreate -s djehuty_server YOUR_PROJECT_NAME\n $ cd YOUR_PROJECT_NAME\n $ git init\n $ heroku create\n\nYou can add existing services and commands...\n\nadd service package in requirements.txt for dependency::\n\n cliff==1.6.1\n pyramid==1.5.1\n cornice==0.16.2\n uWSGI==2.0.6\n djehuty==0.0.4\n # add service package.\n djehutyslack==0.0.4\n # add command package.\n djehutylgtm==0.0.1\n -e .\n\nadd pyramid.includes entry in ini-paste for pyramid extension::\n\n pyramid.default_locale_name = en\n pyramid.includes =\n djehuty\n # add module name that has \"includeme\" interface.\n djehutyslack\n\nor implement your custom service in YOUR_PROJECT_NAME/YOUR_PROJECT_NAME/services.py.\n\nimplement custom service\n------------------------\n\nExample code with comments from djehutyslack.\n\ndjehutyslack/djehutyslack/slack.py\n\n.. code:: python\n\n # ..snipped..\n\n from djehuty.service import Service\n\n\n # inherit djehuty.service.Service.\n class Slack(Service):\n\n # add validation(authorization token, user credential, and so on) process.\n def validate(self, request):\n token = request.params.get('token')\n if not token or token != os.environ.get('DJEHUTY_SLACK_OUTGOING_TOKEN'):\n raise HTTPUnauthorized()\n\n # parse web hook request and return global argument for command.Command.app_args.\n def get_service_argument(self, name, request):\n if name == 'user':\n return request.params.get('user_name')\n elif name == 'room':\n return request.params.get('channel_name')\n else:\n raise ValueError('invalid argument name \"{}\"'.format(name))\n\n # parse web hook request and return \"argv\" list for app.App.run.\n def make_command_line(self, request):\n m = re.match(\n r'^{}\\W*(.*)$'.format(request.params.get('trigger_word', '')),\n request.params.get('text', '')\n )\n return shlex.split(m.group(1).encode('utf8')) if m is not None else []\n\n # convert value returned by Command.take_action into appropriate response.\n def make_response(self, result):\n return {\n 'text': result,\n 'link_names': 1,\n 'parse': 'full',\n }\n\n # explicit instantiation required.\n slack = Slack()\n\nimplement service only package\n--------------------------------------\n\nIf you want to publish your service, you need to implement it as a stand-alone python package and should provide \"includeme\" interface.\n\n::\n\n $ pcreate -s djehuty_service YOUR_SERVICE_PROJECT_NAME\n $ cd YOUR_SERVICE_PROJECT_NAME\n (implement your service and publish it as git repository or PyPI package...)\n\n\"includeme\" example code with comments from djehutyslack.\n\ndjehutyslack/djehutyslack/__init__.py\n\n.. code:: python\n\n def includeme(config):\n\n config.scan('djehutyslack.slack')\n\nimplement service in server package\n-----------------------------------\n\nOr if you need not publish your service, simply implement it in your server package and use \"config.scan\".\n\n.. code:: python\n\n from pyramid.config import Configuration\n\n # pyramid entry point.\n def main(global_config, **settings):\n config = Configurator(settings=settings)\n # import your service module into Pyramid by \"config.scan\".\n config.scan('YOUR_PROJECT_NAME.SERVICE_MODULE_NAME')\n return config.make_wsgi_app()\n\nimplement and add custom command\n--------------------------------\n\ndjehuty.command.Command is almost cliff command.After implementing your command, add command name and command class module path in setup.py entry_points.\n\nExample code with comments from djehuty.command.yo.\n\n.. code:: python\n\n from djehuty.command import Command\n\n\n # inherit djehuty.command.Command.\n class Yo(Command):\n '''echo yo''' # add description for help.\n\n # add argparse style argument and return parser.\n def get_parser(self, prog_name):\n parser = Command.get_parser(self, prog_name)\n parser.add_argument('-g', '--greeting',\n default='yo',\n help='greeting message')\n return parser\n\n # return response text.\n def take_action(self, parsed_args):\n return ('@{} '.format(self.app_args.user) if self.app_args.user else '') + parsed_args.greeting\n\nentry_points example code with comments from djehutylgtm.\n\ndjehutylgtm/setup.py\n\n.. code:: python\n\n # ..snipped..\n\n setup(\n name='djehutylgtm',\n # ..snipped..\n entry_points={\n 'djehuty.commands': [\n 'lgtm = djehutylgtm.commands:LGTM',\n ],\n },\n )\n\nimplement command only package\n--------------------------------------\n\nLike a service, if you want to publish your command, you need to implement it as a stand-alone python package.\n\n::\n\n $ pcreate -s djehuty_command YOUR_COMMAND_PROJECT_NAME\n $ cd YOUR_COMMAND_PROJECT_NAME\n (implement your command and publish it as git repository or PyPI package...)\n\ntodo\n----\n\n- Python 3 support\n- unit test\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/xica/djehuty", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "djehuty", "package_url": "https://pypi.org/project/djehuty/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/djehuty/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/xica/djehuty" }, "release_url": "https://pypi.org/project/djehuty/0.0.7/", "requires_dist": null, "requires_python": null, "summary": "POST web hook manager", "version": "0.0.7" }, "last_serial": 1251591, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "06fdd7f476dc21d7fca85faf97a92f58", "sha256": "67e5b82478ac5f2ce7aadb74e57b07f3f2481a456ab299bafeabb96f90a12453" }, "downloads": -1, "filename": "djehuty-0.0.3.tar.gz", "has_sig": false, "md5_digest": "06fdd7f476dc21d7fca85faf97a92f58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2984, "upload_time": "2014-08-07T18:57:17", "url": "https://files.pythonhosted.org/packages/d3/93/50d3e5c648550e678686f15f286c8649d83bdb1a8acc0fc9731bbe584b4f/djehuty-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "c2203ad8ec6fd4033fbc9fd94515039b", "sha256": "a5dd1eff3bbcf52e23c03361dee70dd5e115c7b46c0e19a8d108d2521d1aeda9" }, "downloads": -1, "filename": "djehuty-0.0.4.tar.gz", "has_sig": false, "md5_digest": "c2203ad8ec6fd4033fbc9fd94515039b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3850, "upload_time": "2014-08-25T10:20:38", "url": "https://files.pythonhosted.org/packages/9e/f7/2c3741c0bc18007a3248b67c267f21c498eac25d08081886520fcca4733e/djehuty-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "fca64af82bda1061ceca2f4b0004b0a8", "sha256": "fe3c227abfa975652554ae73c6d28995fe5092d9e6a4c6002139304367f4b5b6" }, "downloads": -1, "filename": "djehuty-0.0.5.tar.gz", "has_sig": false, "md5_digest": "fca64af82bda1061ceca2f4b0004b0a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3851, "upload_time": "2014-08-25T11:44:38", "url": "https://files.pythonhosted.org/packages/f0/86/d396bbf464b305d590649721e5e48516b89263dc504b591f409e4f3127ab/djehuty-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "21cb445c3dc56cf0bedfbd375f58dc4d", "sha256": "ddaa82c4483272b84d057a5b130df96a1d2b1a9e165bf03edbcf5201dd74fc89" }, "downloads": -1, "filename": "djehuty-0.0.6.tar.gz", "has_sig": false, "md5_digest": "21cb445c3dc56cf0bedfbd375f58dc4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5171, "upload_time": "2014-10-03T02:47:25", "url": "https://files.pythonhosted.org/packages/ec/03/533e630d98e10d4cca48e7a5aad8690c18c9b4eb9621b16dd0e89a1236f2/djehuty-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "5cdd4d989d9bc88779a8a9d2244132b5", "sha256": "07116e02f745371d601b159d346060a1d7899c752a6cd30cb3e5c91f4631f1e4" }, "downloads": -1, "filename": "djehuty-0.0.7.tar.gz", "has_sig": false, "md5_digest": "5cdd4d989d9bc88779a8a9d2244132b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5178, "upload_time": "2014-10-08T09:30:52", "url": "https://files.pythonhosted.org/packages/d8/04/878181e3278eac55793dbaff6b41b7fd88a1b3ce7991c52b663e7f4570a9/djehuty-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5cdd4d989d9bc88779a8a9d2244132b5", "sha256": "07116e02f745371d601b159d346060a1d7899c752a6cd30cb3e5c91f4631f1e4" }, "downloads": -1, "filename": "djehuty-0.0.7.tar.gz", "has_sig": false, "md5_digest": "5cdd4d989d9bc88779a8a9d2244132b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5178, "upload_time": "2014-10-08T09:30:52", "url": "https://files.pythonhosted.org/packages/d8/04/878181e3278eac55793dbaff6b41b7fd88a1b3ce7991c52b663e7f4570a9/djehuty-0.0.7.tar.gz" } ] }