How to Install Alfalfa Client - NatLabRockies/alfalfa GitHub Wiki
Basic Usage with Python Package
This repo is packaged and hosted on PyPI here. This package can be installed with pip using the following command:
pip install alfalfa-client
Once the package is installed, you can load it into any project and instantiate client or historian objects as follows:
import alfalfa_client.alfalfa_client as ac
import alfalfa_client.historian as ah
client = ac.AlfalfaClient
historian = ah.Historian
Setup and Testing for Development
All alfalfa-client code is available on a github repository here. This repository is setup to use:
- pyenv for managing python versions
- poetry for managing environment
- pre-commit for managing code styling
- tox for running tests in isolated build environments
Assuming poetry is installed and the necessary python versions are installed, run the following commands:
git clone https://github.com/NREL/alfalfa-client.git
cd alfalfa-client
poetry run tox
This may take some time resolving on the initial run, but subsequent runs should be faster.