semvec/pypi-packages huggingface dataset:
design-patterns-WS 1.0.0
A small python module containing decorators for implementing design patterns
Requires Python: >=3.3

# Introduction:
This is a small python module to design a singleton class python (will add more later on).I have been using python for 2 years and fell in love with it and I would really love to give something (even as small as this module) to the community. If you like it give it a start,hate it tell me why I will try to fix it and you could help too.

## Design Patterns Supported
> Singleton

# Example

```python

from design_patterns import singleton
@singleton
class HelloWorld:
    def __init__(self):
        self.name = "one instance"


h = HelloWorld()
r = HelloWorld()

if __name__ == "__main__":
    print(r == h)

```
pprintjson 1.4.2
A json pretty printer for python
Requires Python: >=3.6

# [pprintjson](https://pprintjson.readthedocs.io/en/latest/)

[![PyPi release](https://img.shields.io/pypi/v/pprintjson.svg)](https://pypi.org/project/pprintjson/)
[![PyPi versions](https://img.shields.io/pypi/pyversions/pprintjson.svg)](https://pypi.org/project/pprintjson/)
[![Downloads](https://pepy.tech/badge/pprintjson)](https://pepy.tech/project/pprintjson)
[![Documentation Status](https://readthedocs.org/projects/pprintjson/badge/?version=latest)](https://pprintjson.readthedocs.io/en/latest/?badge=latest)

A json pretty printer for Python ��.

[Check out the pprintjson docs](https://pprintjson.readthedocs.io/en/latest/)

## Installation

Install with the standard [`json`](https://docs.python.org/3/library/json.html) JSON encoder

```bash
$ pip install pprintjson
```

Install with the premier [`simplejson`](https://simplejson.readthedocs.io/en/latest/) JSON encoder
```bash
$ pip install pprintjson[simplejson]
```

## Usage

```text

usage: pprintjson.py [-h] [-i num] [-o file] [-c cmd] [-v] [file]

A pretty-printing function for json.

positional arguments:
  file                    json <file> to pretty-print

optional arguments:
  -h, --help              show this help message and exit
  -i num, --indent num    indent <num> number of spaces at each level (default: 4)
  -o file, --output file  write output to <file> instead of stdout (default: stdout)
  -c cmd, --command cmd   json <cmd> to pretty-print
  -v, --version           show program's version number and exit

```

### Script

Pretty print JSON from a **file** using the `pprintjson` CLI.

```bash
$ pprintjson "./path/to/file.json"
```

Pretty print JSON from a **stdin** using the `pprintjson` CLI.

```bash
$ echo '{ "a": 1, "b": "string", "c": true }' | pprintjson
```

Pretty print JSON from a **string** using the `pprintjson` CLI.

```bash
$ pprintjson -c '{ "a": 1, "b": "string", "c": true }'
```

Pretty print JSON from a **string** with an *indent* of **1**.

```bash
$ pprintjson -c '{ "a": 1, "b": "string", "c": true }' -i 1
```

Pretty print JSON from a **string** and save *output* to a file **output.json**.

```bash
$ pprintjson -c '{ "a": 1, "b": "string", "c": true }' -o ./output.json
```

### Module

Pretty print JSON from a **dict** using the `pprintjson` module.

```python

# 1. import the "pprintjson" function.
from pprintjson import pprintjson as ppjson

# 2. pretty print JSON.
obj = { "a": 1, "b": "string", "c": True }

ppjson(obj)
```

![stdout](https://raw.githubusercontent.com/clarketm/pprintjson/master/pprintjson.png)

## License

MIT &copy; [**Travis Clarke**](https://blog.travismclarke.com/)