# morelorless
This is a thin wrapper around `difflib.unified_diff` that Does The Right Thing
for "No newline at eof". The args are also simplified compared to `difflib`:
```py
moreorless.unified_diff(
astr: str,
bstr: str,
filename: str,
n: int = 3,
) -> str:
...
# raises moreorless.patch.PatchException
moreorless.patch.apply_single_file(
contents: str,
patch: str,
allow_offsets: bool = True,
) -> str:
...
# uses click to write to stdout with colors
moreorless.click.echo_color_unified_diff(
astr: str,
bstr: str,
filename: str,
n: int = 3
) -> None:
...
# if you want to use unified_diff yourself first (e.g. in another process)
moreorless.click.echo_color_precomputed_diff(
diff: str,
) -> None:
...
```
# License
morelorless is copyright [Tim Hatch](http://timhatch.com/), and licensed under
the MIT license. I am providing code in this repository to you under an open
source license. This is my personal repository; the license you receive to
my code is from me and not from my employer. See the `LICENSE` file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/thatch/moreorless/",
"name": "moreorless",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Tim Hatch",
"author_email": "tim@timhatch.com",
"download_url": "https://files.pythonhosted.org/packages/c5/5d/c8ed33403f62a2f755905c8d2d36b71e3fc32588deeb53ad1206edbb067a/moreorless-0.4.0.tar.gz",
"platform": "",
"description": "# morelorless\n\nThis is a thin wrapper around `difflib.unified_diff` that Does The Right Thing\nfor \"No newline at eof\". The args are also simplified compared to `difflib`:\n\n```py\nmoreorless.unified_diff(\n astr: str,\n bstr: str,\n filename: str,\n n: int = 3,\n) -> str:\n ...\n\n# raises moreorless.patch.PatchException\nmoreorless.patch.apply_single_file(\n contents: str,\n patch: str,\n allow_offsets: bool = True,\n) -> str:\n ...\n\n# uses click to write to stdout with colors\nmoreorless.click.echo_color_unified_diff(\n astr: str,\n bstr: str,\n filename: str,\n n: int = 3\n) -> None:\n ...\n\n# if you want to use unified_diff yourself first (e.g. in another process)\nmoreorless.click.echo_color_precomputed_diff(\n diff: str,\n) -> None:\n ...\n```\n\n# License\n\nmorelorless is copyright [Tim Hatch](http://timhatch.com/), and licensed under\nthe MIT license. I am providing code in this repository to you under an open\nsource license. This is my personal repository; the license you receive to\nmy code is from me and not from my employer. See the `LICENSE` file for details.\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python diff wrapper",
"version": "0.4.0",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "6b635168aaacec6a262e42be6cab2a1d",
"sha256": "17f1fbef60fd21c84ee085a929fe3acefcaddca30df5dd09c024e9939a9e6a00"
},
"downloads": -1,
"filename": "moreorless-0.4.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "6b635168aaacec6a262e42be6cab2a1d",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6",
"size": 9309,
"upload_time": "2021-03-30T15:10:50",
"upload_time_iso_8601": "2021-03-30T15:10:50.703755Z",
"url": "https://files.pythonhosted.org/packages/ad/88/18597dcf9ef8c5e99e1b7961975c56135810fd9d620fc43c6be8362c506a/moreorless-0.4.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "be26b671110104dcb13c6aa1e700c3df",
"sha256": "85e19972c1a0b3a49f8543914f57bd83f6e1b10df144d5b97b8c5e9744d9c08c"
},
"downloads": -1,
"filename": "moreorless-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "be26b671110104dcb13c6aa1e700c3df",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 10127,
"upload_time": "2021-03-30T15:10:52",
"upload_time_iso_8601": "2021-03-30T15:10:52.082981Z",
"url": "https://files.pythonhosted.org/packages/c5/5d/c8ed33403f62a2f755905c8d2d36b71e3fc32588deeb53ad1206edbb067a/moreorless-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-03-30 15:10:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "thatch",
"github_project": "moreorless",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "moreorless"
}