Skip to main content

EditorConfig File Locator and Interpreter for Python

Project description

https://img.shields.io/pypi/v/EditorConfig.svg https://img.shields.io/pypi/wheel/EditorConfig.svg https://img.shields.io/pypi/pyversions/EditorConfig.svg https://secure.travis-ci.org/editorconfig/editorconfig-core-py.svg?branch=master

EditorConfig Python Core provides the same functionality as the EditorConfig C Core. EditorConfig Python core can be used as a command line program or as an importable library.

EditorConfig Project

EditorConfig makes it easy to maintain the correct coding style when switching between different text editors and between different projects. The EditorConfig project maintains a file format and plugins for various text editors which allow this file format to be read and used by those editors. For information on the file format and supported text editors, see the EditorConfig website.

Installation

With setuptools:

sudo python setup.py install

Getting Help

For help with the EditorConfig core code, please write to our mailing list. Bugs and feature requests should be submitted to our issue tracker.

If you are writing a plugin a language that can import Python libraries, you may want to import and use the EditorConfig Python Core directly.

Using as a Library

Basic example use of EditorConfig Python Core as a library:

from editorconfig import get_properties, EditorConfigError

filename = "/home/zoidberg/humans/anatomy.md"

try:
    options = get_properties(filename)
except EditorConfigError:
    print("Error occurred while getting EditorConfig properties")
else:
    for key, value in options.items():
        print(f"{key}={value}")

For details, please take a look at the online documentation.

Running Test Cases

Cmake has to be installed first. Run the test cases using the following commands:

export PYTHONPATH=$(pwd)
cmake .
ctest .

Use -DPYTHON_EXECUTABLE to run the tests using an alternative versions of Python (e.g. Python 3.12):

cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.12 .
ctest .

License

See COPYING file for licensing details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

editorconfig-0.17.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

editorconfig-0.17.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file editorconfig-0.17.1.tar.gz.

File metadata

  • Download URL: editorconfig-0.17.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for editorconfig-0.17.1.tar.gz
Algorithm Hash digest
SHA256 23c08b00e8e08cc3adcddb825251c497478df1dada6aefeb01e626ad37303745
MD5 7c8fa1ddcbe8b9941b83141051b8e1e3
BLAKE2b-256 883aa61d9a1f319a186b05d14df17daea42fcddea63c213bcd61a929fb3a6796

See more details on using hashes here.

File details

Details for the file editorconfig-0.17.1-py3-none-any.whl.

File metadata

  • Download URL: editorconfig-0.17.1-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for editorconfig-0.17.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1eda9c2c0db8c16dbd50111b710572a5e6de934e39772de1959d41f64fc17c82
MD5 3c737a3f0ae02ba453c90869a6d5a534
BLAKE2b-256 96fda40c621ff207f3ce8e484aa0fc8ba4eb6e3ecf52e15b42ba764b457a9550

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page