Metadata-Version: 2.1
Name: blackneedles
Version: 0.1.12
Summary: 
Author: Thiago F. Pappacena
Author-email: pappacena@gmail.com
Requires-Python: >=3.8,<3.12
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: ipython (>=8.0.0,<9.0.0)
Requires-Dist: pydantic (>=2.6.4,<3.0.0)
Requires-Dist: rich (>=13.7.1,<14.0.0)
Requires-Dist: snowflake-connector-python (>=3.7.1,<4.0.0)
Requires-Dist: snowflake-snowpark-python (>=1.14.0,<2.0.0)
Requires-Dist: sqlparse (>=0.4.4,<0.5.0)
Requires-Dist: typer (>=0.11.0,<0.12.0)
Description-Content-Type: text/markdown

# Blackneedles

Blackneedles a simple and easy to use python library and command line tool to manage and bring observability to Snowflake Snowpark Container Services and Snowflake Native Apps.

The name comes from the Black Needles Peak (Pico das Agulhas Negras), the highest mountain in the state of Rio de Janeiro, Brazil, and only place in the state where one can see snowflakes.

## Installation

```bash
pip install blackneedles
```

## Usage

To use either the library or the command line tool, you need to have a Snowflake configurations at `~/.snowsql/config` or set the environment variables `SNOWFLAKE_ACCOUNT`, `SNOWFLAKE_USER`, `SNOWFLAKE_PASSWORD`, `SNOWFLAKE_ROLE`, `SNOWFLAKE_WAREHOUSE`, `SNOWFLAKE_DATABASE`, `SNOWFLAKE_SCHEMA`.

If you want to connect to Snowflake Container Services, you must set `SNOWFLAKE_DATABASE` to your database name.When using it on Native App, you must set `SNOWFLAKE_DATABASE` to the native app name.

In either way, you must install the support procedures and functions in your database or native app. You can do that by running the following command:

```bash
SNOWFLAKE_DATABASE=your_database_or_native_app blackneedles install
```

This will install the necessary procedures and functions in a `__blacknedlles__` schema. To remove everything, you just need to drop this schema from the database.

If you are installing this in a Native App, you must also grant the necessary privileges to the role that will be using the library. You can do that by running the following command:

```bash
SNOWFLAKE_DATABASE=your_database_or_native_app blackneedles install --grant <your_application_role>
```
