{ "info": { "author": "Adam Beckmeyer", "author_email": "adam_git@thebeckmeyers.xyz", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3", "Topic :: Communications :: Chat", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Software Development :: Libraries :: Application Frameworks" ], "description": " \n\n# Gyr\n\nCome talk with us about Gyr on matrix at\n[#gyr:matrix.org](https://matrix.to/#/#gyr:matrix.org)!\n\nGyr is a framework for quickly developing [matrix](https://matrix.org)\n[application\nservices](http://matrix.org/docs/spec/application_service/unstable.html) in\npython3. It provides a WSGI application and several other utilities for working\nwith matrix. \n\nGyr is designed to be a fairly thin layer of abstraction over application\nservice api--just enough to make things easy without pushing you so far from the\nspec that you get confused.\n\n# Installation\n\nPlease install gyr with pip (in a virtualenv if you prefer):\n\n```sh\npip install gyr\n```\n\n# Usage\n\nI'll try to show a bunch of functionality here, but see examples directory for\nfurther usage examples.\n\n```python\nfrom gyr import server, matrix_objects\n\napplication = server.Application(\"http://localhost:8008\", \"foobar\")\n\nas_user = matrix_objects.MatrixUser(\"@example_as:example.com\", application.Api)\nroom = as_user.create_room(alias=\"#foo:example.com\", is_public=True)\n\ndef rm_hndlr(room_id):\n # Gyr will create a user for you if this returns true!\n return False\n \ndef user_hndlr(user_id):\n # Gyr will create the room for you if this returns true!\n return False\n \ndef txn_hndlr(events):\n for event in events:\n \troom.send_notice(\n\t \"Received event type {} in room {} from user {}\".format(event.type,\n\t event.room,\n\t\t\t\t\t\t\t\t event.user)\n\t)\n return True\n\t\napplication.add_handlers(room_handler=rm_hndlr, transaction_handler=txn_hndlr,\n user_handler=user_hndlr)\n```\n\nSave as example.py. Then from the commandline:\n\n```sh\ngunicorn example:application\n```\n\n# Status\n\nVery alpha! Most of the main functionality I'd envisioned is present, however\nthere's poor to non-existent documentation and no unit tests. Contributions are\nwelcome.\n\n# Projects Using Gyr\n\n* [matrix_relay](https://github.com/non-Jedi/matrix_relay)\n* Open a PR or [ping me on matrix](https://matrix.to/#/@abeckmeyer:matrix.org)\n\twith your project. I'd love to hear about anyone building on gyr!\n\n# Modules\n\n## gyr.server\n\n`server` provides the WSGI application class. An instance of\ngyr.server.Application functions as the WSGI app and will automatically\nparse the request and call any handlers provided to the Application\ninstance.\n\n## gyr.api\n\n`api` provides a helpful wrapper for\n[matrix-python-sdk](https://github.com/matrix-org/matrix-python-sdk)'s\napi, changing the parts of the api that are different for application\nservices until such time as similiar changes are merged upstream. Pull\nrequests for these changes have been submitted, and some changes already\nmerged into master.\n\nFor working with the api, I recommend using the wrappers built around\nspecific objects which are available in gyr.matrix_objects.\n\n## gyr.matrix_objects\n\n`matrix_objects` provides helpful wrapper classes around matrix users,\nevents and rooms. It is not designed to be easily used for the normal\nclient-server api but should provide most necessary functionality for\nthe manipulation of users and rooms that an application service might\nneed to do.\n\nPull requests enriching the functionality of these classes are very\nwelcome.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/non-Jedi/gyr", "keywords": "matrix chat falcon WSGI application-service", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "gyr", "package_url": "https://pypi.org/project/gyr/", "platform": "", "project_url": "https://pypi.org/project/gyr/", "project_urls": { "Homepage": "https://github.com/non-Jedi/gyr" }, "release_url": "https://pypi.org/project/gyr/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "A python framework for building matrix application services", "version": "0.2.0" }, "last_serial": 2858090, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "bb3ca3a881016272cb55c6db07675d90", "sha256": "6e703f4a64e203b03c94bdce44e5ca13d66a2799d7c3416eacca829f5bd11632" }, "downloads": -1, "filename": "gyr-0.1.0.tar.gz", "has_sig": false, "md5_digest": "bb3ca3a881016272cb55c6db07675d90", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19602, "upload_time": "2017-04-22T01:34:34", "url": "https://files.pythonhosted.org/packages/37/12/7bea27522c3f998b1d0e24193ea8ab1421d129c1965e034f3fcc969b1882/gyr-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "3f71309342ce4789d957a31d49141fe1", "sha256": "828ca99724ce914dfc44cb2dba163403e2b6a564ee14c22adcd80cfe4aa88e97" }, "downloads": -1, "filename": "gyr-0.2.0.tar.gz", "has_sig": false, "md5_digest": "3f71309342ce4789d957a31d49141fe1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20232, "upload_time": "2017-05-08T01:38:16", "url": "https://files.pythonhosted.org/packages/73/45/13747e3f9dce173a4283f68033bc9bd61b6bf3c3f6856dfc06ddd8598511/gyr-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3f71309342ce4789d957a31d49141fe1", "sha256": "828ca99724ce914dfc44cb2dba163403e2b6a564ee14c22adcd80cfe4aa88e97" }, "downloads": -1, "filename": "gyr-0.2.0.tar.gz", "has_sig": false, "md5_digest": "3f71309342ce4789d957a31d49141fe1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20232, "upload_time": "2017-05-08T01:38:16", "url": "https://files.pythonhosted.org/packages/73/45/13747e3f9dce173a4283f68033bc9bd61b6bf3c3f6856dfc06ddd8598511/gyr-0.2.0.tar.gz" } ] }