semvec/pypi-packages huggingface dataset:
python-loc-counter 0.2
Get LOC metrics for python scripts
License: MIT
Keywords: python,lines of code,loc

# python-loc-counter

The python-loc-counter module was built to count various LOC metrics:
- source_loc (Everything thats not a comment or blank line)
- single_comment_loc (Comments with the pound key)
- single_docstring_loc (Docstrings with single quotes)
- double_docstring_loc (Docstrings with double quotes)
- total_comments_loc (single_comment_loc + single_docstring_loc + double_docstring_loc)
- blank_loc (Any whitespace designated only with string.whitespace)
- total_line_count (Typical line count)

This uses extensive regex to try to cover weird edge cases, like comments in the middle of a src line (I recommend a quick review about how comments are decidely handled in tests/randomFile.txt). This is written entirely in python with no dependencies outside the standard library. Made to be used as a library.

### Installation
This package is locted on [github](https://github.com/BryceV/python_loc_counter) and [pypi](https://pypi.org/project/python-loc-counter/). If you have pip installed the easiest way to install is:

```sh
$ pip install python-loc-counter
```

### Example Usage

```sh
from python_loc_counter import LOCCounter

def main():
    counter = LOCCounter(<file_name>)
    loc_data = counter.getLOC()
    print(loc_data)
```

This will print a dictionary that might look something like:
```sh
{
    total_src_loc:1757
    total_single_comments_loc:75
    total_single_docstrings_loc:0
    total_double_docstrings_loc:179
    total_blank_loc:516
    total_comments_loc:254
    total_line_count:2530
}
```

### Development
See a feature or found a bug? Feel free to make suggestions or (better yet) contributions for future iterations!
   
### Example Projects
- Originally this module was built for: https://github.com/bcdasilv/code-style-mining/tree/python_analysis.
assault 1.0.0
A simple CLI load testing tool.
License: MIT
Requires Python: >=3.7.0


# assault

A simple CLI load testing tool.

## Installation

Install using `pip`:

```
$ pip install assault
```

## Usage

The simplest usage of `assault` requires only a URL to test against and 500 requests synchronously (one at a time). This is what it would look like:

```
$ assault https://example.com
.... Done!
--- Results ---
Successful requests     500
Slowest                 0.010s
Fastest                 0.001s
Average                 0.003s
Total time              0.620s
Requests Per Minute     48360
Requests Per Second     806
```

If we want to add concurrency, we'll use the `-c` option, and we can use the `-r` option to specify how many requests that we'd like to make:

```
$ assault -r 3000 -c 10 https://example.com
.... Done!
--- Results ---
Successful requests     3000
Slowest                 0.010s
Fastest                 0.001s
Average                 0.003s
Total time              2.400s
Requests Per Minute     90000
Requests Per Second     1250
```

If you'd like to see these results in JSON format, you can use the `-j` option with a path to a JSON file:

```
$ assault -r 3000 -c 10 -j output.json https://example.com
.... Done!
```

## Development

For working on `assult`, you'll need to have Python >= 3.7 (because we'll use `asyncio`) and [`pipenv`][1] installed. With those installed, run the following command to create a virtualenv for the project and fetch the dependencies:

```
$ pipenv install --dev
...
```

Next, activate the virtualenv and get to work:

```
$ pipenv shell
...
(assault) $
```

[1]: https://docs.pipenv.org/en/latest/