conflict-collection


Nameconflict-collection JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryData collection from Git merge conflicts.
upload_time2025-09-03 02:49:04
maintainerNone
docs_urlNone
authorJinu Jang
requires_python>=3.10
licenseNone
keywords conflict git merge parser version-control
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # conflict-collection

[![PyPI version](https://badge.fury.io/py/conflict-collection.svg)](https://badge.fury.io/py/conflict-collection)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Python Versions](https://img.shields.io/pypi/pyversions/conflict-collection.svg)](https://pypi.org/project/conflict-collection/)
[![Downloads](https://pepy.tech/badge/conflict-collection)](https://pepy.tech/project/conflict-collection)

> Data collection toolkit for Git merge conflicts: structural types, social signals, and similarity metrics.

`conflict-collection` builds on [`conflict-parser`](https://github.com/jinu-jang/conflict-parser) to turn raw in-progress merges into rich, typed records suitable for research, analytics, or ML.

---

## ✨ Features

- Classify and enumerate merge conflict cases (modify/modify, add/add, delete/modify, etc.)
- Produce structured frozen dataclasses with per-side contents & resolution metadata
- Build canonical 5‑tuples (A,B,O,M,R) for dataset curation
- Extract social / ownership signals (recency, blame composition, integrator priors)
- Compute a 3‑way anchored similarity ratio between two resolution candidates
- Fully typed (PEP 561) & test‑covered

---

## 📦 Install

```bash
pip install conflict-collection
# or with documentation extras
pip install conflict-collection[docs]
```

---

## 🚀 Quick Start

```python
from conflict_collection.collectors.conflict_type import collect as collect_conflicts
from conflict_collection.collectors.societal import collect as collect_social
from conflict_collection.metrics.anchored_ratio import anchored_ratio

# 1) Enumerate conflict cases after a merge produced conflicts
cases = collect_conflicts(repo_path='.', resolution_sha='<resolved-commit-sha>')
print(len(cases), 'cases')
print(cases[0].conflict_type, cases[0].conflict_path)

# 2) Capture social signals
signals = collect_social(repo_path='.')
for path, rec in signals.items():
	print(path, rec.ours_author, rec.owner_commits_ours)

# 3) Similarity metric example
O = 'line1\nline2\nline3'
R = 'line1\nX\nline3'
R_hat = 'line1\nY\nline3'
print('anchored ratio =', anchored_ratio(O, R, R_hat))
```

---

## 📚 Documentation

Full docs (usage guides + auto-generated API reference) are published with MkDocs & mkdocstrings:

https://jinu-jang.github.io/conflict-collection

Local build:

```bash
pip install -e .[docs]
mkdocs serve
```

---

## 🧩 Data Models

| Model | Purpose |
| ----- | ------- |
| Typed Conflict Cases | Frozen dataclasses per conflict archetype |
| `Conflict5Tuple` | Canonical (A,B,O,M,R) capture |
| Social Signals | Ownership & recency metrics per file |
| Anchored Ratio | Algorithmic similarity between two edits |

---

## 🔬 Testing

```bash
git clone https://github.com/jinu-jang/conflict-collection
cd conflict-collection
pip install -e .[dev]
pytest -q
```

---

## 🤝 Contributing

PRs welcome! Please:

1. Add or update tests
2. Run `black . && isort . && pytest -q`
3. If adding public API, include docstrings & update docs nav (`mkdocs.yml`)

See `docs/contributing.md` for details.

---

## 📄 License

MIT © 2025 Jinu Jang

---

## 🔖 Status

Beta. Interfaces may change before 0.1. Feedback appreciated.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "conflict-collection",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "conflict, git, merge, parser, version-control",
    "author": "Jinu Jang",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/7b/2c/a315c954de23a7ec6a18f6ef76c162c6768ee1c933e4c3c8ce797406e6f1/conflict_collection-0.0.2.tar.gz",
    "platform": null,
    "description": "# conflict-collection\n\n[![PyPI version](https://badge.fury.io/py/conflict-collection.svg)](https://badge.fury.io/py/conflict-collection)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![Python Versions](https://img.shields.io/pypi/pyversions/conflict-collection.svg)](https://pypi.org/project/conflict-collection/)\n[![Downloads](https://pepy.tech/badge/conflict-collection)](https://pepy.tech/project/conflict-collection)\n\n> Data collection toolkit for Git merge conflicts: structural types, social signals, and similarity metrics.\n\n`conflict-collection` builds on [`conflict-parser`](https://github.com/jinu-jang/conflict-parser) to turn raw in-progress merges into rich, typed records suitable for research, analytics, or ML.\n\n---\n\n## \u2728 Features\n\n- Classify and enumerate merge conflict cases (modify/modify, add/add, delete/modify, etc.)\n- Produce structured frozen dataclasses with per-side contents & resolution metadata\n- Build canonical 5\u2011tuples (A,B,O,M,R) for dataset curation\n- Extract social / ownership signals (recency, blame composition, integrator priors)\n- Compute a 3\u2011way anchored similarity ratio between two resolution candidates\n- Fully typed (PEP 561) & test\u2011covered\n\n---\n\n## \ud83d\udce6 Install\n\n```bash\npip install conflict-collection\n# or with documentation extras\npip install conflict-collection[docs]\n```\n\n---\n\n## \ud83d\ude80 Quick Start\n\n```python\nfrom conflict_collection.collectors.conflict_type import collect as collect_conflicts\nfrom conflict_collection.collectors.societal import collect as collect_social\nfrom conflict_collection.metrics.anchored_ratio import anchored_ratio\n\n# 1) Enumerate conflict cases after a merge produced conflicts\ncases = collect_conflicts(repo_path='.', resolution_sha='<resolved-commit-sha>')\nprint(len(cases), 'cases')\nprint(cases[0].conflict_type, cases[0].conflict_path)\n\n# 2) Capture social signals\nsignals = collect_social(repo_path='.')\nfor path, rec in signals.items():\n\tprint(path, rec.ours_author, rec.owner_commits_ours)\n\n# 3) Similarity metric example\nO = 'line1\\nline2\\nline3'\nR = 'line1\\nX\\nline3'\nR_hat = 'line1\\nY\\nline3'\nprint('anchored ratio =', anchored_ratio(O, R, R_hat))\n```\n\n---\n\n## \ud83d\udcda Documentation\n\nFull docs (usage guides + auto-generated API reference) are published with MkDocs & mkdocstrings:\n\nhttps://jinu-jang.github.io/conflict-collection\n\nLocal build:\n\n```bash\npip install -e .[docs]\nmkdocs serve\n```\n\n---\n\n## \ud83e\udde9 Data Models\n\n| Model | Purpose |\n| ----- | ------- |\n| Typed Conflict Cases | Frozen dataclasses per conflict archetype |\n| `Conflict5Tuple` | Canonical (A,B,O,M,R) capture |\n| Social Signals | Ownership & recency metrics per file |\n| Anchored Ratio | Algorithmic similarity between two edits |\n\n---\n\n## \ud83d\udd2c Testing\n\n```bash\ngit clone https://github.com/jinu-jang/conflict-collection\ncd conflict-collection\npip install -e .[dev]\npytest -q\n```\n\n---\n\n## \ud83e\udd1d Contributing\n\nPRs welcome! Please:\n\n1. Add or update tests\n2. Run `black . && isort . && pytest -q`\n3. If adding public API, include docstrings & update docs nav (`mkdocs.yml`)\n\nSee `docs/contributing.md` for details.\n\n---\n\n## \ud83d\udcc4 License\n\nMIT \u00a9 2025 Jinu Jang\n\n---\n\n## \ud83d\udd16 Status\n\nBeta. Interfaces may change before 0.1. Feedback appreciated.",
    "bugtrack_url": null,
    "license": null,
    "summary": "Data collection from Git merge conflicts.",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/jinu-jang/conflict-collection",
        "Issues": "https://github.com/jinu-jang/conflict-collection/issues",
        "Repository": "https://github.com/jinu-jang/conflict-collection.git"
    },
    "split_keywords": [
        "conflict",
        " git",
        " merge",
        " parser",
        " version-control"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9261d693ae011b0996ac9747f6e5c0055181367b7c89b9bd98612e7bf43fffcb",
                "md5": "c9417c5c64e535dd13ecd96ffc481a00",
                "sha256": "7845a824811f8228d36d0d5f2cb1f6ba3a5110907499712ee2578b0a04c3374f"
            },
            "downloads": -1,
            "filename": "conflict_collection-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c9417c5c64e535dd13ecd96ffc481a00",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 20511,
            "upload_time": "2025-09-03T02:49:03",
            "upload_time_iso_8601": "2025-09-03T02:49:03.386268Z",
            "url": "https://files.pythonhosted.org/packages/92/61/d693ae011b0996ac9747f6e5c0055181367b7c89b9bd98612e7bf43fffcb/conflict_collection-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7b2ca315c954de23a7ec6a18f6ef76c162c6768ee1c933e4c3c8ce797406e6f1",
                "md5": "86a6b720ccbcab2ce0914b1ed8f4cb3f",
                "sha256": "4466f0a3d20be7f5a2922369ad00d06de6feac8a52c534bd5e04b25021c8f246"
            },
            "downloads": -1,
            "filename": "conflict_collection-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "86a6b720ccbcab2ce0914b1ed8f4cb3f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 17008,
            "upload_time": "2025-09-03T02:49:04",
            "upload_time_iso_8601": "2025-09-03T02:49:04.414451Z",
            "url": "https://files.pythonhosted.org/packages/7b/2c/a315c954de23a7ec6a18f6ef76c162c6768ee1c933e4c3c8ce797406e6f1/conflict_collection-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-03 02:49:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jinu-jang",
    "github_project": "conflict-collection",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "conflict-collection"
}
        
Elapsed time: 5.11650s