semvec/pypi-packages huggingface dataset:
range-ops 0.0.1
simplify combining and comparing contiguous ranges of int/floats
Requires Python: >=3.8

# ABOUT

This package implements `intrange` and `floatrange` classes and a `rangelist`
class to manage them.

`intrange` objects are similar to standard range objects.
They have the option to be *closed* or not.
in addition several methods are overloaded to allow arithmetic operations

`a=intrange(1,20)`
`b=intrange(4,8)`

`a-b` evaluates to `[intrange(1,3,closed=True,group=(1,)),
                     intrange(9,20,closed=True,group=(1,))]`
`b-a` evaluates to `[]`
`b*a = a*b` the intersection of `a` and `b`

`a-1 =  intrange(0,19,closed=True,group=(1,))`

the `group` property allow otherwise overlapping ranges to be treated as distinct.

The `attributes` property allows other metadata to accompany the range object.
It is however, up to the user to decide how to interpret those attributes after
adding the ranges.

## Example usage


The following are some sample operations


`a: intrange(1,20,closed=True)`
`b: intrange(4,8,closed=True)`
`c: intrange(2,8,closed=True)`
`d: intrange(2,8,closed=False)`
`e: intrange(7,40,closed=True)`
`a-b: [intrange(1,3,closed=True,group=(1,)), intrange(9,20,closed=True,group=(1,))]`
`1 in a: True`
`8 in b: True`
`12 in b: False`
`a + b: [intrange(1,20,closed=True,group=(1,))]`
`b + a: [intrange(1,20,closed=True,group=(1,))]`
`a - b: [intrange(1,3,closed=True,group=(1,)), intrange(9,20,closed=True,group=(1,))]`
`b - a: []`
`a * b: intrange(4,8,closed=True)`
`b * a: intrange(4,8,closed=True)`
`a // b : [intrange(1,3,closed=True,group=(1,)), intrange(9,20,closed=True,group=(1,))]`
`b // a: []`
`b // 6: [intrange(4,5,closed=True,group=(1,)), intrange(7,8,closed=True,group=(1,))]`
`b - c: []`
`b-d: [intrange(8,8,closed=True,group=(1,))]`
`rangelist((a,e)) : [intrange(1,20,closed=True,group=(1,)), intrange(7,40,closed=True,group=(1,))]`
backtest-ape 0.1.0a16
Backtesting and forward-testing (via Monte Carlo sims) for DeFi strategies.
Requires Python: <4,>=3.8

# backtest-ape

Backtesting and forward-testing (via Monte Carlo sims) for DeFi strategies.

## Installation

```sh
hatch build
hatch shell
(backtest-ape) $ ape plugins install .
```

## Build

```sh
(backtest-ape) $ ape compile --size
```

## Test

```sh
(backtest-ape) $ ape test -s
```

## Usage

```sh
(backtest-ape) $ ape run backtester
INFO: Starting 'anvil' process.
You are connected to provider network ethereum:mainnet-fork:foundry.
Runner type (BaseRunner, BaseCurveV2Runner, BaseUniswapV3Runner, CurveV2LPRunner, UniswapV3LPRunner): CurveV2LPRunner
Runner kwarg (ref_addrs): {"pool": "0xD51a44d3FaE010294C616388b506AcdA1bfAAE46"}
Runner kwarg (num_coins): 3
Runner kwarg (amounts): [1000000000000, 5946382600, 820567784927637667840]
Deploying mock ERC20 tokens ...
Start block number: 16219691
Stop block number [-1]:
Step size [1]:
Initializing state of mocks from block number 16219691 ...
Iterating from block number 16219692 to 16270201 with step size 1 ...
Processing block 16219692 ...
State of refs at block 16219692: {'balances': [49753542730360, 299470579545, 42256392553951116624718], 'D': 149811847101739918524603074, 'A_gamma': [183752478137306770270222288013175834186240000, 581076037942835227425498917514114728328226821, 1633548703, 0], 'prices': [16693207875853529503168, 1185215639716509143580], 'total_supply': 179765246450053705933358}
Backtester value at block 16219692: 2981325191662
```

## Results

[Curve Tricrypto2 LP position](scripts/results/CurveV2LPRunner_16048833_-1_300.csv)
from block 16048833 to 16273534:

![](notebook/assets/curve/v2/lp.png)

[Gearbox V2 stETH strategy (5x leverage)](scripts/results/GearboxV2STETHRunner_backtest_14805946_15078047_300.csv)
from block 14805946 to 15078047:

![](notebook/assets/gearbox/v2/steth.png)
stata2python 0.0.16
Takes in Stata commands and outputs their Python equivalent
Requires Python: >=2.7

# Stata2Python

This package takes in Stata commands and outputs their Python equivalents. It currently supports the following commands: -
- ttest (doing a t-test)
- gen (generating new columns)
- describe (describing the data)
- corr (correlation matrix)
- scatter (make a scatter plot)
- hist (make a histogram)
- reg (run a regression)

Example usage via terminal
```
pip install --upgrade stata2python
python3
>>> from stata2python import stata2python
>>> stata2python("reg wage exp i.female, vce(cluster education)", "la")
```

The function `stata2python` takes in a Stata command as a string, followed by (optionally) the name of a Python DataFrame as a string, and outputs the relevant Python equivalent to the Stata command.