semvec/pypi-packages huggingface dataset:
umnet-scripts 1.1.0
Python tools for interacting with UMnet's network tools
Requires Python: >=3.6

# umnet-scripts
A set of python modules/classes for interacting with UMnet tools.

This package is hosted on pypi - you can install it with `pip install umnet-scripts` and use it in your own code.

# Database Helper Classes
As of Dec 2021 this repo defines db wrapper classes for Equipdb, Netinfo, and Netdisco.
To use these classes you need to set specific environment variables with the credentials
for each db respectively:
* Netinfo: `NETINFO_USERNAME`, `NETINFO_PASSSWORD`
* Netdisco: `NETDISCO_DB_USER`, `NETDISCO_DB_PASSWORD`
* Equipdb: `EQUIP_DB_USER`, `EQUIP_DB_PASSWORD`

Queries for specific things are added as they're needed. As of Dec 2021 there are only a few methods defined for netdisco and equipdb.
Each class inherits a super basic sql query builder method as well as an 'execute' method from a base class (see `umnetdb.py`).

# Rancid Helper Class
The rancid helper class currently parses the router.db files in `/home/rancid/` as well as the `/home/rancid/Topology`
into a list of `Device` objects with rancid-related data as attributes, particularly the following:
* `rancid_name`: The name of the device as rancid knows it (the name of the config file). IP address for AL, DNS name for everything else.
* `rancid_type`: The rancid perl script that is used to back up the device (eg `juniper` or `Cat3750`)
* `rancid_role`: This is the folder the device config lives in, eg `accesslayer` or `core`. Maps 1:1 to the equipdb device `type`.
* `model`: Device model as populated in equipdb, eg 'EX2200-24T-4G'
* `cfg_file`: Full path to the config file, eg `/home/rancid/accesslayer/10.233.0.10`
* `status`: Up or down per the equipdb `offline` flag (offline is down).
* `neighbors`: A dict of the device's neighbors as reported by TopologyWalker.

There are also two attributes that look like attributes but are actually 'property' functions: `hostname` and `ip` that return the device's hostname
or IP respectively. If you call 'hostname' for a device whose rancid name is an IP, a dns reverse lookup is done. Similarly,
if you call 'ip' on a device whose rancid name is a DNS name, a forward dns lookup is done.

Note that if you're only focusing on one rancid config folder (eg datacenter, accesslayer, etc),
to speed your code up you can limit which folders are processed when you instantiate the Rancid class.
Note that if you want to get devices by dl_zone you *must* include the distlayer folder at minimum.
tree-types 0.2.2
A Class that computes the types of elements in a Object
Requires Python: >=3.9

# tree_types

A module that help with identifying the types of objects in a list or dictionary.

# How to use

After installing it with pip install, import in your project and use as follows:

```
from tree_types import TreeTypes

obj = {
    'v1': [1, 2, 3, 4],
    'v2': {
        'v1': 1,
        'v2': 2
    }
}

tt = TreeTypes(obj)
tt.process()

print(tt)
>> <TreeTypes(type=dict[str,list[int]|dict[str,int]])>
```

## Print Mode

You can chose how the Class will print the class tree by using the arg ```print_mode``` during instancing of class.

The arg receives a instance of the class ```PrintMode``` that is defined in this module too. It is defined as a Enum that has 2 modes:

- Class mode: the Tree is printed as a Class like the exemple above.
- Pretty mode: the Tree is printed as a text class, with indication of the itens in the object with the type of the item.
adnan-project1 0.1.0
A Python project using Poetry for dependency management
Requires Python: >=3.13

# Project1

A Python project using Poetry for dependency management.

## Basic Poetry Commands

```bash
# Check Poetry version
poetry --version

# Create a new project
poetry new project1

# Check Python version
poetry run python --version

# Add a package dependency
poetry add PACKAGE_NAME
# Example: poetry add requests

# Run a Python file
poetry run python FILE_PATH
# Example: poetry run python ./src/project1/main.py

# Run tests
poetry run pytest

# Build the package
poetry build

# Publish to PyPI
poetry publish
```

