semvec/pypi-packages huggingface dataset:
pmenv 1.0.1
A portfolio rebalancing task environment for reinforcement learning
License: MIT
Requires Python: >=3.6

# pmenv

Introduction to the **pmenv** Package

The pmenv is a reinforcement learning environment for the Portfolio Rebalancing Task. It loads multiple stock market data using tickers and synchronizes them into a 3D tensor format suitable for learning. It is an efficient environment for implementing and testing various reinforcement learning algorithms.


# Overview

The pmenv is composed of two modules, DataManager and Environment:

- The Environment module plays a role in simulating the stock market environment and handling the transitions caused by price changes and transactions. The observation is a vector of Open, High, Low, Close price and Volume and the action space is $[-1,1]^N$ where $N$ is a number of risky assets in the portfolio. Portfolio is a vector of weights of all assets and the first entry always represents cash weight.  

- The DataManager module is responsible for loading multiple stock market data using tickers and synchronizing them into a unified format suitable for learning. 

The mathematical details of the environment are implemented based on the following paper. Please refer to the paper for further information. [*An intelligent financial portfolio trading strategy using deep Q-learning, ESWA, 2020*](https://www.sciencedirect.com/science/article/pii/S0957417420303973)

# Install

    pip install pmenv

# Basic Usage
```python
import pmenv

datamanager = pmenv.DataManager()

# Tickers and Period
tickers = ["AAPL", "INCY", "REGN"]

train_start = "2019-01-02"
train_end = "2021-06-30"

# Load stock OHLCV dataframe with a ticker
data = datamanager.get_data(tickers[0], train_start, train_end)
# Load stock data tensor with ticker list
data_tensor = datamanager.get_data_tensor(tickers, train_start, train_end)


environment = pmenv.Environment(data_tensor)

# Set transaction cost
config = {"CHARGE": 0.0025, "TEX": 0.001}
environment.config = config

# Initialize the environment with balance
balance = 5000
observation = environment.reset(balance)

# Step
action = np.random.random(size=(len(tickers))
next_observation, reward, done = env.step(action)
```

# Tutorial with RL 

 1. Portfolio Rebalancing with Deep Q-Learning
 2. Portfolio Rebalancing with DDPG
 3. Portfolio Rebalancing with Dirichlet Distribution Trader
incharge 1.0.3
A package to talk to the VattenFall InCharge API's
License: MIT

[![codecov](https://codecov.io/gh/tgriek/incharge/branch/main/graph/badge.svg?token=SZPKLIUKS2)](https://codecov.io/gh/tgriek/incharge)
# Vattenfall InCharge
Python implementation of the Vattenfall InCharge API

## Usage

```python
from incharge.api import InCharge

api = InCharge(<username>, <password>)

#Get a list of stations
stations = api.get_stations().json()
print(stations)

#Get total consumption data for one station 
data = api.get_station_consumption(<station_name>).json()
print(data[0]['total'])
```
## Description
This package currently supports

`api.get_stations()` Get list of stations.

`api.get_station_consumption(station_name, since_date)` Get consumption of a single station based on its name.
maintenance.py 0.2.0
Utilities for Maintenance
License: MIT
Requires Python: >=3.10
Keywords: deprecate,todo

# maintenance.py: Utilities for Maintenance

## Usage

```python
todo(fn: Optional[Callable[P, R]] = None) -> Callable[P, NoReturn] | NoReturn
```

```python
deprecated(
    message: Optional[str] = None,
    *,
    since: Optional[str] = None,
    new: Any = None,
    add_sphinx_directive: bool = False
) -> Callable[[Callable[P, R]], Callable[P, R]]
```

### Parameters

message
> Overrides the default warn message.

since
> The version since when the object is deprecated.

new
> The new object that replaces the deprecated one. This may be
> the object itself or its name as a string.

add_sphinx_directive
> Adds the
> [deprecated directive](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directiveshtml#directive-deprecated)
> to the beginning of the docstring of the object.

### Examples
```python
def new():
    return 1

@deprecated(since="1.2.3.post4", new=new)
def old():
    return None
```

```python
unstable(
    message: Optional[str] = None,
    *,
    until: Optional[str] = None
) -> Callable[[Callable[P, R]], Callable[P, R]]
```


## Links

* [Source Code](https://github.com/phoenixr-codes/maintenance.py)
* [PyPI](https://pypi.org/project/maintenance.py)