semvec/pypi-packages huggingface dataset:
capitalbudgeting 0.1.0
Indicators for capital budgeting: npv, irr, mirr, ipp, etc
Requires Python: >=3.12

# Indicators Used Frequently in Capital Budgeting

- regular cash flows: The 1st value of cfs is negative (investment), other values of cash flows are positive
- irregular cash flows: The signs of cash flows change more than once

## Attributes

- cfs: cash flows
- irregular: bool

## Methods

- npv(): net present value
- irr(): internal rate of return
- mirr(): modified internal rate of return
- ipp(): investment payback period 

## npv

Given a series of cash flows (cfs) and discount rate (r), npv is the present value at r of all cash flows.

$$
\text{npv} = \sum_{t = 0}^n \frac{\text{cf}_t}{(1 + r) ^ t}
$$

NB: Differring from npv in finance, function npv() in MS Excel does not take account the 1st value of cfs

## irr

Given a series of cash flows (cfs), irr is the discount rate at which the present value of all cash flows equals 0

$$
\sum_{t = 0}^n \frac{\text{cf}_t}{(1 + r) ^ t} = 0
$$

## mirr

The modified internal rate of return (MIRR) is a measure of the profitability of a project or other investment.

It assumes that positive cash flows are reinvested at the firm's cost of capital and that the initial outlays are financed at the firm's financing cost.

By contrast, the traditional internal rate of return (IRR) assumes the cash flows from a project are reinvested at the IRR itself. 

NB: regular cfs or irregular cfs (signs of cash flows change more than once) are all ok

$$
\text{mirr} = (\frac{\text{future values of positive cfs}}{\text{present value of negative cfs}}) ^ {1/n} - 1
$$

## ipp

IPP is the time to pay back the investment

## Usage

```
from capitalbudgeting import CapitalBudgeting as CapBud

cb = CapBud([-100, 21, 21, 24, 23, 32, 25])
print(cb.npv(0.09))
print(cb.irr())
print(cb.mirr(0.05))
print(cb.ipp())
```

## References

- <https://www.investopedia.com/terms/m/mirr.asp>
funner 0.0.3
Collection of functions and other, including functional approach to dates (as ISO-DATE string)
Requires Python: >=3.10

# funner

Repeatedly used code snippets. Let them live their own life as collection of functions.

Includes:

- textparse - functions for string to data manipulatins
- textgen - functions for generating text from text template using data (Jinja2 helps here)
- filefun - functions for file manipulation
- packfun - functions for finding and loading resources from packages
- storable - Base class for serializable objects



## install

`pip install funner`

(or pip3 or pipx)

Needs python 3.10 (because of type hints/annotations with pipes)



## textparse

Conversion functions:

- dict_from_yaml
- list_from_yaml


## textgen

Conversion functions:

- generate_from_string
- generate_from_file


## packfun

Package/module digging functions:

- read_content_of_package_file
- copy_from_package_to_file
- prepare_function


## filefun

Context Manager:

- open_with_missing_dirs


Text-reading function:

- read_content_of_file
nanmai-tts 2025.12.30.213241
Async Python library for Nanmai TTS (DeepSeek/Kimi voices)
Requires Python: >=3.8
Keywords: async, chinese, deepseek, kimi, nanmai, text-to-speech, tts

# nanmai-tts

Async Python library for Nanmai TTS (DeepSeek/Kimi voices).

This package provides an easy-to-use interface for the Nanmai AI text-to-speech service, featuring high-quality Chinese voices. It follows the same design pattern as [edge-tts](https://github.com/rany2/edge-tts) for consistency.

## Installation

```bash
pip install nanmai-tts
```

## Usage

### Basic Usage

```python
import asyncio
import nanmai_tts

async def main():
    # Create a Communicate instance
    communicate = nanmai_tts.Communicate("你好世界", "DeepSeek")

    # Get audio data
    audio_data = await communicate.get_audio_data()

    # Or save directly to file
    await communicate.save("output.mp3")

asyncio.run(main())
```

### Streaming

```python
async def stream_audio():
    communicate = nanmai_tts.Communicate("Hello world", "Kimi")

    async for chunk in communicate.stream():
        if chunk["type"] == "audio":
            # Process audio chunk
            print(f"Received {len(chunk['data'])} bytes of audio")
```

### CLI Usage

```bash
nanmai-tts --text "你好世界" --voice DeepSeek --write-media output.mp3
```

## Available Voices

- **DeepSeek**: Male voice, optimized for Chinese text
- **Kimi**: Female voice, optimized for Chinese text

## API Reference

### Communicate Class

- `__init__(text: str, voice: str = "DeepSeek")`: Initialize with text and voice
- `stream()`: Async generator yielding audio chunks
- `save(filename: str)`: Save audio to file
- `get_audio_data() -> bytes`: Get complete audio data

## Requirements

- Python 3.8+
- aiohttp

## License

This project is for educational and research purposes. The underlying Nanmai TTS API is proprietary.

## Disclaimer

This package uses reverse-engineered authentication methods for the Nanmai TTS service. Use at your own risk and in accordance with applicable laws and terms of service.