Metadata-Version: 2.1
Name: strideutils
Version: 0.8.5
Summary: Utility functions for monitoring the Stride blockchain
Author-email: Stride Labs <hello@stridelabs.co>
License: MIT License
        
        Copyright (c) [year] [fullname]
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: google-api-python-client>=2.149.0
Requires-Dist: google-auth-httplib2>=0.2.0
Requires-Dist: google-auth-oauthlib>=1.2.1
Requires-Dist: google-cloud-bigquery>=3.26.0
Requires-Dist: gspread>=6.1.3
Requires-Dist: pytz>=2023.3
Requires-Dist: redis>=4.5.4
Requires-Dist: bech32>=1.2.0
Requires-Dist: slack-sdk>=3.23.0
Requires-Dist: pandas>=2.1.1
Requires-Dist: twilio>=8.10.0
Requires-Dist: tabulate>=0.9.0
Requires-Dist: python-dotenv==1.0.1
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: requests>=2.32.3
Requires-Dist: pycryptodome>=3.20.0
Provides-Extra: dev
Requires-Dist: pytest>=8.1.1; extra == "dev"
Requires-Dist: mypy>=1.10.0; extra == "dev"
Requires-Dist: flake8>=7.0.0; extra == "dev"
Requires-Dist: black>=24.4.1; extra == "dev"
Requires-Dist: types-pyyaml>=6.0.12.20240917; extra == "dev"
Requires-Dist: twilio-stubs>=0.2.0; extra == "dev"
Requires-Dist: pandas-stubs>=2.2.1.240316; extra == "dev"
Requires-Dist: types-tabulate>=0.9.0.20240106; extra == "dev"
Requires-Dist: types-requests>=2.31.0.20240406; extra == "dev"
Requires-Dist: isort>=5.13.2; extra == "dev"
Provides-Extra: build
Requires-Dist: build>=1.2.2.post1; extra == "build"
Requires-Dist: bump2version>=1.0.1; extra == "build"
Requires-Dist: setuptools>=75.1.0; extra == "build"
Requires-Dist: toml-cli>=0.7.0; extra == "build"
Requires-Dist: twine>=5.1.1; extra == "build"
Requires-Dist: wheel>=0.44.0; extra == "build"

## Description

Strideutils contains common patterns for cosmos api requests, monitoring, and other integrations for gsheets, slack, and twilio.

## Setup

In a virtual environment of your choice install strideutils.

```
pip install strideutils
```

with poetry

```
poetry add strideutils
```

This package is frequently updated, so keep that in mind while developing.

## Configuration

Strideutils requires three different environment variables that can be added to `~/.zshrc` or `~/.bashrc`

```
export STRIDEUTILS_CONFIG_PATH=
export STRIDEUTILS_ENV_PATH=
```

Examples of these files are included under strideutils/config_examples.
Stride Labs employees can find config.yaml in launchpad and .env.local in lastpass. We recommend you place .env.local in your launchpad repo.

Any configuration or secrets that aren't consumed don't need to be set. However if one is accessed but unset, an error will be thrown for easier debugging.

Once strideutils is installed and configured, each module you need should be imported individually. This isolates the different secrets that are expected and consumed.

Some common imports:

```python
from strideutils.stride_config import config
config.get_chain(name='osmosis')

from strideutils import stride_requests
stride_requests.request('https://google.com')

from strideutils.stride_alerts import raise_alert
```

## Slack Connector

TODO

## Sheets Connector

TODO

## Redis Connector

TODO

## Developing Strideutils

To access the strideutils repo locally rather than using the pip version (for actively making changes to strideutils and a dependency), add the path to strideutils to the beginning of PYTHONPATH

```python
import sys
sys.path = ['/path/to/strideutils/'] + sys.path
```

Alternatively, you can install strideutils through local mode. However, please be warned that this will make your local Python environment _always_ use your local strideutils. This might lead to unexpected behavior if you local changes.

To install in local mode, run the following:

```python
pip3 install -e /Users/username/Documents/strideutils
```

Confirm the location of where it's being imported from by printing the module.
After making changes to strideutils, reload it before testing your application.

```python
from importlib import reload
reload(strideutils)
```
