semvec/pypi-packages huggingface dataset:
github-dlr 0.1.2
Download individual files and folders from Github
Requires Python: <4.0,>=3.8
Keywords: download, github, directory, gitdown

# Github-dlr

Download individual files and folders from GitHub recursively.

[![Tests](https://github.com/rocktimsaikia/github-dlr/actions/workflows/tests.yml/badge.svg)](https://github.com/rocktimsaikia/github-dlr/actions/workflows/tests.yml)

[![Demo](https://github.com/user-attachments/assets/49e4068c-1090-4c9e-9b56-59388ff407a9)](https://github.com/user-attachments/assets/8927d4ef-f8e1-4699-b75b-b7e28291d509)

## Motivation

The project aims to save time and resources by allowing users to download only the specific folders and files they need from a GitHub repository, without the hassle of cloning the entire repo. It's designed for efficiency, making development and learning more streamlined.

## Install

Requires Python version 3.8 or higher.

```sh
pip install github-dlr
```

or using [pipx](https://pipx.pypa.io/)

```sh
pipx install github-dlr
```

## Usage

> [!NOTE]
> Using the tool is straightforward, copy the GitHub URL of the target repository folder and paste it after the command `github-dlr` or it's alias `gh-dlr`.

```sh
github-dlr <github_path>

# Basic Example
github-dlr https://github.com/makccr/wallpapers/blob/master/wallpapers/space
```

> [!NOTE]
> By default it will download the entire folder from GitHub and place in the current directory from where the command is being executed. If you want to specify a different output directory, you can do it via the `--output` or `-o` flag.

```sh
github-dlr --output wallpapers https://github.com/makccr/wallpapers/blob/master/wallpapers/space
```

\
Find all available options using `--help`

```sh
usage: github-dlr [-h] [-o] [-v] github_path

Download folders and files from Github.

positional arguments:
  github_path     Github directory full URL path

options:
  -h, --help      show this help message and exit
  -o, --output   Destination directory to download to
  -v, --version   show program version number and exit

Thanks for using github-dlr!
```

## LICENSE

[MIT](./LICENSE) License &copy; [Rocktim Saikia](https://rocktimsaikia.dev) 2024
bcubed-metrics 1.0.1
A package to calculate BCUBED precision, recall, and F1-score for clustering evaluation.
Requires Python: >=3.6
Keywords: bcubed

# B-Cubed Metrics

<div style="text-align: justify">
A simple Python package to calculate B-Cubed precision, recall, and F1-score for clustering evaluation.
</div>

## What are B-Cubed Metrics
<div style="text-align: justify">
The B-Cubed algorithm was first introduced by Bagga, A. and Baldwin B. (1998) in their paper on Entity-Based Cross-Document Coreferencing Using the Vector Space Model. The algorithm compares a predicted clustering with a ground truth (or gold standard) clustering through element-wise precision and recall scores. For each element, the predicted and ground truth clusters containing the element are compared, and then the mean over all elements is taken. The B-Cubed algorithm can be useful in unsupervised techniques where the cluster labels are not available, because unlike macro-averaged metrics, it focuses on element-wise operations.
</div>

<div style="text-align: justify">
From the paper, two simple equations were devised calculating precision and recall scores for the predicted clustering:
</div>

$$
Precision = \frac{1}{\sum {elements}}\sum_{i=1}^n {\frac{(count \; of \; element)^2}{count \; of \; all \; elements \; in \; cluster}}
$$

$$
Recall = \frac{1}{\sum {elements}}\sum_{i=1}^n {\frac{(count \; of \; element)^2}{count \; of \; total \; elements \; from \; this \; category}}
$$

$$
F-score = \frac{1}{k}\sum_{i=1}^n {\frac{2\times Precision(C)_k \times Recall(C)_k}{Precision(C)_k + Recall(C)_k}}
$$

<div style="text-align: justify">

where $n$ above denotes the number of categories in the cluster and $k$ is the number of predicted clusters. $Precision(C)_k$ and $Recall(C)_k$ are the 'partial' precision and recalls for each cluster. 
</div>


## Installation and Use
<div style="text-align: justify">
Download the package from any terminal using:
</div>

```bash
pip install bcubed-metrics
```
<div style="text-align: justify">
To use the B-Cubed class you need to import it and provide 2 dictionaries - one for the predicted clustering, and one for the ground truth clustering (actual labels):
</div>

```python
from bcubed_metrics.bcubed import Bcubed

predicted_clustering = [
            {'blue': 4, 'red': 2, 'green': 1},
            {'blue': 2, 'red': 2, 'green': 3},
            {'blue': 1, 'red': 5},
            {'blue': 1, 'red': 2, 'green': 3}
        ]

ground_truth_clustering = {'blue': 8, 'red': 11, 'green': 7}

bcubed = Bcubed(predicted_clustering=predicted_clustering, ground_truth_clustering=ground_truth_clustering)

metrics = bcubed.get_metrics() # returns all metrics as dictionary

bcubed.print_metrics() # prints all metrics
```