{"id":13502146,"url":"https://github.com/eyalr/unicode_mayo","last_synced_at":"2025-03-29T10:32:46.731Z","repository":{"id":27805483,"uuid":"31294806","full_name":"eyalr/unicode_mayo","owner":"eyalr","description":"The mayo on your unicode sandwich","archived":false,"fork":false,"pushed_at":"2019-08-30T18:56:12.000Z","size":12,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T08:17:10.252Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eyalr.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-25T03:12:39.000Z","updated_at":"2019-08-30T18:55:49.000Z","dependencies_parsed_at":"2022-09-14T16:42:01.498Z","dependency_job_id":null,"html_url":"https://github.com/eyalr/unicode_mayo","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalr%2Funicode_mayo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalr%2Funicode_mayo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalr%2Funicode_mayo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalr%2Funicode_mayo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyalr","download_url":"https://codeload.github.com/eyalr/unicode_mayo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246174207,"owners_count":20735406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T22:02:03.657Z","updated_at":"2025-03-29T10:32:46.411Z","avatar_url":"https://github.com/eyalr.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"============\nunicode_mayo\n============\n\n**unicode_mayo** is the mayo in your unicode sandwich. In your development\nenvironment, use it as a wrapper around unicode and byte strings to see if\nthey're accidentally coming in to contact with byte strings. This can help\ncatch unicode encode/decode errors before they happen in production!\n\n**unicode_mayo** includes two classes: ``UnicodeSafetyWrapper`` and\n``BytestringSafetyWrapper``. The former is meant to envelope unicode strings,\nand warns when they come into contact with byte strings; the latter is meant\nfor byte strings, and warns when it comes into contact with unicode. Place\nthese in strategic places (likely in development environments only), like\n``gettext()`` or all strings from your database.\n\nInstallation\n============\n\nInstallation via ``pip``::\n\n    pip install unicode_mayo\n\nUsage\n=====\n\nSomething like::\n\n    \u003e\u003e\u003e import unicode_mayo\n    \u003e\u003e\u003e wrapped = unicode_mayo.UnicodeSafetyWrapper(u'safety at last!')\n    \u003e\u003e\u003e wrapped.encode('utf-8')\n    'safety at last!'\n    \u003e\u003e\u003e wrapped + u' woohoo!'\n    u'safety at last! woohoo!'\n    \u003e\u003e\u003e wrapped + 'evil bytestring'\n    Traceback (most recent call last):\n      File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n      File \"/Users/eyalr/personal_work/unicode_mayo/src/unicode_mayo/__init__.py\", line 55, in __add__\n        _fail_on_bytes(other)\n      File \"/Users/eyalr/personal_work/unicode_mayo/src/unicode_mayo/__init__.py\", line 90, in _fail_on_bytes\n        _fail_on_bytes_helper(other)\n      File \"/Users/eyalr/personal_work/unicode_mayo/src/unicode_mayo/__init__.py\", line 81, in _fail_on_bytes_helper\n        'Attempted string formatting without decoding utf-8'\n    TypeError: Attempted string formatting without decoding utf-8\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyalr%2Funicode_mayo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyalr%2Funicode_mayo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyalr%2Funicode_mayo/lists"}