## Publishing to PyPI

### Prerequisites
1. Create a PyPI account at [PyPI.org](https://pypi.org/account/register/)
2. Generate an API token in your PyPI account settings

### Configuration
```bash
# Configure your PyPI token
poetry config pypi-token.pypi YOUR_API_TOKEN_HERE

# Or use environment variable
export POETRY_PYPI_TOKEN_PYPI="your_token_here"
```

### Publishing Steps
```bash
# 1. Build the package
poetry build

# 2. Publish to PyPI
poetry publish

# 3. Verify your package is published
# Check https://pypi.org/project/project1/
```

### Testing with TestPyPI (Recommended for first-time publishers)
```bash
# Add TestPyPI repository
poetry config repositories.testpypi https://test.pypi.org/legacy/

# Configure TestPyPI token
poetry config pypi-token.testpypi YOUR_TESTPYPI_TOKEN_HERE

# Publish to TestPyPI first
poetry publish --repository testpypi
```

## Development

```bash
# Install dependencies
poetry install

# Activate virtual environment
poetry shell

# Add development dependencies
poetry add --group dev pytest

# Run tests
poetry run pytest
```

## Project Structure
```
project1/
├── pyproject.toml      # Project configuration and dependencies
├── poetry.lock         # Locked dependency versions
├── src/
│   └── project1/      # Source code
│       ├── __init__.py
│       └── main.py
└── tests/              # Test files
    └── test_project1.py
```
datasette-demo-dbs 0.1.1
Fetch missing demo DBs from URLs when Datasette first starts
Requires Python: >=3.9

# datasette-demo-dbs

[![PyPI](https://img.shields.io/pypi/v/datasette-demo-dbs.svg)](https://pypi.org/project/datasette-demo-dbs/)
[![Changelog](https://img.shields.io/github/v/release/datasette/datasette-demo-dbs?include_prereleases&label=changelog)](https://github.com/datasette/datasette-demo-dbs/releases)
[![Tests](https://github.com/datasette/datasette-demo-dbs/actions/workflows/test.yml/badge.svg)](https://github.com/datasette/datasette-demo-dbs/actions/workflows/test.yml)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/datasette/datasette-demo-dbs/blob/main/LICENSE)

Fetch missing demo DBs from URLs when Datasette first starts

## Installation

Install this plugin in the same environment as Datasette.
```bash
datasette install datasette-demo-dbs
```
## Configuration

Configure the plugin in your Datasette metadata (YAML or JSON). You specify:

- `path`: directory on disk where downloaded .db files will be stored (defaults to current directory)
- `dbs`: a mapping of database name to the URL of the SQLite database file

Example metadata.yml:

```yaml
plugins:
  datasette-demo-dbs:
    path: ./demo-dbs
    dbs:
      demo: https://example.com/path/to/demo.db
      census: https://example.com/path/to/census.db
```

Equivalent metadata.json:

```json
{
  "plugins": {
    "datasette-demo-dbs": {
      "path": "./demo-dbs",
      "dbs": {
        "demo": "https://example.com/path/to/demo.db",
        "census": "https://example.com/path/to/census.db"
      }
    }
  }
}
```
## How it works

On Datasette startup, for each entry in `dbs`:

1. If `path/<name>.db` already exists, it is left as-is and loaded into Datasette.
2. If a marker file `path/<name>.deleted` exists, the download is skipped.
3. Otherwise, the plugin downloads the content from the URL (following redirects), streams it to `path/<name>.db`, and registers that database in Datasette under the given name.

## Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:
```bash
cd datasette-demo-dbs
python -m venv venv
source venv/bin/activate
```
Now install the dependencies and test dependencies:
```bash
pip install -e '.[test]'
```
To run the tests:
```bash
python -m pytest
```
gdvc 0.0.2
Lightweight Google Drive file upload and version control CLI tool
Requires Python: >=3.7

# GDVC Mini

[![PyPI version](https://badge.fury.io/py/gdvc.svg)](https://badge.fury.io/py/gdvc)

Simple version control using Google Drive folders. Simplifes the process of quick iteration and dev sharing within drive.

A simplified midway between [dvc](https://dvc.org/)/[rclone](https://rclone.org/drive/).

#### Alternatives:
Rclone/DVC:
1. Rclone/dvc require permissions for downloading and initial setup. This makes others testing a repo harder
2. DVC also uses a custom file format and doesn't allow for quick downloading for testing

Git LFS:
1. Limited file storage and no support for custom backends

Note: This is not intended for full model checkpoints, as each version currently duplicates the entire folder.

## Install
```
pip install gdvc
```

dev Version:
```
pip install -e .
```

push to drive setup:
```
gcloud auth application-default login --scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/drive
```
init your drive folder:
```
gdvc init https://drive.google.com/drive/folders/YOUR_FOLDER_ID
```

## Usage

Track directories:
```
gdvc track add models
gdvc track add data
gdvc track list
```

Upload a version (to your configured private Google Drive folder):
```
gdvc upload v1
```

Download version:
```
gdvc download v1
gdvc download latest
```

Change to different Drive folder:
```
gdvc change_folder_root https://drive.google.com/drive/folders/NEW_FOLDER_ID
```

## Commands

- `init <folder_url>` - Initialize project
- `track add/remove/list` - Manage tracked directories  
- `upload <version>` - Upload tracked directories as version
- `download <version>` - Download version to current directory
- `change_folder_root <url>` - Switch to new Drive folder, keep current version only
- `publish <version>` - Make version public
- `update` - Download latest version

## File Structure

Uploads create: `version_name/directory_name/files`
Downloads merge into current directory preserving structure.

## Configuration

Project settings are stored in `.gdvc_config.json` which can be safely committed to git.
Contains Drive folder URLs, version history, and tracked directories.

**Sample config structure:**
```json
{
  "drive_folder_url": "https://drive.google.com/drive/folders/<sample_folder>",
  "versions": {
    "v1.0": {
      "url": "https://drive.google.com/drive/folders/<sample_folder>",
      "local_path": ".",
      "is_public": false
    },
   },
  "public_version": "v0",
  "current_version": "v1.0",
  "tracked_directories": ["models", "data"]
}
```
specialpointiteration 0.0.2
Iterate through points in boxes that have some nice denominator structure after a coordinate change
Requires Python: >=3.12

Suppose you have a function on a product of intervals

We have some reason to believe that possibly after some coordinate change
the points that are some nice fraction of the way along each coordinate axis
are of more interest than the points where the coordinates do not have such nice form

Here nice form means that they are a/b^d with b something small like 2 or 3. b is fixed at the initial step

This means we are exploring points that are halfway or a third of the way along the interval
and then moving on to stepping by quarters or ninths and so on

The points we are exploring are grouped by the maximum power d when
each of the (before transformation) coordinates are
written as a/b^d in lowest terms, call this set of points G_d

### Decimation

If there are too many of these because the dimensionality of the box is large and/or
b^d is large, we can impose some decimation so only approximately f(d) many points are emitted
from G_d
if for a particular d, |G_d| <= f(d), this filtering does not take place
but because |G_d| grows so fast and the provided f(d) should have much slower growth
the filtering will happen at some stage
shephex 0.3.2
Computational experiment manager. Execute parameterized Python function on Slurm directly from a python script
Requires Python: >=3.11

# shephex

![coverage](https://gitlab.com/Mads-Peter/shephex/badges/master/coverage.svg)
<img alt="Website" src="https://img.shields.io/website?url=https%3A%2F%2Fmads-peter.gitlab.io%2Fshephex%2F&up_message=Live&down_message=Dead&label=Docs&link=https%3A%2F%2Fmads-peter.gitlab.io%2Fshephex%2F">

A Python package for managing and executing computational experiments.

Features
- Easy management of parameter sweeps
- Execution of python function or scripts with input sets.
- Simple SLURM Scheduling from Python.
- Extendable execution class to adapt to other job management systems.

The example show how easy it is to submit an arbitrary Python function for execution 
on Slurm. The function in this case is a biased-random walk in 2D for which 50 different 
parameterizations are submitted and executed. 
```python
import numpy as np
import shephex

@shephex.hexperiment()
def biased_random_walk_2d(steps: int, bias_x: float, bias_y: float) -> tuple:
    """
    Simulate a 2D biased random walk and return the final position.
    """    
    # Movement choices: (-1, 1) for left/right (x) and down/up (y)
    moves_x = np.random.choice([-1, 1], size=steps, p=[1 - bias_x, bias_x])
    moves_y = np.random.choice([-1, 1], size=steps, p=[1 - bias_y, bias_y])
    
    final_x = np.sum(moves_x)
    final_y = np.sum(moves_y)
    
    return final_x, final_y  # Return final (x, y) position

if __name__ == '__main__':

    experiments = []
    for steps in [10, 100, 250, 500, 1000]:
        for bias_x in [0.5, 0.6]:
            for repeat in range(5):
                experiments += [biased_random_walk_2d(steps=steps, 
                                                    bias_x=bias_x, 
                                                    bias_y=0.5)]

    executor = shephex.SlurmExecutor(ntasks=1, partition='q48', time='00:10:00')
    executor.execute(experiments)
```
gdvc-mini 1.0.3
Lightweight Google Drive file upload and version control CLI tool
Requires Python: >=3.7

# GDVC Mini

[![PyPI version](https://badge.fury.io/py/gdvc-mini.svg)](https://badge.fury.io/py/gdvc-mini)

Simple version control using Google Drive folders. Simplifes the process of quick iteration and dev sharing within drive.

A simplified midway between [dvc](https://dvc.org/)/[rclone](https://rclone.org/drive/).

#### Alternatives:
Rclone/DVC:
1. Rclone/dvc require permissions for downloading and initial setup. This makes others testing a repo harder
2. DVC also uses a custom file format and doesn't allow for quick downloading for testing

Git LFS:
1. Limited file storage and no support for custom backends

Note: This is not intended for full model checkpoints, as each version currently duplicates the entire folder.

## Install
```
pip install gdvc
```

dev Version:
```
pip install -e .
```

push to drive setup:
```
gcloud auth application-default login --scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/drive
```
init your drive folder:
```
gdvc init https://drive.google.com/drive/folders/YOUR_FOLDER_ID
```

## Usage

Track directories:
```
gdvc track add models
gdvc track add data
gdvc track list
```

Upload a version (to your configured private Google Drive folder):
```
gdvc upload v1
```

Download version:
```
gdvc download v1
gdvc download latest
```

Change to different Drive folder:
```
gdvc change_folder_root https://drive.google.com/drive/folders/NEW_FOLDER_ID
```

## Commands

- `init <folder_url>` - Initialize project
- `track add/remove/list` - Manage tracked directories  
- `upload <version>` - Upload tracked directories as version
- `download <version>` - Download version to current directory
- `change_folder_root <url>` - Switch to new Drive folder, keep current version only
- `publish <version>` - Make version public
- `update` - Download latest version

## File Structure

Uploads create: `version_name/directory_name/files`
Downloads merge into current directory preserving structure.

## Configuration

Project settings are stored in `.gdvc_config.json` which can be safely committed to git.
Contains Drive folder URLs, version history, and tracked directories.

**Sample config structure:**
```json
{
  "drive_folder_url": "https://drive.google.com/drive/folders/<sample_folder>",
  "versions": {
    "v1.0": {
      "url": "https://drive.google.com/drive/folders/<sample_folder>",
      "local_path": ".",
      "is_public": false
    },
   },
  "public_version": "v0",
  "current_version": "v1.0",
  "tracked_directories": ["models", "data"]
}
```
blite-tracing 0.1.1
Add your description here
Requires Python: >=3.9

# To use

```sh
export BLITE_TRACING_ENABLED=1
```

```py
from blite_tracing.trace import start_event, end_event, write_trace

start_event("event_name")
your_code_here
end_event("event_name")
write_trace()
```

It's just a one file codebase, very tine, just refer to `trace.py` for any details. Basically we just
write to json in the format that chorme://tracing undertands.