semvec/pypi-packages huggingface dataset:
mattsollamatools 0.0.25
Tools for working with Ollama
Requires Python: >=3.6

# Matt's Ollama Tools

I needed some simple tools to make it easier to work with integrating Ollama with the real world. This is a collection of those tools.

## Chunker

Sometimes you need to take a bunch of text in and then spit it out in an array of chunks. This will take in a long text and then split it into chunks of up to a defined number of words. It won't ever get sentence fragments. It will overlap each chunk by one sentence. If you have a text with a bunch of poorly written run-on sentences, this might not work.

### Usage

```python
from mattsollamatools import chunker

textchunks = chunker(text, max_words_per_chunk=110, language='spanish')
```

If you don't include max_words_per_chunk, it will default to 100. If you don't include language, it will default to 'english'.
ReadROOT 2.5.12
Easy GUI made to read ROOT files created by the CoMPASS software distribued by CAEN.
Requires Python: >=3.10

**Created by :** Chloe Legue

**Current version date :** 2024/04/12

<p align=center>
<a target="_blank" href="https://www.python.org/downloads/" title="Python version"><img src="https://img.shields.io/badge/python-%3E=_3.10-green.svg"></a>
<a target="_blank" href="https://pypi.org/project/ReadROOT/" title="PyPI version"><img src="https://img.shields.io/pypi/v/ReadROOT?logo=pypi"></a>
</p>

ReadROOT is an easy GUI made to read ROOT files created by the CoMPASS software distributed by CAEN. This GUI will also allow the user to plot the different graphs from the CoMPASS software.

# How to install ReadROOT

The ReadROOT package is currently on PyPi. This means it can be installed via a `pip` install.

## Create a virtual environment with Anaconda

Using Anaconda, creating a virtual environment is an easy task:

```
conda create --name new_env python==3.11.3
```

This line above will create a `Python` environment with the 3.11.3 update of `Python`. Some extra instructions need to be followed in the Anaconda terminal before the virtual environment is finalized. This is the version that was used to create this package, so it is better to use it.

## Activating and downloading the package

Once the virtual environment is created, it can be easily activated using `conda activate new_env`. From this point on, Anaconda will consider you are using the `new_env` environment which runs `Python` 3.11.3.

To download the ReadROOT package, the following command can be sent:

```
pip install ReadROOT
```

This will install the latest version of ReadROOT posted on PyPi. After all dependencies are installed, ReadROOT will be installed in your environment. To know more about the GUI and other functionalities of ReadROOT, you can navigate in this Wiki to find more information.

## Modifying some files

> This is no longer necessary if the newer `Merger` is used. The old C++ code was made for the previous Root Reader version.

In order for the time of flight (TOF) functions to work, C++ was used (Python was too slow). C++ needs very specific header files and the complete path to those files is needed. The two files that have those headers are `wrap.cpp` and `funcs.hpp`. If an error shows up when ReadROOT is imported (something along the lines of C++ not being able to find a header file) then verify those two.
continuous-futures 0.0.2
Converts single future contracts to a continuous contract (ratio back-adjusted)
Requires Python: >=3.7

# Intro

Takes a DataFrames containing information for multiple future contracts and creates a
corresponding continuous contract (ratio back-adjusted, on highest volume).

## Installation

Use `pip install continuous_futures`

## Example

```python
from continuous_futures import create_continuous_contract
import pandas as pd

contract1 = pd.DataFrame([
    ['2023-01-01', 15.2, 13.8, 128, '2023F'],
    ['2023-01-02', 15.1, 13.9, 133, '2023F'],
    ['2023-01-03', 14.8, 14.1, 125, '2023F'],
], columns=['Date', 'Open', 'Close', 'Volume', 'Contract'])

contract2 = pd.DataFrame([
    ['2023-01-02', 15.0, 13.2, 129, '2023G'],
    ['2023-01-04', 14.0, 13.1, 130, '2023G'],
    ['2023-01-05', 14.2, 14.0, 140, '2023G'],
], columns=['Date', 'Open', 'Close', 'Volume', 'Contract'])

merged = pd.concat([contract1, contract2])

continuous = create_continuous_contract(merged, 'Date', 'Volume', 'Contract', ['Open', 'Close'], ['Open'])
```

## Parameters

- data: DataFrame
    Order must be chronological: first by contract, then by date. Oldest date of oldest
    contract first. Must contain all columns whose names are passed to this function as
    parameters.
- date_column_name: str
    Name of the column that contains the date
- volume_column_name: str
    Name of the column that contains the volume; used to determine rollovers (on highest
    volume)
- contract_column_name: str
    Name of the column that contains the contract name; used determine where contracts
    change within the DataFrame
- adjustment_factor_columns_names: list of str
    Names of the columns to calculate the ratio from; usually only ['close']; if multiple
    are passed, their mean is used.
- adjustment_column_names: list of str
    Names of the columns to adjust by the ratio on rollovers.