semvec/pypi-packages huggingface dataset:
sixtysix 0.0.4
Framework for building trading strategies and technical indicators
Requires Python: >=3.10

# SixtySix

Framework for building trading strategies and technical indicators.

## Installation

```bash
pip install sixtysix
```

## Quick Start — Strategy

```python
from sixtysix import strategy, computed, param, Line

@strategy(name='sma_crossover', display_name='SMA Crossover')
class SMACrossover:
    fast = param.number(default=20, min=5, max=100)
    slow = param.number(default=50, min=10, max=200)

    @computed
    def fast_sma(self, df):
        return df['close'].rolling(self.fast).mean()

    @computed
    def slow_sma(self, df):
        return df['close'].rolling(self.slow).mean()

    def plot(self, df):
        return [
            Line(y=self.fast_sma(df), color='#3b82f6'),
            Line(y=self.slow_sma(df), color='#f97316'),
        ]

    def on_bar(self, df):
        if self.ta.crossover(self.fast_sma(df), self.slow_sma(df)):
            return self.buy()
```

## Quick Start — Indicator

```python
from sixtysix import indicator, param, Line

@indicator(name='sma', display_name='SMA', type='overlay')
class SMA:
    period = param.number(default=20, min=1, max=500)
    color = param.color(default='#2962ff')

    def plot(self, df):
        sma = df['close'].rolling(self.period).mean()
        return [Line(y=sma, color=self.color, line_width=2)]
```
xarray-kat 0.0.1
Add your description here
Requires Python: >=3.11

Direct xarray views over the MeerKAT archive
============================================

This package present an xarray view over observations in the MeerKAT archive.

Required Reading
----------------

You'll need some familiarity with xarray_. In particular:

- `Indexing and selecting data <xarray-indexing_>`_
- `Lazy Loading behaviour <xarray-lazy-indexing_>`_


Example Usage
-------------

At a basic level, one can use xarray's selection and lazy loading mechanisms to interact with
the data:

.. code-block:: python

  import xarray_kat
  import xarray

  token = "eyFILLMEIN"
  capture_block_id = 123456789
  url = f"https://archive-gw-1.kat.ac.za/{capture_block_id}/{capture_block_id}_sdp_l0.full.rdb?token={token}"

  # If the dataset is small you may be able to load it all in at once
  dt = xarray.open_datatree(url, chunked_array_type="xarray-kat", chunks={})
  dt.load()

  # Otherwise one can select a small partition of the data
  # that can fit in memory and interact with that
  ds = dt["123456789_sdp_l0"].ds
  ds = ds.isel(time=slice(10, 20), baseline_id=[1, 20, 30, 31, 32, 50], frequency=slice(256, 768))
  ds.load()

If dask is installed, one can request chunking along dimensions:

.. code-block:: python

  import xarray_kat
  import xarray

  token = "eyFILLMEIN"
  capture_block_id = 123456789
  url = f"https://archive-gw-1.kat.ac.za/{capture_block_id}/{capture_block_id}_sdp_l0.full.rdb?token={token}"

  # This specifies the natural chunking of the
  # underlying store
  dt = xarray.open_datatree(url, chunks={})
  dt = dt.compute()

  # More exotic chunking can be selected, but
  # as this pattern does not match the natural
  # chunking, it results in repeated requests for
  # the same data. It may be better to use a
  # dask.rechunk operation ontop of the natural
  # chunking, or use cache pools to ameliorate this
  dt = xarray.open_datatree(url, chunks={"time": 20, "baseline_id": 155, "frequency": 256})
  dt = dt.compute()

.. _xarray: https://xarray.dev/
.. _xarray-indexing: https://docs.xarray.dev/en/latest/user-guide/indexing.html
.. _xarray-lazy-indexing: https://docs.xarray.dev/en/latest/internals/internal-design.html#lazy-indexing-classes