semvec/pypi-packages huggingface dataset:
context-curse 0.0.3
A CLI tool for managing files and directories before feeding them into an LLM.
Requires Python: >=3.6

# Context Curse

Context Curse is a command-line tool designed to manage files and directories, specifically for preparing data before feeding it into a language model (LLM) with a limited context window. It provides a terminal-based interface for selecting and managing files and directories.

## Features

Navigation: Navigate through directories and files.
Selection: Select or deselect files and directories.
Expansion/Collapse: Expand or collapse directories to view or hide their contents.
Save Selections: Save selected files and directories to a specified output file.
Massive File Generation: Generate a comprehensive file combining the contents of selected files and directories.

## Installation

You can install Context Curse using pip:

```bash
pip install context-curse
```

## Usage

After installation, you can run the context_curse command from your terminal. The available options are:

```bash
python -m context_curse -h
```

## Options

* -e, --extensions
  Comma-separated list of file extensions to keep (e.g., py,txt).

* -i, --input
  Path to a text file containing a list of paths to keep, one per line.

* -o, --output
  Path to the output text file where selected paths will be saved.

## Example

To run Context Curse with a specific configuration, use the following command:

```bash
python -m context_curse -e "py,txt" -i "preferences.txt" -o "preferences.txt"
```

the code above takes in the 'preferences.txt' file, which contains a list of paths to keep, and saves the selected paths to the same file.
the code also creates a 'preferences_massive.txt' file that contains the combined contents of the selected files and directories.

## Commands

While running Context Curse, use the following commands in the terminal interface:

* ↑/↓ : Navigate through items.
* Enter : Select or deselect the current item.
* Space : Expand or collapse directories.
* s : Save the current selections.
* q : Quit the application.

## Colors

* Green: Kept files or directories.
* Yellow: Mixed state (partially kept).
* White: Not kept files or directories.

## Contributing

Contributions to Context Curse are welcome. Please submit issues and pull requests on the GitHub repository.

## Acknowledgements

Context Curse utilizes the curses library for terminal-based UI and argparse for command-line argument parsing.

Feel free to adjust any sections or add additional details relevant to your project!
qt_await 0.1
Use 'await' syntax with Qt signals

# qt-await

This lets you use Python's `async` & `await` syntax with PyQt or PySide
applications, to wait for Qt signals.

It *doesn't* integrate Qt with asyncio, trio, or code written for those
frameworks.

## Usage

To wait for arbitrary signals, wrap them in a `SignalQueue`.
For example, using the [`QProcess.finished`](https://doc.qt.io/qt-5/qprocess.html#finished)
signal:

```python
from PyQt5 import QtCore, QtWidgets
from qt_await import SignalQueue

class MainWindow(QtWidgets.QMainWindow):
    ...

    async def run_subprocess(self):
        proc = QtCore.QProcess()
        sq = SignalQueue(proc.finished)
        proc.start("sleep", ["2"])
        exit_code, exit_status = await sq
```

There are some helper functions to make common operations easier:

```python
# Pause for 1s (all times are ms, following Qt's convention)
await sleep(1000)

# Pause repeatedly
async for _  in sleep_loop(1000):
    ...

# Wait for something else, with a time limit (also in ms)
await with_timeout(..., 3000)

# Run a QProcess & wait for its finished signal
await run_process(proc, "sleep", ["2"])

# Get streaming bytes from a QIODevice (e.g. a process or a socket)
async for b in read_streaming_bytes(...):
    dest.write(b)

# Similar, but decoding bytes output to strings
async for s in read_streaming_text(...):
    print(s, end='')
```

All this code needs to be in `async def` functions, so there are two extra
functions to get from normal Qt code into async:

- `start_async(f())` starts an async function immediately.
- `connect_async(signal, f)` connects an async function to a PyQt signal, to
  start whenever the signal is emitted.

## Limitations

This is an experiment, which I mostly wrote for fun - use it at your own risk.

This doesn't integrate with asyncio (see [`qasync`](https://pypi.org/project/qasync/)
for that) or trio (see [`qtrio`](https://pypi.org/project/qtrio/#description)),
or any other Python async libraries. It assumes you're doing things the Qt way -
`QProcess` for subprocesses, `QThread` for threads, `QNetworkRequest` for HTTP,
and so on. It aims to fit in with these APIs as much as possible.

It's also not really an async framework itself. If you want to write
significant amounts of async code in Python, trio or asyncio will provide more
robust machinery & better abstractions. `qt_await` just lets you sprinkle a bit
of `await` in your Python Qt code.

Another thing you might want is the [`qt-async-threads`](https://pypi.org/project/qt-async-threads/)
package, which lets you wrap arbitrary slow Python functions in a thread and
`await` their completion, to avoid blocking the event loop.
etlportfolio 2.0.4
Expected tail loss portfolio optimisation in python
Requires Python: >=3.10

# etlportfolio
Expected tail loss portfolio optimisation in Python

## Description
This package contains portfolio optimisation class structures to perform alternative portfolio optimisation exercises. Included in the package are a mean-variance portfolio object, two common downside risk-oriented portfolio objects (CVaR and the lower partial moment), as well as an 'expected tail loss' (ETL) portfolio object based on the model of Geman et. al. (2015). Through these objects a user can implement downside risk optimised portfolios in a tractable fashion.

## Installation

```bash
$ pip install etlportfolio
```

## Usage

```python

# import modules
from etlportfolio import data, portfolio

# historical asset return data
tickers = [...]
returns = data.get_prices(tickers, '1W')

# simple historical estimates of returns and VCV, though this
# can be generated from any forecasting process.
forecast_rets = np.mean(returns)
forecast_covs = np.cov(returns, rowvar=False)

# make an instance of class ETLPortfolio
etl = portfolio.ETLPortfolio()

# set risk aversion loss threshold
etl.k = -0.02

# feed in forecast data
etl.load_forecasts(tickers, forecast_rets, forecast_covs)

# get optimal weights
etl.optimise()
etl.weights
```

## Contributing
Pull requests are welcome.

## License
[MIT](https://choosealicense.com/licenses/mit/)
noir-game-engine 0.1.1
A simple text adventure game engine for beginners.
Requires Python: >=3.6

# Noir Game Engine

**Noir** is a Python game engine designed for beginners to easily create text-based adventure games. It simplifies game development by removing the need for extensive conditional logic, making it quick and straightforward to create interactive stories.

## Installation

To install **Noir**, simply use pip:

```bash
pip install noir-game-engine
```

## Getting Started

Here's how to create a simple game using **Noir**.

1. **Import** the `NoirEngine` and `Node` classes.
2. **Define** your story nodes with prompts and options.
3. **Add** each node to the engine.
4. **Set** the starting node.
5. **Run** the game!

### Example

```python
from noir import NoirEngine, Node

# Define nodes with prompts and options
node1 = Node("You are in a dark room. What do you do?", [
    {'text': "Turn on the light", 'outcome': 'node2'},
    {'text': "Walk forward", 'outcome': 'node3'}
])

node2 = Node("The light reveals a monster! What do you do?", [
    {'text': "Fight", 'outcome': None},
    {'text': "Run away", 'outcome': 'node1'}
])

node3 = Node("You stumble in the darkness. What do you do?", [
    {'text': "Stay still and listen", 'outcome': 'node1'},
    {'text': "Run", 'outcome': None}
])

# Initialize the engine, add nodes, and set the start
engine = NoirEngine()
engine.add_node('node1', node1)
engine.add_node('node2', node2)
engine.add_node('node3', node3)
engine.set_start('node1')

# Start the game
engine.run()
```

## License

This project is licensed under the MIT License.