Skip to main content

EditorConfig File Locator and Interpreter for Python

Project description

https://secure.travis-ci.org/editorconfig/editorconfig-core-py.png?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 "%s=%s" % (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:

cmake .
ctest .

License

Unless otherwise stated, all files are distributed under the PSF license. The odict library (editorconfig/odict.py) is distributed under the New BSD license. See LICENSE.txt file for details on PSF license.

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.10.1.tar.gz (20.2 kB view details)

Uploaded Source

File details

Details for the file EditorConfig-0.10.1.tar.gz.

File metadata

File hashes

Hashes for EditorConfig-0.10.1.tar.gz
Algorithm Hash digest
SHA256 0a9cb2751e7faeeca9b4c4e9afc225891b68b5bcc6422de9de7f49293a71aecf
MD5 fc85458129bab9602b6fa1b8763860bb
BLAKE2b-256 7d61c8727b3be2e156046daed2fadaf5b46788968ad17b1a7d597d986337763a

See more details on using hashes here.

Supported by

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