A better way to handle .editorconfig files with Python.
Project description
pyeditorconfig
Note 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 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:
from os import path
from pyeditorconfig import get_config
print(get_config(__file__))
print(get_config(path.abspath("examples.py")))
# Both print the cofig of this file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyeditorconfig-0.0.1.tar.gz
.
File metadata
- Download URL: pyeditorconfig-0.0.1.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f437b0479f9a3911a6eb01aba3ebf97fba754635a1fcef8b858a922a3b40b09 |
|
MD5 | 30ba363323d44df69ff37df6626b9116 |
|
BLAKE2b-256 | 92990015bf5a56b05237a294814c4eb6957880b61978ee4072620ef854a57da7 |
Provenance
File details
Details for the file pyeditorconfig-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: pyeditorconfig-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfc00788d116761a6d64542846d3257b3abb0c946710a7ad00785ed736be0f6f |
|
MD5 | fae32c940e3a0e5f0c403510e52934df |
|
BLAKE2b-256 | f372ba0d0ff6970d567b08fde66729f9cba6c5d77bf71dc3f80fcce6f07772e1 |