semvec/pypi-packages huggingface dataset:
elastic-opentelemetry 1.11.0
Elastic Distribution of OpenTelemetry Python
Requires Python: >=3.9

# Elastic Distribution of OpenTelemetry Python

The Elastic Distribution of OpenTelemetry Python (EDOT Python) is a customized version of [OpenTelemetry Python](https://opentelemetry.io/docs/languages/python).
EDOT Python makes it easier to get started using OpenTelemetry in your Python applications through strictly OpenTelemetry native means, while also providing a smooth and rich out of the box experience with [Elastic Observability](https://www.elastic.co/observability). It's an explicit goal of this distribution to introduce **no new concepts** in addition to those defined by the wider OpenTelemetry community.

With EDOT Python you have access to all the features of the OpenTelemetry Python agent plus:

* Access to improvements and bug fixes contributed by the Elastic team _before_ the changes are available upstream in OpenTelemetry repositories.
* Access to optional features that can enhance OpenTelemetry data that is being sent to Elastic.
* Elastic-specific processors that ensure optimal compatibility when exporting OpenTelemetry signal data to an Elastic backend like an Elastic Observability deployment.
* Preconfigured collection of tracing and metrics signals, applying some opinionated defaults, such as which sources are collected by default.

**Ready to try out EDOT Python?** Follow the step-by-step instructions in [Setting up EDOT Python](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/python/setup/index.html).

## Configuration

The distribution supports all the configuration variables from OpenTelemetry Python project version 1.39.1.

See [Configuration](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/python/configuration.html) for more details.

## License

This software is licensed under the Apache License, version 2 ("Apache-2.0").
next-cvat 0.1.26
Minimalistic python SDK for CVAT
Requires Python: <4.0,>=3.9

# next-cvat

Minimalistic python SDK for CVAT.

Downloads and decodes annotations on the format "CVAT for images 1.1".

📚 [Read the documentation](https://nextml-code.github.io/next-cvat)

## Usage

Either add environment variables to your global environment or create an env file.

```bash
CVAT_USERNAME=username
CVAT_PASSWORD=password
```

If you don't want to use your username and password, you can create a token:

```bash
cvat create-token
```

And use it like this:

```bash
CVAT_TOKEN=token
```

_Note that the token expires in 14 days._

### Download dataset

```python
import next_cvat

if __name__ == "__main__":
    (
        next_cvat.Client.from_env_file(".env.cvat.secrets")
        .project(1234)
        .download_(dataset_path="dataset-path")
    )
```

or using CLI:

```bash
cvat download --project-id <project-id> --dataset-path <dataset-path>
```

### Load annotations

And then load annotations:

```python
from next_cvat import Annotations

annotations = Annotations.from_path("dataset-path/annotations.xml")
```

### Upload images

Create a new task and upload images to it:

```python
import next_cvat
from pathlib import Path

client = next_cvat.Client.from_env()

# Create a new task
task = client.create_task("My Task", project_id=1234)

# Upload images
client.upload_images_(
    task.id,
    [
        Path("images/image1.jpg"),
        Path("images/image2.jpg"),
    ]
)
```

### Update annotations

```python
client = next_cvat.Client.from_env_file(".env.cvat.secrets")

job = client.project(project_id).task(task_id).job(job_id)

annotations = job.annotations()

annotations.add_mask_(
    next_cvat.Mask.from_segmentation(
        segmentation=Image.open("tests/test_vegetation_mask.png"),
        label="Deformation",
    ),
    image_name="20240916_000854_2011T_437.bmp",
)

job.update_annotations_(annotations)
```

### Delete frames

Delete a frame from a task:

```python
# Get a frame by its index (0-based) or by name
frame = task.frame(frame_id=0)  # or task.frame(name="image1.jpg")

# Delete the frame
task.delete_frame_(frame.id)
```

### Low-level API

```python
from next_cvat import Client

client = Client.from_env_file(".env.cvat.secrets")

with client.cvat_client() as cvat_client:
    cvat_client.get_tasks()
```

## Development

To build the docs:

```bash
poetry run mkdocs build
```

To serve the docs:

```bash
poetry run mkdocs serve
```