Metadata-Version: 2.5
Name: pynarchy
Version: 0.1.0
Summary: A Python module for pseudo-random generation.
Project-URL: Source, https://codeberg.org/deykfa/pynarchy
Project-URL: Issues, https://codeberg.org/deykfa/pynarchy/issues
License-Expression: MPL-2.0
Keywords: osrand,random,urandom
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Requires-Python: >=3.6
Description-Content-Type: text/markdown

# Pynarchy

A lightweight Python module for cryptographically secure pseudo-random generation using system entropy. It uses the built-in module `secrets`. It takes entropy from OS sources.

Works on Linux, Windows, macOS and all Unix-like systems.

### Installation
```bash
pip install pynarchy
```

### osrand()

```python
osrand(mode, length=1, exclude="")
```
`mode`: string argument that makes a pool of characters that function will work with. Will not accept any sequences like lists, tuples or dictionaries.

`length`: integer argument to set length of output. Default value is 1.

`exclude`: string argument to exclude from `mode`, empty by default so you don't have to use it if `mode` already has needed characters.

```python
from pynarchy import osrand

# Generate a random output 3 digits long:
osrand("1234567", 3)
# Output: '316'

# Generate a random output with symbols 6 characters long:
osrand("[6|9m", 6)
# Output: '6mm9[9'
```


>**Note:** If all characters in `mode` are excluded, the output will be only '!'

```python
>>> osrand("1A3B", 3, "AB13")
'!!!'
```