https://github.com/moosems/pyeditorconfig
A package to parse editorconfig files in Python
https://github.com/moosems/pyeditorconfig
Last synced: 5 months ago
JSON representation
A package to parse editorconfig files in Python
- Host: GitHub
- URL: https://github.com/moosems/pyeditorconfig
- Owner: Moosems
- License: mit
- Created: 2023-04-29T14:42:01.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-13T22:51:02.000Z (about 2 years ago)
- Last Synced: 2025-09-20T14:34:29.064Z (10 months ago)
- Language: Python
- Homepage: https://pypi.org/project/pyeditorconfig/
- Size: 21.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
pyeditorconfig
> **Note**
> The logic in this module was created by @Akuli due to the lack of maintanence of the normal `editorconfig` module. I simply added it to PyPI and made a few changes to the code. All credit goes to @Akuli.
## Description
This module is a simple implementation of the [EditorConfig](https://editorconfig.org/) file format. It is designed to be simple and easy to use. You use the `get_config()` method with a path as an argument and a dict with the configuration will be returned.
## Installation
`pip install pyeditorconfig`
# Documentation
## `get_config(path)`
This method takes an absolute path as an argument and returns a dict with the configuration. If there is no configuration file, it will return an empty dict.
| Argument | Type | Description |
| --- | --- | --- |
| `path` | `os.path.abspath` or `str` | The absolute path to the file. The str must also be the absolute path or it will not work. |
## Example:
```python
from os import path
from pyeditorconfig import get_config
print(get_config(__file__))
```