semvec/pypi-packages huggingface dataset:
binstore 1.7.2
Module to implement C extension Bins class for bin-based storage of items
Requires Python: >=3.6

# Description
binstore module with Bins C extension to implement storage of items based on value-based binning where binned value determines ordinal index into array where item is stored.   Supports item assignment and slice operations.

## Members
- min - float, minimum value 
- max - float, maximum value
- width - float, bin width 
- n_bins - int, number of bins = int((max - min) / width) + 1
 
## Methods
- bin(value) - perform binning operation on value and returns corresponding bin ordinal value 0 <= n <= n_bins - 1
- put(value, item) - puts item into bin n = bin(value) and returns n
- get(value) - gets item from bin n = bin(value) and returns as tuple of (item, n)
- items() - returns items in bins as dict with left bin edge as key, item in bin as value 

## When performing binning:
1. if value is <= min, bin(value) = 0
2. if value is >= max, bin(value) = n_bins - 1 
3. if value is >= half the distance between left edge of bin n and left edge of bin n+1, then corresponding bin(value) = n+1, otherwise bin(value) = n.  e.g., for min = 0.0, max = 1.0, width = 0.01, bin(0.106) = 11, bin(0.103) = 10.

## Example: 
\>>>b = Bins(min=0.0, max=1.0, width=0.01)
\>>>for i in range(50):
\>>>    b.put(i/100, {'i': i})
0
1
2
.
49
\>>>b.get(0.005)
({'i': 1}, 1)
\>>>b.get(0.000)
({'i': 0}, 0)
\>>>b.get(0.004)
({'i': 0}, 0)
\>>>b.get(0.103)
({'i': 10}, 10)
\>>>b.get(0.106)
({'i': 11}, 11)
\>>>b.put(0.106, {'foo': 'bar'})
11
\>>>b[11]
{'foo': 'bar'}
\>>>b[11] = {'bar': 'foo'}
\>>>b[11]
{'bar': 'foo'}
calculator-framework 0.0.2
A small library to let you build a custom calculator
Requires Python: >=3.6

# Calculator framework

This library let's you define formulas that you can later
evaluate in your command line. I use this library for school
work that requires doing repetitive calculations or calculations
needing a computer.

## Example

Here's how you'd define formulas to find the
volume of a cube and rectangular prism.

```python
from calculator_framework import *

# 1. Define your formulas
@register_formula([NumInput("side length")])
def volume_of_cube(s):
    return s ** 3

@register_formula([
    NumInput("length"),
    NumInput("width"),
    NumInput("height")
])
def volume_of_rectangular_prism(length, width, height):
    return length * width * height

# 2. Start the command line prompt
launch_calculator()
```

When you run this file, a prompt will let you evaluate your
formulas. Here's what it looks like!

```
0:	volume_of_cube
1:	volume_of_rectangular_prism
Pick a formula:
>>> 0
Input side length:
>>> 2
volume_of_cube:
8.0

Press enter to run again...
>>> 
```

For more examples, look at the `examples` folder on GitHub.

## Usage details

### Installation

Simply run: `pip install calculator-framework`

### Setting up your code

To use this library:

1. Define your functions for each of your formulas.
   Don't worry about reading user input, this is handled by the library!
   

2. Add the `@register_formula(...)` decorator to your function. This will
register you function will the library.

   
3. Run `launch_calculator()` to start the prompt.

### Using `@register_formula(...)`

This is where the good stuff happens!

`@register_formula(...)` is a decorator that takes in a list
of objects that describe the inputs to your formula.

These objects can be instance of the following classes:

- `NumInput`: For inputs that accepts a single floating-point number.


- `IntInput`: For inputs that accept a single integer.


- `ListInput`: For inputs that accept a list of floating-point numbers.

You can use `optional=True` to allow skipping the input (this will pass `None`
to your function).

Here's an example.
```
@register_formula([
    IntInput("first optional input", optional=True),
    NumInput("second non-optional input")
])
def some_funtion(...):
    ...
```

### Advanced details

- If `ListInput`, `IntInput` or `NumInput` don't meet your needs, you can
define a custom class that inherits from `Input` and implements `process()`.
  Look at how `NumInput` is implemented for an example.


- You can specify the number of decimals to round the result to by 
  either a) overwriting the
global variable `DEFAULT_NUMBER_OF_DECIMALS` or by b) passing`decimal_places=`
  as an argument to the `@register_function(...)` decorator. To not round
  the result, set the argument to `None`.
  

- If your function only has one input, you don't need to pass in a list.
For example, `@register_formula(NumInput("x"))` works the same as
  `@register_formula([NumInput("x")])`
string-templates 0.1.1
simple string template library
Requires Python: >=3.7,<4.0
Keywords: template

# string_templates

Library to create string templates in python and execute them.

## Single line

```python
render("Hello, $name", name="Tom")
# "Hello, Tom"
```
    

## Multiline strings

```python
render("""
Hello
$name
""", name="Tom")
# '\nHello\nTom\n'

# no newline at start and end
render("""\
Hello
$name\
""", name="Tom")
# 'Hello\nTom'
```

## template classes

```python
@template
class Test:
    name: str
    _template = """Hello, $name"""
str(Test("Tom"))
# 'Hello, Tom'
```
zyxelprometheus 0.5.5
Get statistics from a Zyxel router and expose them to Prometheus.
Requires Python: >=3.8

# zyxelprometheus

[![Build Status](https://travis-ci.com/andrewjw/zyxelprometheus.svg?branch=master)](https://travis-ci.com/andrewjw/zyxelprometheus)
[![Coverage Status](https://coveralls.io/repos/github/andrewjw/zyxelprometheus/badge.svg?branch=master)](https://coveralls.io/github/andrewjw/zyxelprometheus?branch=master)
[![PyPI version](https://badge.fury.io/py/zyxelprometheus.svg)](https://badge.fury.io/py/zyxelprometheus)

Get statistics from a Zyxel router and expose them to Prometheus.

## Running

```zyxelprometheus [-h] [--host [HOST]] [--user [USER]]
                       [--passwd [PASSWD]] [--bind [BIND]] [-d] [--raw]
                       [--traffic-only] [--xdsl-only]

optional arguments:
  -h, --help         show this help message and exit
  --host [HOST]      the host name to connect to (must start with https://)
  --user [USER]      the user name to use (can also be set with $ZYXEL_USER)
  --passwd [PASSWD]  the password to use (can also be set with $ZYXEL_PASSWD)
  --bind [BIND]      the ip address and port to bind to when running in server
                     mode (-d)
  -d, --serve        run in server mode, collecting the statistics each time
                     /metrics is requested
  --raw              prints out the raw values collected from the router and
                     exits
  --traffic-only     only requests traffic data
  --xdsl-only        only requests XDSL data
```