semvec/pypi-packages huggingface dataset:
torch-extension 0.0.1.3.9
This Python module provides a collection of utility functions designed for advanced tensor manipulation using PyTorch. It includes functions for applying operations along specific dimensions, mapping values to new ranges, and generating linearly spaced tensors, among others.
Requires Python: >=3.7

# PyTorch Extension

## Overview

This Python module provides a collection of utility functions designed for advanced tensor manipulation using PyTorch. It includes functions for applying operations along specific dimensions, mapping values to new ranges, and generating linearly spaced tensors, among others.

## Functions

### `buffer(tensor, persistent)`
Used in the `nn.Module`, for registering a buffer in an assignment form.

### `apply_from_dim(func, tensor, dim, otypes)`
Applies a given function to a specified dimension of a tensor.

### `min_dims(tensor, dims, keepdim, out)`
Computes the minimum values over specified dimensions.

### `max_dims(tensor, dims, keepdim, out)`
Computes the maximum values over specified dimensions.

### `map_range(tensor, interval, dim, dtype, scalar_default, eps)`
Maps tensor values to a specified range.

### `map_ranges(tensor, intervals, dim=None, dtype, scalar_default, eps)`
Maps tensor values to multiple specified ranges.

### `gamma(input, out)`
Calculates the gamma function for each element in the tensor.

### `gamma_div(left, right, out)`
Calculates the division of gamma functions for corresponding elements of two tensors.

### `recur_lgamma(n, base)`
Calculates the recursive logarithm of the gamma function.

### `arith_gamma_prod(arith_term, arith_base, ratio_base)`
Calculates the product of terms using the arithmetic series and gamma function.

### `linspace(start, stop, num, dtype)`
Generates linearly spaced values between `start` and `stop`, supporting `Tensor` as input.

### `linspace_at(index, start, stop, num, dtype)`
Generates linearly spaced values at specific indices.

### `invert(tensor)`
Inverts the values in the tensor across its dimensions.

### `nn.refine_model(model)`
Extracts the underlying model from a DataParallel wrapper, if present.

### `nn.Buffer(tensor, persistent)`
The class that used in the `buffer(tensor, persistent)`.

## Usage

These functions are intended for use with PyTorch tensors in deep learning and numerical computation contexts. Each function provides additional control over tensor operations, particularly in high-dimensional data manipulation and preprocessing.
ytube-data-and-transcript 0.1.0
A python package that utilizes the YouTube Data V3 API to get all transcripts from a given channel/playlist.
Requires Python: >=3.6

# YouTube-Data-and-Transcript-API

## Overview

This project provides a Python-based tool that interacts with the YouTube Data API to retrieve video data and transcripts. The goal is to enable easy access to video metadata and subtitles for analysis, research, or other applications.

## Features

- Retrieve video metadata such as title, description, view count, like count, and more.
- Fetch video transcripts (subtitles) when available.
- Easy-to-use command-line interface.

## Requirements

-  Python 3.6 or higher
- `requests` library
- `google-auth` library (for authenticated API access)
- `youtube-transcript-api` library

## Installation

1. **Clone the repository:**
   ```bash
   git clone https://github.com/DevanshL/YouTube-Data-and-Transcript-API.git
   cd YouTube-Data-and-Transcript-API
   ```
   
2. **Create a virtual environment:**
  ```bash
  python -m venv venv
  ```

3. Activate the virtual environment:
   * On Windows:
   ```bash
   venv\Scripts\activate
   ```
   * On macOS and Linux:
   ```bash
   source venv/bin/activate
   ```
   
4. Install the required Python packages:
   ```bash
   pip install -r requirements.txt
   ```

5. Create a Google Cloud project and enable the YouTube Data API v3:

    * Visit the Google Cloud Console.
    * Create a new project (or use an existing one).
    * Enable the YouTube Data API v3 for your project.
    * Create API credentials and obtain your API key.

6. Setting Up the config.json File:

    * Create a config.json file in the testing folder of the project.
    * The config.json file should contain your API key. Here’s an example structure:
    ```bash
      {
    "api_key": "YOUR_YOUTUBE_API_KEY"
    }
    ```
    * Replace YOUR_YOUTUBE_API_KEY with your actual API key.


## Usage

* Create a testing,.py file and use below code
```bash
from working.data import fetch_video_info
from working.transcript import fetch_transcript
import json

def load_api_key_from_json(file_path):
    with open(file_path, 'r') as file:
        data = json.load(file)
        return data['youtube_api_key']

api_key = load_api_key_from_json('filepath')
video_id = ''                 # example H9dCIPzRf
details = fetch_video_info(video_id, api_key)
transcript = fetch_transcript(video_id)

# print(details)
# print(transcript)        check for yourself
```

## Contributing

If you would like to contribute to this project, feel free to open an issue or submit a pull request. Please ensure that your contributions align with the coding style and standards used in this project.

## License

This project is licensed under the MIT License. See the LICENSE file for details.