{ "info": { "author": "Chris Norman", "author_email": "chris.norman2@googlemail.com", "bugtrack_url": null, "classifiers": [], "description": "# emote-utils\nEmote utilities for text-based games.\n\nThis package is most useful for formatting social strings for use with text-based games like MUDs and MOOs.\n\nA social string might look like:\n\n```\n%1N smile%1s at %2n.\n```\n\n## Quickstart\nFirst get a factory ready. You could use the base `SocialsFactory` class or the helpfully-populated `PopulatedSocialsFactory`.\n\nThis second class contains useful english grammar suffixes for properly converting words like are to is and proper use of e and s for use at the end of words.\n\n```\nfrom emote_utils import PopulatedSocialsFactory\nf = PopulatedSocialsFactory()\n@f.suffix('n', 'name')\n def get_name(obj, suffix):\n return ('you', obj.name)\n```\n\nNext let's create a test class.\n\n```\nclass Person:\n def __init__(self, name):\n self.name = name\n\np1 = Person('Jack')\np2 = Person('Jill')\n```\n\nNow we'll get strings which can be sent to Jack, Jill and anyone else who should see the message.\n\n```\njack_string, jill_string, others_string = f.get_strings('%1N smile%1s at %2n.', [p1, p2])\nprint(jack_string)\n```\n\n> You smile at Jill.\n\n\n```\nprint(jill_string)\n```\n\n> Jack smiles at you.\n\n```\nprint(others_string)\n```\n\n> Jack smiles at Jill.\n\n## More advanced usage\n\n### Social Formatters\nEach social formatter is made up of three parts:\n\n* a per cent (%) sign representing the start of a social formatter.\n* an optional number indicating the index of the object you wish to reference in the list of objects.\n* An optional filter name preceded by a vertical bar (`|`).\n\n### Defaults\n* If no index is provided, `SocialsFactory.default_index` is used.\n* If no suffix is provided, `SocialsFactory.default_suffix` is used.\n* If no filter is provided then one of 3 things will happen.\n\nIn the below list suffix refers either to the name of a suffix provided as part of the social string or the `default_suffix` attribute on the instance of `SocialsFactory` that `get_strings` is being called on.\n\nAttribute names refer to the attributes of `SocialsFactory` that `get_strings` is being called on.\n\n* If the suffix is title case then the title_case_filter attribute will be used.\n* If the suffix is all upper case then the upper_case_filter attribute will be used.\n* If neither of these things are true then suffix is assumed to be lower case and the lower_case_filter is used.\n\nOf course any of these names could be `None` in which case no filtering is applied.\n\n### Filters\nHere is an example of a custom filter:\n\n```\nf.filters['strong'] = lambda string: f'{string}'\n```\n\nIf you were printing your socil strings to HTML you could use this filter to make certain parts of the text stand out.\n\nWith this filter created, you could do:\n\n```\n%1N punch%1e %2n|strong.\n```\n\nA string might then look like:\n\n> John punches Jack.\n\n### Conclusion\n\nTo see all the other configuration options see the docstrings in the package.\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/chrisnorman7/", "keywords": "", "license": "MPL-2", "maintainer": "", "maintainer_email": "", "name": "emote_utils", "package_url": "https://pypi.org/project/emote_utils/", "platform": "", "project_url": "https://pypi.org/project/emote_utils/", "project_urls": { "Homepage": "https://github.com/chrisnorman7/" }, "release_url": "https://pypi.org/project/emote_utils/1.0.7/", "requires_dist": null, "requires_python": "", "summary": "Emote utilities for text-based games.", "version": "1.0.7" }, "last_serial": 3926422, "releases": { "0.0.1.dev2": [ { "comment_text": "", "digests": { "md5": "2709de12d9ee6d62cac0ccafcc31962a", "sha256": "74e292c76c5ef9be734e4a1cc1cf9b5136013fb89816b0d5f9a56f5a5c509602" }, "downloads": -1, "filename": "emote_utils-0.0.1.dev2.tar.gz", "has_sig": false, "md5_digest": "2709de12d9ee6d62cac0ccafcc31962a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9564, "upload_time": "2017-10-18T12:06:37", "url": "https://files.pythonhosted.org/packages/9f/ea/b1e8505cac6888c138ef7f098879f6db11680ca591411789bea25ae3c501/emote_utils-0.0.1.dev2.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "30da10685cac4009f856b8199a8baea4", "sha256": "5e31d5b4d9f4bd342ca2b61a42aae6b0342baa2ef126ba49f4e09bcdb55076a2" }, "downloads": -1, "filename": "emote_utils-1.0.0.tar.gz", "has_sig": false, "md5_digest": "30da10685cac4009f856b8199a8baea4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9561, "upload_time": "2017-11-08T14:58:21", "url": "https://files.pythonhosted.org/packages/a4/45/f1aa01898fea3a0359c4c9dc36f4d86286d5c383f6cda0dc06c56bc00cd4/emote_utils-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "be6d74e351bfc93a33e6413b23d26cfa", "sha256": "4b03780c8231e1cbcb5068ec9beecaac7f34ce868d803fb8493ad76eaad4e2da" }, "downloads": -1, "filename": "emote_utils-1.0.1.tar.gz", "has_sig": false, "md5_digest": "be6d74e351bfc93a33e6413b23d26cfa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9965, "upload_time": "2017-11-08T15:44:37", "url": "https://files.pythonhosted.org/packages/a9/b6/e7e534ec13a9df7dcd0d0bc0b1e61ce3d3b1289c32da55c511a4b05e903b/emote_utils-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "14c3995cbe2f989710accfbfc04de851", "sha256": "285835623eabc1a980343b4fa38894e3dd94d1dc71265a9bf1540202f3c6795e" }, "downloads": -1, "filename": "emote_utils-1.0.2.tar.gz", "has_sig": false, "md5_digest": "14c3995cbe2f989710accfbfc04de851", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10013, "upload_time": "2018-02-05T13:01:07", "url": "https://files.pythonhosted.org/packages/a3/24/078262cedb14b6951aff6ea32921e600269ecb401f74272241d15d8417e0/emote_utils-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "350091462a1a55dfd4dd4f20fa379ce1", "sha256": "7221e24a4f255e2f374c7884c59508580273e7eea3a096b634f13d77e2ad00c9" }, "downloads": -1, "filename": "emote_utils-1.0.3.tar.gz", "has_sig": false, "md5_digest": "350091462a1a55dfd4dd4f20fa379ce1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10242, "upload_time": "2018-03-12T13:44:06", "url": "https://files.pythonhosted.org/packages/e7/d4/8a53ccbd4f4f198e72d0d9e4df3034ebf47958c1a811820967f46faec308/emote_utils-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "62821e2f38ff135c1391dbd9554721a2", "sha256": "3002972efb59d75390afaa9b2cf7638577593114bb04446273015f07cdf246c9" }, "downloads": -1, "filename": "emote_utils-1.0.4.tar.gz", "has_sig": false, "md5_digest": "62821e2f38ff135c1391dbd9554721a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10754, "upload_time": "2018-03-18T09:32:01", "url": "https://files.pythonhosted.org/packages/98/ea/fa695a24123a7ffc7e3b025e6ba07f0849a2da720e465bda9f89ff9eaf2c/emote_utils-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "9c4f20da1e86b5aac77bed30907de156", "sha256": "dc4f611b8a0b898fd796792149c3ea0f4dead10c7c4db3b4059600a3a205df6c" }, "downloads": -1, "filename": "emote_utils-1.0.5.tar.gz", "has_sig": false, "md5_digest": "9c4f20da1e86b5aac77bed30907de156", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13067, "upload_time": "2018-03-21T14:48:12", "url": "https://files.pythonhosted.org/packages/6b/81/de72790ce086d605ec6701f7179cc51ff5d76571feb8be93a053a2491db0/emote_utils-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "54e3e63a74057878496ad05e7282255d", "sha256": "176a1039dc15774ddcda78dba32f931d9214e76a6cb6959abb2e364785ec2ba9" }, "downloads": -1, "filename": "emote_utils-1.0.6.tar.gz", "has_sig": false, "md5_digest": "54e3e63a74057878496ad05e7282255d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13158, "upload_time": "2018-04-23T11:34:24", "url": "https://files.pythonhosted.org/packages/66/1e/56750c5a880821728a5fa4ab828183f06879051d478f9ec2a5c1822283d8/emote_utils-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "0777b8a6519d123b78e4a3b513889b3b", "sha256": "45cae82b34819255909aca78f7b944a5365bf7014b428c8c46ece07aeac99c3e" }, "downloads": -1, "filename": "emote_utils-1.0.7.tar.gz", "has_sig": false, "md5_digest": "0777b8a6519d123b78e4a3b513889b3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13242, "upload_time": "2018-06-03T22:27:28", "url": "https://files.pythonhosted.org/packages/e6/7e/b6388d6bec576268b8d295e7767e9f415543e1574ec65a641c5c332de36b/emote_utils-1.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0777b8a6519d123b78e4a3b513889b3b", "sha256": "45cae82b34819255909aca78f7b944a5365bf7014b428c8c46ece07aeac99c3e" }, "downloads": -1, "filename": "emote_utils-1.0.7.tar.gz", "has_sig": false, "md5_digest": "0777b8a6519d123b78e4a3b513889b3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13242, "upload_time": "2018-06-03T22:27:28", "url": "https://files.pythonhosted.org/packages/e6/7e/b6388d6bec576268b8d295e7767e9f415543e1574ec65a641c5c332de36b/emote_utils-1.0.7.tar.gz" } ] }