# Merge Requirements

A simple tool to merge multiple `requirements.txt` files into a single file. It merges requirements where it can and flags merge conflicts wherever they are.

## Installation

To use this tool, you need to have Python 3 installed. You can then clone this repository and install the dependencies:

```bash
git clone https://github.com/username/repo.git
cd merge-requirements
pip install -r requirements.txt
```

## Usage

To use the tool, you can run the `merge_req.py` script with a list of `requirements.txt` files to merge. The merged requirements will be saved in a file called `merged_requirements.txt` by default.

```bash
python merge_req.py requirements1.txt requirements2.txt requirements3.txt
```

You can also specify a different output file using the `-o` or `--output` option:

```bash
python merge_req.py requirements1.txt requirements2.txt -o merged.txt
```

## Example

Let's say you have two `requirements.txt` files:

**requirements1.txt**

```
numpy==1.22.0
pandas==1.4.2
```

**requirements2.txt**

```
numpy==1.23.0
matplotlib>=3.5.0
```

After running the tool, the `merged_requirements.txt` file will contain the following:

```
# CONFLICT: Found multiple versions for numpy: ==1.22.0 and ==1.23.0
# numpy==1.22.0
# numpy==1.23.0
matplotlib>=3.5.0
pandas==1.4.2
```