semvec/pypi-packages huggingface dataset:
onetick-latency 0.1.12
Library for latency simulation and query for Onetick
Requires Python: >=3.9

# Onetick latency simulation library

## Overview

This library has various fonctionnality such a latency simulator as well as a query script for querying nbbo data from 
OneTick software. 

## Installation and requirements

This library requires OneTick software installed.

- [ ] pip install onetick-latency module
- [ ] pip install the requirements.txt for this package


## Latency Module
The Latency module is designed to simulate network latency based on trading volumes and activity. It adjusts DataFrame timestamps to mimic realistic network delays by applying generated latency values drawn from a Gaussian normal distribution.

### Key Features:

- Flexible parameter inputs including date range (format: "yyyy-mm-dd") , symbol, batch size, and timezone.
- Configurable min/max latency values to reflect observed extremes.
- Mean and standard deviation settings for latency mirroring observed data characteristics.
- Jitter factor to simulate real-life network behavior.
- Options to plot latency distributions and trading volume over time.
- Metrics display for simulation analysis.
- Specify onetick_directory path and working_directory for otq file and saving to pickle the query
- Specify onetick credentials as parameters of the class (strongly suggest to do a file and import the user and password)

## Timestamp Crossover Module
This module detects timestamp anomalies where entries are out of chronological order—a common issue in high-frequency trading data that can lead to significant analytical errors.

### Functionality:

- Identifies and reports rows where timestamps are not sequential.
- Provides detailed reports of timestamp crossover incidents to aid in data cleansing.

## Volume Analyser Module
The Volume Analyser module evaluates trading volumes over specified intervals to identify periods of high activity. This analysis is crucial for adjusting latency in the simulation model to reflect real-world conditions.

### Capabilities:

- Calculates and analyzes trade counts over rolling time windows.
- Identifies high activity periods using percentile-based thresholds.
- Visualizes trading activity to assist in understanding market dynamics.


## NBBO Query Module
This module facilitates efficient querying of NBBO (National Best Bid and Offer) data through the OneTick platform, providing crucial market data for further analysis.

### Utilization:

- Streamlines the data retrieval process for NBBO queries.
- Supports extensive customization of query parameters to target specific data needs.
- Efficiently handles large datasets, ensuring timely processing and analysis.
predeq 0.0.3
Predicate-based equivalence testing
Requires Python: >=3.8

# predeq

PredEq is a utility for testing objects using an equivalence predicate. It facilitates writing
declarative-style tests for complex requirements, and for cases where the default `__eq__` is inapplicable or missing.

At its core, `predeq(predicate)` is an object which tests equal to `X` if `predicate(X)` returns True.

```python
from predeq import predeq, instanceof


def test_tuple_of_2_ints():
    """Test that value is a tuple of an int and a string."""

    value = (123, 'abc')

    # without predeq
    assert isinstance(value, tuple) and len(value) == 2
    assert isinstance(value[0], int)
    assert isinstance(value[1], str)

    # with predeq
    assert value == (
        predeq(lambda x: isinstance(x, int)),  # provide your own predicate
        instanceof(str),                       # or use one of the recipes
    )
```

Since PredEq is primarily designed for tests, it also tries to be helpful when they fail.
If lambda is used as a predicate, `predeq` attempts to locate its source code and show it in pytest output:

```
>   assert value == (
        predeq(lambda x: isinstance(x, int)),  # provide your own predicate
        instanceof(str),                       # or use one of the recipes
    )
E   AssertionError: assert (123.0, 'abc') == (<predeq to m...stanceof(str))
E
E     At index 0 diff: 123.0 != <predeq to meet lambda x: isinstance(x, int)>
E     Use -v to get more diff
```

Each built-in recipe also provides a readable representation, which typically looks like the corresponding code:

```
>   assert value == (
        predeq(lambda x: isinstance(x, int)),  # provide your own predicate
        instanceof(str),                       # or use one of the recipes
    )
E   AssertionError: assert (123, b'abc') == (<predeq to m...stanceof(str))
E
E     At index 1 diff: b'abc' != instanceof(str)
E     Use -v to get more diff
```
yellow-banana 0.1.1
A simple CLI tool.
Requires Python: >=3.6

# Yellow Banana

Yellow Banana is as a template for creating PyPI packages.

In order to create your own package, replace all occurrences of the word "yellow_banana" in the codebase, and rename the `yellow_banana` folder, to whatever you want your package to be called.

## Development

1. Clone the repository:

    ```bash
    git clone https://github.com/bloominstituteoftechnology/yellow_banana.git
    cd yellow_banana
    ```

2. Create and activate a virtual environment:

    ```bash
    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    ```

3. Install dependencies

    ```bash
    pip install -r requirements.txt
    ```

4. Build and install the package:

    ```bash
    python setup.py sdist bdist_wheel
    pip install dist/yellow_banana-0.1.0-py3-none-any.whl
    ```

5. Run the package:

    ```bash
    export OPENAI_API_KEY="xyz"
    yellow_banana "What is the meaning of life?"
    ```

## Publishing

1. Make an account at [Pypi](https://pypi.org/) and set up their token in your environment.

2. Install Twine:

    ```bash
    pip install twine
    ```

3. Build the app:

    ```bash
    python setup.py sdist bdist_wheel
    ```

4. Upload to PyPI:

    ```bash
    twine upload dist/*
    ```

## Usage of the package

Install the package using pip:

```bash
pip install yellow_banana
```

Set your environment variable:

```bash
export OPENAI_API_KEY ="some_value"
```

Use the tool:

```bash
yellow_banana "What is the meaning of life?"
```