Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/luciancooper/cparse

Code parsing command line tool
https://github.com/luciancooper/cparse

Last synced: 2 days ago
JSON representation

Code parsing command line tool

Awesome Lists containing this project

README

        

# cparse

[![PyPI version shields.io](https://img.shields.io/pypi/v/cparse.svg?style=flat-square)](https://pypi.python.org/pypi/cparse/)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/cparse.svg?style=flat-square)](https://pypi.python.org/pypi/cparse/)
[![PyPI license](https://img.shields.io/pypi/l/cparse.svg?style=flat-square)](https://pypi.python.org/pypi/cparse/)
[![readthedocs](https://readthedocs.org/projects/cparse/badge/?version=latest&style=flat-square)](https://cparse.readthedocs.io)

Code parsing command line tool.

## Installation

With `pip` via [PyPi](https://pypi.org)

```bash
pip install cparse
```

Clone the repository and install

```bash
git clone git://github.com/luciancooper/cparse.git
cd cparse
python setup.py install
```

## Documentation
Full documentation can be found [**here**](https://cparse.readthedocs.io)

`cparse ` currently includes 6 commands

* [`ls`](#ls) - list files in directory
* [`tree`](#tree) - print file tree
* [`stat`](#stat) - directory file extension stats
* [`py`](#py) - python code parsing
* [`html`](#html) - html link parsing
* [`css`](#css) - css code parsing

### `ls`
Prints a list of the files in a directory.

```bash
cparse ls [-r] [-n ] [-d | -f] [-a] [-lim ] [-fmt ]
[-exc ] [-inc ]
[-wc ] [-grep ] [-ft ]
[-m | -M | -c | -C | -b | -B | -i | -I | -g | -G]
```

### `tree`
Prints a tree representation of the contents of a directory.

```bash
cparse tree [-d | -f] [-a] [-n ] [-fmt ]
[-exc ] [-inc ]
[-wc ] [-grep ] [-ft ]
[-m | -M | -c | -C | -b | -B | -i | -I | -g | -G]
```

### `stat`

Prints a table displaying the file extension proportions of a directory

```bash
cparse stat [-a]
```

### `py`

Parses the code of a provided python file

```bash
cparse py
```

### `html`

Parses the links in an HTML file and represents them as a file tree.

```bash
cparse html
```

### `css`

Parses CSS code, providing options to condense redundant rules and group identical selectors.

```bash
cparse css [-g] [-c] [-s]
```

## Dependencies

* [pydecorator](https://github.com/luciancooper/pydecorator)