Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/editorconfig/editorconfig-core-py
Clone of EditorConfig core written in Python
https://github.com/editorconfig/editorconfig-core-py
Last synced: 4 days ago
JSON representation
Clone of EditorConfig core written in Python
- Host: GitHub
- URL: https://github.com/editorconfig/editorconfig-core-py
- Owner: editorconfig
- License: other
- Created: 2012-03-03T18:48:44.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-02-12T08:24:11.000Z (9 months ago)
- Last Synced: 2024-08-18T10:29:10.952Z (3 months ago)
- Language: Python
- Homepage: http://editorconfig.org
- Size: 1.86 MB
- Stars: 92
- Watchers: 9
- Forks: 22
- Open Issues: 7
-
Metadata Files:
- Readme: README.rst
- License: COPYING
Awesome Lists containing this project
README
========================
EditorConfig Python Core
========================
.. image:: https://img.shields.io/pypi/v/EditorConfig.svg
:target: https://pypi.python.org/pypi/EditorConfig.. image:: https://img.shields.io/pypi/wheel/EditorConfig.svg
:target: https://pypi.python.org/pypi/EditorConfig.. image:: https://img.shields.io/pypi/pyversions/EditorConfig.svg
:target: https://pypi.python.org/pypi/EditorConfig.. image:: https://secure.travis-ci.org/editorconfig/editorconfig-core-py.svg?branch=master
:target: http://travis-ci.org/editorconfig/editorconfig-core-pyEditorConfig 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:
.. code-block:: python
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.