semvec/pypi-packages huggingface dataset:
lcs-client 2.0.0
Client for interacting with LCS, the HackRU backend
License: MIT

# python-lcs-client
A client for server side Python applications to interact with LCS, the HackRU backend.
The general idea is for this to be used with a JSON based web API.
For every request to your API, you would ask for a LCS token.

Alternatively you could have your own tokens, and have the user pass in
the password again but this will be annoying for the user if they already
logged into the HackRU frontend

## Documentation
 - [Documentation for this client](lcs_client.md)
 - [Documentation for LCS](https://github.com/hackru/lcs/wiki)

## Installation
```bash
pip install lcs_client
```

## Development setup
1. Create virtual environment locally
    ```bash
    virtualenv -p python3 env
    ```
    OR
    ```bash
    python3 -m venv env
    ```
1. Activate the virtual environment
    ```bash
    source env/bin/activate
    ```
1. Install the required dependencies (prod and dev) into the virtual environment
    ```bash
    pip install -e .[dev]
    ```

##### Installing lcs_client (after making local code changes)
Run the following in terminal:
```bash
pip install -e .
```
This will install the package as if you installed it from PyPi so that you can perform testing using the package 
rather than the local file
##### Running tests
Run the following command from terminal:
```bash
pytest
```

## Generating documentation
Pre-requisite: 
* [Perform Development setup](#Development setup)

Run the following from terminal (which will use the configuration within `pdoc-markdown.yml`):
```bash
pydoc-markdown
```
The generated documentation is within `lcs_client.md`  
Edit the README.md as required according to the changes made

## Running the example web application
```bash
pip install -r example_requirements.txt
python example_api.py
```

## Release on PyPi
Pre-requisites:
* [Perform Development setup](#Development setup)
* Ensure version changes are appropriately reflected using semantic versioning in `lcs_client/__init__.py` and 
`setup.py` (as well as any other source files)
* Ensure documentation is up to date by following the steps within [Generating documentation](#Generating documentation)
* Ensure code has been committed to the GitHub repo with a tag and commit message that include the version number
1. Install wheel to build and twine to upload package
    ```bash
    pip install -e .[build]
    ```
1. Build the source archive and wheel for package
    ```bash
    python setup.py sdist bdist_wheel
    ```
1. Examine the archive to ensure it includes the expected files
1. Check for common errors
    ```bash
    twine check dist/*
    ```
1. Upload to TestPyPi and ensure correctness
    ```bash
    twine upload --repository testpypi dist/*
    ```
    If it errors out about not having permissions to upload, simply change the name within setup.py and restart from step 2
1. Upload the new release
    ```bash
    twine upload dist/*
    ```
flowrisk 0.3.0
Order flow risk measures in Python
License: MIT

# Order Flow Risk Measures

Has been updated to support Python 3.8. Currently, the packages only has VPIN.

## Installation
The default way is to open a console and execute

    pip install flowrisk

One may also download from here and manually install

    git clone https://github.com/hanxixuana/flowrisk
    cd flowrisk
    python setup.py install


## VPIN
To implement VPIN, we made

    1.  an EWMA estimator of volatility (RecursiveEWMAVol)
    2.  a numpy.ndarray based buckets with bulk classification of volumes in the MA style (RecursiveBulkClassMABuckets)
    3.  a numpy.ndarray based buckets with bulk classification of volumes in the EWMA style 
        (RecursiveBulkClassEWMABuckets)
    4.  a recursive VPIN estimator (RecursiveVPIN)
    5.  a recursive VPIN estimator with VPIN confidence intervals (RecursiveConfVPIN)
    6.  a recursive model using an EWMA estimator of means and RecursiveEWMAVol, for modeling and log 
        innovations of VPINs and for calculating VPINs' confidence intervals (RecursiveEWMABand)
    7.  a one-shoot VPIN estimator for a series of prices (BulkVPIN)
    8.  a one-shoot VPIN estimator for a series of prices with VPIN confidence intervals (BulkConfVPIN)
    9.  various configuration classes (RecursiveVPINConfig, RecursiveConfVPINConfig, BulkVPINConfig, 
        BulkConfVPINConfig)
    
For illustration, we also put the 1-min data of five small caps (CBIO, FBNC, GNC NDLS, QES) and five large caps 
(V, AAPL, NVDA, GS, INTC) from the US stock market. The data covers Nov 12 to Nov 21, 2018. The data can used by, 
for example,

    import flowrisk as fr

    class Config(fr.BulkConfVPINConfig):    
        N_TIME_BAR_FOR_INITIALIZATION = 50
    
    config = Config()
    
    example = fr.examples.USStocks(config)
    symbols = example.list_symbols('small')
    result = example.estimate_vpin_and_conf_interval(symbols[0])
    
    example.draw_price_vpins_and_conf_intervals()

The piece of the code will automatically calculate VPINs and associated confidence intervals of GNC. We also put
prices and volumes together with them into a nice picture, which is saved to ./pics/gnc.png by default. Note that
the calculation of VPINs is fast, but making nice pictures is slow. One may also find out more in test.py.

Note that there are several differences between this implementation and the original paper:

    Easley, D., L贸pez de Prado, M. M., & O'Hara, M. (2012). Flow toxicity and liquidity in a high-frequency world. 
    The Review of Financial Studies, 25(5), 1457-1493.

For example,

    1.  we use an EWMA estimator for the volatility of PnLs, instead of using all samples for estimating the PnL 
        volatility; and
    2.  VPINs are calculated from the very beginning, instead of after a certain number of buckets have been filled.

We made the differences because the core of our package is a recursive estimator of VPIN.