semvec/pypi-packages huggingface dataset:
historicCurrencyTradingJakeLourie 0.0.1
A package to calculate the maximum return possible from a set of historic monthly returns from currency trading
Requires Python: >=3.6

## CURRENCY TRADING RECONCILIATION

This repository enables the user to calculate the maximum achievable profit that a trader could have made from a previous year, given a series of possible monthly returns from currency investments.

#### APPROACH

The general approach is to view this a function-maximising graph search. The un-pruned solution to this whould be to create a graph/tree with _numMonth_ layers and a branching factor of _numCurrencies_ at each layer, and selecting the leaf node with the highest return. However, at any given month, it is possible to prune the tree and only keep one node for each currency currently being held. (so, for example, after month 2, we only need to keep the node holding GBP that has the highest return of all nodes currently holding GBP)

The Search script requires an array of shape (num_months, num_currencies, num_currencies), where value[m,c,d] refers to the return achieved in month m for transffering money from currency c to d in a given month. The search script also requires the starting currency and the end currency. The script outputs the optimal strategy, the total return achieved and logging stats.

The Node class contains the currency held, one-step return and total return of that node. The node class also contains the logic for calculating the next child - this means the specific calculation of return is logic determined by the node class, not the search class. This abstraction would allow different logic to be incorporated into a different node class, and passed to the search function, withouth changing the search function. E.g. it may be that a different node calculates return by also incorporating a penalty/fee for switching currency - having this logic on the node allows the Search class to remain unchanged.

The read_in_txt script allows the user to pass a text file in the form of an array, and converts to a numpy array.


#### TO RUN:

enter directory and add package to path:

To run main:
    
    python3 main.py --> this runs the algorithm for the currency data given.
 
To run for new currency data:
    
    create a new table file matching the style of 'currency_data.txt'
    
    if necessary, create a new currency map file of in the style of 'currency_map.json'
    
    RUN python3 main.py --table_filename data/{your_table_filename} --currencies_filename data{your_map_filename} --start_currency {your_start_currency} --end_currency {your_end_currency}


unit tests: 

    to run unit tests, RUN python3 -m pytest 

    ('pytest' will not work as the main package will not be in source)


performance tests:

    to run performance test, enter run python3 tests/scaling_test.py

the performance tests are pre-ran and show the way that the number of nodes explored, and time taken, scale with the number of currencies and time-horizon (number of months). The results are in the .png files in /tests.
pipim 1.2.0
A drop-in replacement for pip

# pipim: PIP IMproved

Drop-in replacement for pip with behavior that imitates other popular languages
packages managers.

## Installing

```
pip install --user pipim
```

Then, if you wish for pipim to be invoked when you simply type `pip`, you can
use `pipim replace-pip` to create a script in `~/.local/bin/pip` that will run
pipim.

## Rationale

When you work on Python projects, you often find yourself creating virtual
environments, and having to manually activate them or install dependencies in
them.

This is not something you typically do with other languages, where the package
manager is smart enough to know if you meant to install packages at the user
level or at the project level.

This is more or less in line with the Zen of Python: explicit is better than
implicit. However I grew tired of having this behavior available everywhere
except with Python, so I decided to write a simple wrapper around pip that will
use virtual environments by default, unless `--user` is passed.

## Features

By default, pipim will be installed as `pipim`, however, you can use it as a
drop-in replacement of `pip`, and the following examples assume you did.

### Automatic use of virtual environments

The following commands will automatically create a virtual environment called `.venv/` if one does not exist already, and then the actual commands inside of it:

```
pip install package1 [package2...]
```

```
pip uninstall package1 [package2...]
```

If you wish to work outside of a virtual environment, you can use the `--user`
flag. This will try to use [pipus](https://github.com/Tina-otoge/pipus) if it is
found in your PATH, and will resort to regular `pip` otherwise.

### Install packages from requirements.txt

If you do not specify any package, this will run `pip install -r requirements.txt`
in the virtual environment. As with other install commands, this will
create the venv first if it does not exist already.

Simply run:

```bash
pip
# or
pip install
```

### Easily installs itself as a replacement

You can use `pipim replace-pip` once to create a simple script in
`~/.local/bin/pip` that will invoke pipim instead of pip. This will allow you to
forget about pipim and just run `pip` like you always did before, except that
now it comes with extra perks ✨✨.

### Run a command inside the virtual environment

```
pip run <command> [arguments...]
```

The first argument will be invoked from `.venv/bin/`, everything that follows is
passed to it. For example:

```
pip run flask --help
```

### Always fallback to regular pip

Every unmatched flags are passed down to pip, any unrecognized command will run
pip too.

## Contributing

Noticed a bug? Want to request a feature? Simply [open a new Issue](https://github.com/Tina-otoge/pip-improved/issues).