Metadata-Version: 2.1
Name: einsteinify
Version: 1.1.1
Summary: A package that transforms every C #include absolute path to a given directory to a relative path to the .c or .h file
Home-page: https://github.com/euberdeveloper/einsteinify
License: MIT
Keywords: c,.h,paths,includes,einsteinify,relative paths
Author: Eugenio Berretta
Author-email: euberdeveloper@gmail.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Project-URL: Repository, https://github.com/euberdeveloper/einsteinify
Description-Content-Type: text/markdown

# einsteinify
A pip moudle that transforms every C #include absolute path to a given directory to a relative path to the .c or .h file

## Install

You can install einsteinify with pip:

```sh
$ pip install einsteinify
```

## Project purpose

It may happen that you have a folder with `.c` and `.h` files where some the `#include "*.h"` are **global paths** to respect to the root folder. This module makes them **relative paths** to the root folder.

## Usage (global module)

```sh
$ einsteinify path/to/root/folder
```

## Usage (local module)

```python
from einsteinify import einsteinify

PATH = 'path/to/root/folder'

einsteinify(PATH)
```

## Result

Suppose that you have a directory like this:

```
root
 ├── main.h
 ├── other.h
 ├─> services
 │   └── services.h
 └─> utils
     └── utils.h
```

Where initially:

**main.h**

```c
#include "root/other.h"
#include "root/services/services.h"
```

**other.h**

```c
#include "root/utils/utils.h"
```

**utils.h**

```c
#include "root/other.h"
#include "root/services/services.h"
```

After running **einsteinify** the includes would be:

**main.h**

```c
#include "./other.h"
#include "./services/services.h"
```

**other.h**

```c
#include "./utils/utils.h"
```

**utils.h**

```c
#include "../other.h"
#include "../services.h"
```

