semvec/pypi-packages huggingface dataset:
ocdiff 0.0.33
difftastic Python wrapper
Requires Python: >=3.11
Keywords: diff

# ocdiff

Fast and simple side-by-side diff library for Python - wraps [similar](https://crates.io/crates/similar), inspired by [icdiff](https://github.com/jeffkaufman/icdiff).

# Usage

```shell
pip install ocdiff
```

```python
ocdiff.html_diff(
    a: str,
    b: str,
    context_lines: int | None = None,
    max_total_width: int | None = None,
) -> str
```

```python
ocdiff.console_diff(
    a: str,
    b: str,
    context_lines: int | None = None,
    max_total_width: int | None = None,
) -> str
```

# Example Output

![Screenshot](screenshot-1.png)

# CLI usage

```shell
ocdiff a.txt b.txt
```

# Usage in `pytest` with [rich](https://github.com/Textualize/rich)

In your `conftest.py`, add:

```python
import ocdiff
import ocdiff.helpers
import rich.console

def rich_repr(o: Any) -> str:
    string_io = io.StringIO()
    rich.console.Console(
        file=string_io,
        width=ocdiff.helpers.terminal_width() // 2 - 10,
        tab_size=4,
        no_color=True,
        highlight=False,
        log_time=False,
        log_path=False,
    ).print(o)
    string_io.seek(0)
    return string_io.getvalue()


def pytest_assertrepr_compare(config: Any, op: str, left: Any, right: Any) -> list[str] | None:
    very_verbose = config.option.verbose >= 2
    if not very_verbose:
        return None

    if op != "==":
        return None

    try:
        if abs(left + right) < 100:
            return None
    except TypeError:
        pass

    try:
        if isinstance(left, str) and isinstance(right, str):
            pretty_left = left
            pretty_right = right
        else:
            pretty_left = rich_repr(left)
            pretty_right = rich_repr(right)
        return ocdiff.console_diff(
            pretty_left,
            pretty_right,
            context_lines=10,
            max_total_width=ocdiff.helpers.terminal_width() - len("E     "),
        ).splitlines()
    except Exception:
        return None
```

<br>
<hr>
<br>

# Install/Develop

```shell
uv pip install -e '.[dev]'
maturin develop
```

# Make release

- Add pypi token and user = `__token__` to settings (do this once).
- Upversion `pyproject.toml`.

```shell
export VERSION=$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])'); git tag -a v$VERSION head -m v$VERSION && git push origin v$VERSION
```
pixi-rocker 0.0.9
A rocker extension for adding the pixi package manager an existing docker image

# pixi_rocker



## Continuous Integration Status

[![Ci](https://github.com/blooop/pixi_rocker/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/blooop/pixi_rocker/actions/workflows/ci.yml?query=branch%3Amain)
[![Codecov](https://codecov.io/gh/blooop/pixi_rocker/branch/main/graph/badge.svg?token=Y212GW1PG6)](https://codecov.io/gh/blooop/pixi_rocker)
[![GitHub issues](https://img.shields.io/github/issues/blooop/pixi_rocker.svg)](https://GitHub.com/blooop/pixi_rocker/issues/)
[![GitHub pull-requests merged](https://badgen.net/github/merged-prs/blooop/pixi_rocker)](https://github.com/blooop/pixi_rocker/pulls?q=is%3Amerged)
[![GitHub release](https://img.shields.io/github/release/blooop/pixi_rocker.svg)](https://GitHub.com/blooop/pixi_rocker/releases/)
[![License](https://img.shields.io/github/license/blooop/pixi_rocker)](https://opensource.org/license/mit/)
[![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)](https://www.python.org/downloads/)
[![Pixi Badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json)](https://pixi.sh)

## Intro

This is a [rocker](https://github.com/osrf/rocker) extension for adding [pixi](https://pixi.sh) to an existing docker image. Look at the rocker GitHub page for more context of how rocker and rocker extensions work, but in a nutshell rocker lets you add custom capabilities to existing docker containers. Rocker extensions

[Pixi](https://github.com/prefix-dev/pixi) is a cross-platform package manager based on the conda ecosystem.  It provides a simple and performant way of reproducing a development environment and running user defined tasks and workflows.  It is more lightweight than docker, but does not provide the same level of isolation or generality. 

### But Why??

The most common question I get is is why would you need to use pixi in docker as pixi is already taking care of your environment for you.  Unfortunately there are some packages/configuration that pixi is not able to handle yet and so one way of handling that is managing those dependencies/configuration in docker and leave the the rest up to pixi. 

Another benefit of pixi in docker is that you are more isolated from your host machine and have more flexibility to make changes without worrying about conflicting with other projects. 

If you use vscode to attach to your development container it makes it easier to set up specific extensions for each project that don't need to be installed globally. 

## Installation

```
pip install pixi-rocker
```

## Usage

To install pixi in an image use the --pixi flag

```
#add pixi to the ubuntu:22.04 image
rocker --pixi ubuntu:22.04

# add pixi to the nvidia/cuda image
rocker --pixi nvidia/cuda
```
structure-generator 0.0.3
This is a tool to generate eta and comp structure data.
Requires Python: >=3.8

# sturcture_generator
## Instruction
This is a package designed to generate eta/comp structures, consisting of four modules. In the `basic` module, there are functions for generating 3D data with various distributions and functions for writing data to files. The `eta` module contains functions for generating eta data, the `comp` module includes functions for generating comp data, and in the `scripts` module, there are functions that can be executed via the command line.

## How to use
In the `pyproject.toml` file, a command-line command `generate_structure` is defined, with its detailed implementation specified in the `scripts/generate_structure.py` file. It accepts a parameter indicating the location of the `input.toml` file and ultimately generates eta/comp structural data.

## How to add functionality
If we want to add new functionality, we can utilize the basic functionalities within the `basic` module or add new functionalities to it. Subsequently, we can introduce a new package under the `structure_generator`, employing the basic functionalities to fulfill our requirements. Finally, we define functions for command-line invocation in the `scripts` directory, and we can pass command-line parameters through `argparser` package. It's important to note that the command-line configuration should be specified in the `pyproject.toml` file.

```toml
# pyproject.toml
[project.scripts]
generate_structure = structure_generator.generate_sturcture
```

## How to build a package
[pacakge build tutorial](https://packaging.python.org/en/latest/tutorials/packaging-projects/)

### build construction
If you want to build the package, run the following commands in the directory where the `pyproject.toml` is located, depending on the operating system. The built package will appear in the `dist` folder.
```sh
# windows
py -m build
# Unix/macOs
python3 -m build
```
stk-data 0.0.2
This is a library of functions for manipulating data.
Requires Python: >=3.6

# data
## Instruction
Function planning in the Python library:
```python
data
    - data_handling
    - drawing
    - plotting
    - research
    - scripts
    - statistics
    - utils
```

##  How to use
### install
You can build the package by running the following commands in the directory where the `pyproject.toml` is located, depending on the operating system. The built package will appear in the dist folder
```bash
pip install build
# Windows
py -m build
# Unix/macOS
python3 -m build
```
After, you can install the package under `dist` folder by running command
```bash
pip install ./data-0.0.1-py3-none-any.whl
```
We publish the package on PyPI website, you can install the package by running command
```bash
pip install stk-date
```
### import package in python
```python
# import package
import stk_data
from stk_data.statistics import get_skyrmion_shape
nx = 250
ny = 250
nz = 10
nk = 6
nR = 100
dx = 2.0
dy = 2.0
load_file_name = 'path/to/load_file'
save_file_name = 'path/to/save_file'

get_skyrmion_shape(nx, ny, nz, nk, nR, dx, dy, load_file_name, save_file_name)

```
### scripts
1. Calculate the topological number, parameters can be read and calculated via commands, terminal command as follows:
```bash
# usage: get_skyrmion_shape [-h] [--nx NX] [--ny NY] [--nz NZ] [--nk NK] [--nR NR] [--dx DX] [--dy DY] [--load_file_name LOAD_FILE_NAME] [--save_file_name SAVE_FILE_NAME]

# use examples
get_skyrmion_shape --nx 250 --ny 250 --nz 10 --nk 6 --nR 100 --dx 2.0 --dy 2.0 --load_file_name magnt.in --save_file_name GetSkyrmionShape120.dat

```
hacking-shield 0.2.3
Client for detecting harmful SQL queries using a third-party API
Requires Python: >=3.6



```markdown
# Hacking Shield

**Hacking Shield** is a Python client for detecting harmful SQL queries using a third-party API. It helps developers ensure the security of their applications by identifying potentially malicious SQL statements before they can be executed.

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [API Reference](#api-reference)
- [Contributing](#contributing)
- [License](#license)

## Features

- Detect harmful SQL queries using a third-party API.
- Simple and easy-to-use client interface.
- Supports authorization with API keys for secure access.
- Easy installation with pip.

## Installation

You can install the package using pip:

```bash
pip install hacking_shield
```

## Usage

Here's a quick example of how to use the **Hacking Shield** client:

```python
from hacking_shield import SQLDetectionClient

# Initialize the client with your API key
client = SQLDetectionClient(api_key="your_api_key")

# Define a SQL query
sql_query = "SELECT * FROM users WHERE id = 1 OR 1=1;"

# Detect harmful SQL
result = client.detect_harmful_sql(sql_query)

if result:
    print("Detection Result:", result)
```

Replace `"your_api_key"` with your actual API key.

## API Reference

### SQLDetectionClient

- **`__init__(api_key: str)`**: Initializes the client with the provided API key.

- **`detect_harmful_sql(sql_query: str) -> dict`**: Sends the SQL query to the API for detection. Returns a dictionary with the result.

## Contributing

Contributions are welcome! If you have suggestions for improvements or find bugs, please open an issue or submit a pull request.

### Steps to Contribute

1. Fork the repository.
2. Create your feature branch (`git checkout -b feature/new-feature`).
3. Commit your changes (`git commit -m 'Add new feature'`).
4. Push to the branch (`git push origin feature/new-feature`).
5. Open a pull request.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
```

### Customization Suggestions:
- **Add More Features**: If there are additional features or functionalities, feel free to expand the "Features" section.
- **Include Example Outputs**: If you have specific expected outputs from the API, you can include those in the "Usage" section.
- **Contributors Section**: If there are collaborators, consider adding a "Contributors" section to give them credit.

### Notes:
- Ensure the formatting is correct when you copy it into your `README.md` file, especially for code blocks.
- You can add images, badges, or links to related projects as needed to enhance the README.

If you have specific details you’d like to include or any other adjustments, let me know!