semvec/pypi-packages huggingface dataset:
Any-Dice-Simulator 0.0.1
Python library to roll dice!
License: MIT
Requires Python: >=3

# Any Dice simulator

      ____                ____             ____
     /\' .\    _____     /\' .\   _____   /\' .\   _____
    /: \___\  / .  /\   /: \___\ / .  /\ /: \___\ / .  /\
    \' / . / /____/..\  \' / . //____/..\\' / . //____/..\ 
     \/___/  \'  '\  /   \/___/ \'  '\  / \/___/ \'  '\  /
              \'__'\/            \'__'\/          \'__'\/

A Python package to roll any dice combo!

### Installation
```
pip3 install Any-Dice-Simulator
```
### Usage
Import the core function using:
```python
from anyDiceSimulator import myfunctions
```

Roll a dice combo:
Example: If you need to roll a 6 sided die 5 times, input 5d6
```python
myfunctions.rolldice('5d6')
```
### Todo [Not exhaustive]
- Add functionality to roll biased die
- Functionality to roll multiple types of die at once
- Try an object oriented approach with the code
- Add external random number generators
- Add dice rolling graphic
flake8-too-many 0.1.5
A flake8 plugin that prevents you from writing "too many" bad codes.
License: MIT
Requires Python: >=3.7.0,<4.0.0
Keywords: code quality,flake8,linting,plugin

# flake8-too-many

[![python: 3.7+](https://img.shields.io/badge/python->=3.7-blue.svg)](https://www.python.org/downloads/)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/queensferryme/flake8-too-many/master.svg)](https://results.pre-commit.ci/latest/github/queensferryme/flake8-too-many/master)
[![github ci status](https://img.shields.io/github/workflow/status/queensferryme/flake8-too-many/Test?label=test&logo=github&message=passed)](https://github.com/RSSerpent/RSSerpent/actions/workflows/test.yaml)
[![codecov](https://codecov.io/gh/queensferryme/flake8-too-many/branch/master/graph/badge.svg?token=56VCCB1JUB)](https://codecov.io/gh/queensferryme/flake8-too-many)

A flake8 plugin that prevents you from writing "too many" bad codes.

## Installation

with `pip`

```shell
pip install flake8-too-many
```

with [`poetry`](https://python-poetry.org/)

```shell
poetry add -D flake8-too-many
```

with [`pre-commit`](https://pre-commit.com/) ([doc](https://flake8.pycqa.org/en/latest/user/using-hooks.html))

```yaml
repos:
  - repo: https://github.com/PyCQA/flake8
    rev: '' # pick a git hash/tag
    hooks:
      - id: flake8
        additional_dependencies:
          # ...
          - flake8-too-many
```

## Error Codes

| code   | description                              | example                                                      |
| ------ | ---------------------------------------- | ------------------------------------------------------------ |
| TMN001 | function has too many arguments.         | [link](https://github.com/queensferryme/flake8-too-many/blob/master/tests/files/function_arguments.py) |
| TMN002 | function returns too many values.        | [link](https://github.com/queensferryme/flake8-too-many/blob/master/tests/files/function_return_values.py) |
| TMN003 | function has too many return statements. | [link](https://github.com/queensferryme/flake8-too-many/blob/master/tests/files/function_return_stmts.py) |
| TMN004 | unpacking has too many targets.          | [link](https://github.com/queensferryme/flake8-too-many/blob/master/tests/files/unpacking_targets.py) |


## Options

These options could be either passed in as command line flags, or specified in a `.flake8` configuration file.

* `--max-function-arguments`, int, default to 6;
  * `--ignore-defaulted-arguments`, bool, default to false;
* `--max-function-return-values`, int, default to 3;
* `--max-function-return-stmts`, int, default to 3;
* `--max-unpacking-targets`, int, default to 3.

Run `flake8 -h` for detailed description of each option.
flask-staticdirs 1.0.1
Creates a Flask blueprint to serve files and directories (with support for index files) from at static folder.
License: MIT

flask-staticdirs
----------------

The built-in Flask functionality for serving static files from a directory does not serve index
files. _flask-staticdirs_ implements a Flask blueprint that does.

#### Features:

- Redirects paths matching exsting directories so they end with '/'
- Serves the first index file found in the path under a static folder
- Serves paths matching exsiting files in a static folder
- Allows conflicting routes to be superseded with an existing file or directory.

## Usage

Instead of using Flask's **static\_folder**, and **static\_url\_path** parameters, like this:

    from flask import Flask

    app = Flask(__name__, static_folder="public", static_url_path="/")
    if __name__ == '__main__':
        app.run(host="localhost", port=3000, debug=True)

Use the blueprint returned from **flask\_staticdirs.staticdirs()**:

    from flask import Flask
    from flask_staticdirs import staticdirs

    app = Flask(__name__)
    app.register_blueprint(staticdirs("public"), url_prefix="/")
    if __name__ == '__main__':
        app.run(host="localhost", port=3000, debug=True)

***Note***: `url_prefix="/"` is unnecessary since `"/"` is the default value, but the example matches `static_url_path` for clarity.

## Superseding conflicting routes

Flask matches routes to incoming paths based on an algorithm that sorts routes. Because _flask\_staticdirs_ route is '/<path:path', just about any route will take precedence.

This is not normally a problem unless you want to mix programatic responses with the
paths that serve static files.

For example, if you would like to serve static files before files found in a database

    app.register_blueprint(staticdirs("public", files=[ "docs/*" ]))
    @app.route("/docs/<doc>")
    def mysubdir_route(doc):
        return doc_from_db(doc) or f'<p>Could not find {doc}.</p>'
        
I realize this is not _really_ a common use case 😊, but it does illustrate the feature.

## Serving other index files

If you want to serve indexes for directories with files other than 'index.html' you can list them in the **index** parameter:

    app.register_blueprint(staticdirs("public", index=[ "index.html", "index.htm" ]))


## API

### staticdirs(static_folder='static', index='index.html', files=[])

Creates a Flask blueprint to serve files and directories (with support for index files) from at static folder.

- **param static_folder**: The folder to serve files from. Defaults to 'static'.
- **param index**: File or list of files (first found) to serve for a directory. Defaults to 'index.html'.
- **param files**: An array of filename globs. Files and directories that match will be routed specifically to avoid conflict with other routes.
- **returns**: A flask blueprint. Use with ``app.register_blueprint()``