semvec/pypi-packages huggingface dataset:
quality-viewer 0.0.3
A simple CLI for rendering Quality Views

# quality-viewer
A simple CLI for rendering [Quality Views](https://blog.colinbreck.com/using-quality-views-to-communicate-software-quality-and-evolution/). Built on [Graphviz](https://www.graphviz.org/).

## Installation
```
pip install quality-viewer
```

## Usage
To use, you need to create a series of JSON documents in a folder. These files define the components in your quality view and the individual scores for each attribute. Scores are out of 10, `quality-viewer` uses the mean to generate the colours in the PDF.

This is an example of the component definition:

```
{
    "component": "my-lovely-component",
    "depends_on": ["my-other-component"],
    "attributes": [
        {
            "name": "code",
            "score": 5,
            "notes": "I wrote this in Uni"
        },
        {
            "name": "tests",
            "score": 2,
            "notes": "I wrote this in Uni"
        }
    ]
}
```

Then you can run the CLI against your folder of component definitions which will generate a PDF in that folder named `quality_view.gv.pdf`:

```
quality-viewer ./my_components
```

If you run these regularly, you probably want to label each PDF. Customise the label on the graph with the `--label` argument:

```
quality-viewer --label "Quality Views - Christmas 2019" ./my_components
```

A fairly elaborate example, which uses dated quality views can be found at (other repo)[more work]. This is a good repo to get started from.

## Development
This repository is setup to validate your work easily, running tests is as simple as:

```
make test
```

And checking your coding style is:

```
make check
```

To automagically conform to the above, run:

```
make format
```
smx 0.9.5
Simple python macro expansion

[![Build Status](https://travis-ci.com/earonesty/python-smx.svg?branch=master)](https://travis-ci.com/earonesty/python-smx)
[![Coverage](https://codecov.io/gh/earonesty/python-smx/branch/master/graph/badge.svg)](https://codecov.io/gh/earonesty/python-smx)

### Simple python templates

    example:
      - key : %os.environ.get(USER)
      - roaming : %if(sys.platform=='win32',1,0)
      %indent(%include(file_name))
      - other : %eval(1 + 1)
      %indent(%python("
    import mod
    f = open('myfile.in')
    f.read()
    output(mod.process(f))
     ")

Allows simple macros to be expanded inline.  You can `from smx import Smx` to evaluate, or evaluate from the command line.   Options to import all env vars, or modules from the command line are available.  Macros can be nested... so `%expand(%include(...))` is a valid syntax.

Used for yml templates, config files, kubernates deployments, simple HTML pages, etc.

### Install
    pip install smx

### Use

```
   > smx file.in > file.out
   > smx --help
```

Or from python:

```
   from smx import Smx
   ctx = Smx()
   ctx.expand("%add(1,1)")
   ctx.expand_io(fin, fout)
   ctx.expand_file(filename, in_place=True)
```

### Including code and files

| Macro | Description |
| :---   | :- |
| indent(str) | each line of the indented string is indented at the level where the indent function was called. | 
| include(str) | include the specified file | 
| strip(str) | strip a string | 
| expand(str) | string is expanded using smx syntax | 
| python(str) | string is expanded using python syntax | 
| module(str) | string is interpreted as a module and imported | 

### Modules

| Macro | Description |
| :---   | :- |
| os.... | os functions are included by default, for example `%os.path.basename(...)` | 
| sys.... | sys functions are included by default EG: `%sys.platform%` can be used| 

### Misc

| Macro | Description |
| :---   | :- |
| for(name, range, loop) | loop code is expanded for each value in the range | 
| if(val, true-val, false-val) | if val is expanded to non-empty, true-val is executed | 
| add(a, b) | numbers are added | 
| sub(a, b) | numbers are subtracted | 

### Wsgi
 Smx includes an [wsgi module](wsgi.md).   The goal is to be able to easily serve template driven pages using smx syntax.

### Goals 

 - The syntax should be "macroy" not "pythony" ... that way you can tell, at a glance when there's macros going on... vs python going on.
 - Easy to add your own macros by deriving from Smx and adding new functions with the @smx.macro decorator.
 - Easy to import python modules and use them in basically any string context
 - JSON and YAML template friendly
 - Use "as is" in most configuration contexts
 - Unsafe by default, but trivial to use "Safe mode" allowing untrusted execution of a strict set of macro expansions

### Caveats

 - Important to remember that all macros result in "strings", not other python types.
 - When context-oriented template programming gets complex, you probably shouldn't be using templates.
grams 0.0.3
A package for managing histograms.
Requires Python: >=3.7

# grams

A Python library for managing the histograms of text corpuses.

[![Build Status](https://travis-ci.com/escofresco/makeschool_fsp2_realtweets.svg?branch=master)](https://travis-ci.com/escofresco/makeschool_fsp2_realtweets)

[![codecov](https://codecov.io/gh/escofresco/makeschool_fsp2_realtweets/branch/master/graph/badge.svg)](https://codecov.io/gh/escofresco/makeschool_fsp2_realtweets)

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install grams.

```bash
pip install grams
```

## Usage

```python
import grams

# Generate a histogram from a list of sentences
hist = grams.Histogram(['A sentence here.',
                        'A sentence there.',
                        'A sentence anywhere.'])

# Generate a histogram from a text file
with open('corpus.txt', 'r') as file:
    file_hist = grams.Histogram(file)

# Find the distance between histograms ∈ [0, 1]
similarity = hist.similarity(file_hist)

# Sample a random word weighted by its number of occurrences
word = hist.sample()

# Display word frequencies in the terminal
hist.visualize()
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Lorem      : ▇▇▇▇ 4.00
# Ipsum      : ▇▇▇▇ 4.00
# is         : ▇ 1.00
# simply     : ▇ 1.00
# dummy      : ▇▇ 2.00
# text       : ▇▇ 2.00
# of         : ▇▇▇▇ 4.00
# the        : ▇▇▇▇▇▇ 6.00
# printing   : ▇ 1.00
# and        : ▇▇▇ 3.00
# typesetting: ▇▇ 2.00
# industry   : ▇ 1.00
# has        : ▇▇ 2.00
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# Create a distribution object from code coverage data
cov = grams.Covergram("Documents/.coverage")

# We can visualize our code coverage data as well.
cov.visualize()
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# __init__.py       : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100.00
# grams.py          : ▇▇▇▇▇▇▇▇▇▇▇▇ 25.00
# hashtable.py      : ▇▇▇▇▇▇▇▇▇▇▇ 22.00
# linkedlist.py     : ▇▇▇▇▇▇▇ 15.00
# online.py         : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 40.00
# stats.py          : ▇▇▇▇▇▇▇▇▇▇ 21.00
# termgraph.py      : ▇▇▇▇▇▇ 12.00
# utils.py          : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 31.00
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# Our distribution also maintains some useful statistics
avg_code_cov = int(cov.mean)
frequency_standard_deviation = int(hist.std)
frequency_variance = int(hist.var)

```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](LICENSE)