Skip to main content

EditorConfig File Locator and Interpreter for Python

Project description

Image for: Project description

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

Image for: 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

Image for: Installation

With setuptools:

sudo python setup.py install

Getting Help

Image for: 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

Image for: 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

Image for: 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

Image for: License

See COPYING file for licensing details.

Project details

Image for: Project details

Download files

Image for: 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.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

EditorConfig-0.17.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Image for: File details

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

File metadata

  • Download URL: editorconfig-0.17.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for editorconfig-0.17.0.tar.gz
Algorithm Hash digest
SHA256 8739052279699840065d3a9f5c125d7d5a98daeefe53b0e5274261d77cb49aa2
MD5 a542c0959ff28d10059d9866de88e2b1
BLAKE2b-256 b429785595a0d8b30ab8d2486559cfba1d46487b8dcbd99f74960b6b4cca92a4

See more details on using hashes here.

File details

Image for: File details

Details for the file EditorConfig-0.17.0-py3-none-any.whl.

File metadata

File hashes

Hashes for EditorConfig-0.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe491719c5f65959ec00b167d07740e7ffec9a3f362038c72b289330b9991dfc
MD5 5886dba7f1a66ac29380d4f0e38c6938
BLAKE2b-256 afe58dba39ea24ca3de0e954e668107692f4dfc13a85300a531fa9a39e83fde4

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