diff --git a/README.md b/README.md index 79afa485a..6a2ddd187 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,17 @@ [![pypi](https://img.shields.io/pypi/v/sift-stack-py)](https://pypi.org/project/sift-stack-py/) [![Crates.io](https://img.shields.io/crates/v/sift_rs.svg)](https://crates.io/crates/sift_rs) [![Crates.io](https://img.shields.io/crates/v/sift_stream.svg)](https://crates.io/crates/sift_stream) -[![PkgGoDev](https://pkg.go.dev/badge/mod/github.com/sif-stack/sift/go)](https://pkg.go.dev/github.com/sift-stack/sift/go) +[![PkgGoDev](https://pkg.go.dev/badge/mod/github.com/sift-stack/sift/go)](https://pkg.go.dev/github.com/sift-stack/sift/go) This repository contains client libraries and protocol buffers to interact with Sift's API in various languages. Each client library contains pre-compiled protocol buffers, but should you wish to compile the protocol buffers yourself there are instructions on how to go about it in the [Manual Protobuf Compilation](#manual-protobuf-compilation) section. +**Language-specific documentation:** +- [Python](/python/) +- [Rust](/rust/) +- [Go](/go/) +- [C++](/cpp/) + ## Table of Contents * [Installation](#installation) @@ -20,7 +26,6 @@ to compile the protocol buffers yourself there are instructions on how to go abo - [Rust](#rust) - [Python](#python) - [Manual Protobuf Compilation](#manual-protobuf-compilation) -* [Examples](#examples) ## Installation @@ -57,4 +62,4 @@ For manual installation instructions for a particular supported programming lang - [Python](/docs/python.md) - [C++](/cpp/README.md) -Please keep in mind that the manual installation instructions aims to be general and do not need to be strictly followed. Users are encouraged to modify any of the steps or proceed with a custom setup if it better suits the needs of their project. +Please keep in mind that the manual installation instructions aim to be general and do not need to be strictly followed. Users are encouraged to modify any of the steps or proceed with a custom setup if it better suits the needs of their project. diff --git a/SECURITY.md b/SECURITY.md index 9a2de8727..a86703c6c 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,4 +6,4 @@ If you come across security vulnerability please do the following: 1. Notify the Sift team immediately through the shared Slack channels. 2. File a bug report at [this link](https://customer.support.siftstack.com/servicedesk/customer/portal/2/group/2/create/9). -Please take care not to make publicize this report as it may put other users at risk. +Please take care not to publicize this report as it may put other users at risk. diff --git a/docs/go.md b/docs/go.md index 5e811b768..101bd3e7a 100644 --- a/docs/go.md +++ b/docs/go.md @@ -19,7 +19,7 @@ $ cd sift $ buf export protos --output=$PROJECT_DIR/protos --config protos/buf.yaml ``` -The Sift protos can and its imports can now be found in your `$PROJECT_DIR/protos` directory. +The Sift protos and its imports can now be found in your `$PROJECT_DIR/protos` directory. 3. Copy the `buf` template for Go to your project directory: @@ -91,4 +91,4 @@ Your project up to this point should look like the following (full depth not sho $ go get -d ./... ``` -8. Now your project should be ready to use the generated Go code to interact with Sift's gRPC API. Please refer to the [example code](/examples/go) for usage. +8. Now your project should be ready to use the generated Go code to interact with Sift's gRPC API. Please refer to the [example code](/go/examples) for usage. diff --git a/docs/python.md b/docs/python.md index 9133f2572..39fd3868b 100644 --- a/docs/python.md +++ b/docs/python.md @@ -30,7 +30,7 @@ $ cd sift $ buf export protos --output=$PACKAGE_DIR/protos --config protos/buf.yaml ``` -The Sift protos can and its imports can now be found in your `$PACKAGE_DIR/protos` directory. +The Sift protos and its imports can now be found in your `$PACKAGE_DIR/protos` directory. 3. Copy the `buf` template for Python to `$PACKAGE_DIR` @@ -147,4 +147,4 @@ the generated wheel file should be outputted into `$PACKAGE_DIR/dist/sift_protos $ pip install $PACKAGE_DIR/sift_protos-0.1-py3-none-any.whl ``` -14. Now your project should be ready to use the generated Python code to interact with Sift's gRPC API. Please refer to the [example code](/examples/python) for usage. +14. Now your project should be ready to use the generated Python code to interact with Sift's gRPC API. Please refer to the [example code](/python/examples) for usage. diff --git a/docs/rust.md b/docs/rust.md index 7737001a1..fedcfa357 100644 --- a/docs/rust.md +++ b/docs/rust.md @@ -19,20 +19,20 @@ $ cd sift $ buf export protos --output=$PROJECT_DIR/protos --config protos/buf.yaml ``` -The Sift protos can and its imports can now be found in your `$PROJECT_DIR/protos` directory. +The Sift protos and its imports can now be found in your `$PROJECT_DIR/protos` directory. 3. Copy the `buf` template for Rust to your project directory: ```bash -$ cp buf_templates/buf.gen.go.yaml $PROJECT_DIR/buf.gen.yaml +$ cp buf_templates/buf.gen.rust.yaml $PROJECT_DIR/buf.gen.yaml ``` 4. `cd` into your Rust project at `$PROJECT_DIR`. -5. Once inside of your Rust project, declare a module called `gen` in your `main.rs` (unless you're crate is a lib-crate) and create a `src/gen/mod.rs` file. +5. Once inside of your Rust project, declare a module called `gen` in your `main.rs` (unless your crate is a lib-crate) and create a `src/gen/mod.rs` file. ```rust -// main.go +// main.rs /// Sift generated code mod gen; @@ -103,4 +103,4 @@ tonic = { version = "0.11.0", features = ["tls", "tls-roots", "tls-webpki-roots" pub mod annotations; ``` -9. Now your project should be ready to use the generated Rust code to interact with Sift's gRPC API. Please refer to the [example code](/examples/rust/) for usage. +9. Now your project should be ready to use the generated Rust code to interact with Sift's gRPC API. Please refer to the [example code](/rust/crates/sift_rs/examples) for usage. diff --git a/go/README.md b/go/README.md index 497b9c6da..af58f5a5e 100644 --- a/go/README.md +++ b/go/README.md @@ -1,6 +1,6 @@ # Sift Go -[![PkgGoDev](https://pkg.go.dev/badge/mod/github.com/sif-stack/sift/go)](https://pkg.go.dev/github.com/sift-stack/sift/go) +[![PkgGoDev](https://pkg.go.dev/badge/mod/github.com/sift-stack/sift/go)](https://pkg.go.dev/github.com/sift-stack/sift/go) This library offers a Go API on top of Sift's protocol buffers to ergonomically interface with the Sift gRPC API. diff --git a/python/docs/examples/index.md b/python/docs/examples/index.md new file mode 100644 index 000000000..8106def9d --- /dev/null +++ b/python/docs/examples/index.md @@ -0,0 +1,31 @@ +# Examples Directory + +This section contains interactive Jupyter notebook examples demonstrating how to use the Sift Python client library. + +## Available Examples + +- **[Basic Usage](basic.ipynb)** - Introduction to the Sift Python client, covering basic operations and API usage +- **[Data Ingestion](ingestion.ipynb)** - Learn how to ingest telemetry data into Sift using various methods + +## Running Examples Locally + +To run these examples on your local machine: + +1. Install the Sift Python client: + ```bash + pip install sift-stack-py + ``` + +2. Set up your environment variables in a `.env` file next to the notebook files: + ```bash + SIFT_API_KEY="your-api-key" + SIFT_GRPC_URI="your-sift-grpc-url" + SIFT_REST_URI="your-sift-rest-url" + ``` + +3. Open the notebooks in Jupyter after downloading them: + ```bash + jupyter notebook + ``` + +For more examples including command-line scripts, see the [examples directory](https://github.com/sift-stack/sift/tree/main/python/examples) in the repository. diff --git a/python/lib/sift_client/__init__.py b/python/lib/sift_client/__init__.py index ede3d847b..2f27a8087 100644 --- a/python/lib/sift_client/__init__.py +++ b/python/lib/sift_client/__init__.py @@ -105,7 +105,7 @@ async def main(): ## Examples -For complete examples, see the [examples](../examples/) directory. +For complete examples, see the [examples](../../examples/) directory. ## Connection Configuration diff --git a/python/mkdocs.yml b/python/mkdocs.yml index 3129fcad3..8a9fbc16b 100644 --- a/python/mkdocs.yml +++ b/python/mkdocs.yml @@ -56,8 +56,9 @@ nav: - Sift Py API - Sift Client API (New) - Examples: - - examples/basic.ipynb - - examples/ingestion.ipynb + - examples/index.md + - Basic Usage: examples/basic.ipynb + - Data Ingestion: examples/ingestion.ipynb # - Guides: # - Logging # - Error Handling