semvec/pypi-packages huggingface dataset:
vtf2img 0.1.0
A library to convert Valve Texture Format (VTF) files into images
License: MIT

# vtf2img

A Python library to convert [Valve Texture Format (VTF)](https://developer.valvesoftware.com/wiki/Valve_Texture_Format) files to images.


## Installation

### With pip

```
$ pip install vtf2img
```

### From source

```
$ git clone https://github.com/julienc91/vtf2img
$ cd vtf2img
$ python setup.py install
```


## QuickStart

### As a library

```python
from vtf2img import Parser


vtf_file = "materials/models/weapons/customization/paints/custom/workshop/ak47_asiimov.vtf"

parser = Parser(vtf_file)
header = parser.header

print(f"VTF version: {header.version}, Image size: {header.width}x{header.height}")
# VTF version: 7.5, Image size: 2048x2048

image = parser.get_image()

image.show()
image.save("ak47_asiimov.png")
```

The result of `get_image` is an instance of [Pillow's `Image` class](https://pillow.readthedocs.io/en/stable/reference/Image.html#the-image-class),
which allows [exporting](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save) in many different formats (PNG, JPG, BMP, ...).


### As a CLI command

If you installed the package as instructed in the previous section, a `vtf2img` command should
be available.

```
$ vtf2img dragon_awp.wtf awp_dragon_lore.png
```

Otherwise, you can execute the package's `__main__.py` file with:

```
$ python -m vtf2img dragon_awp.wtf awp_dragon_lore.png
```


## Limitations

* many image formats supported by the VTF format are not (yet?) supported by this program (see the section below)
* this program only considers the hi-res image contained in the VTF file
* all the flags that might have been set by the VTF's creator are purely ignored

## VTF compatibility

Works with VTF version 7.2+.

Compatibility of image formats:

| Format            | Supported |
|-------------------|:---------:|
| A8                | ✗         |
| ABGR8888          | ✓         |
| ARGB8888          | ✓         |
| BGR565            | ✗         |
| BGR888            | ✓         |
| BGR888_BLUESCREEN | ✗         |
| BGRA4444          | ✗         |
| BGRA5551          | ✗         |
| BGRA8888          | ✓         |
| BGRX5551          | ✗         |
| BGRX8888          | ✗         |
| DXT1              | ✓         |
| DXT1_ONEBITALPHA  | ✗         |
| DXT3              | ✗         |
| DXT5              | ✓         |
| I8                | ✗         |
| IA88              | ✗         |
| P8                | ✗         |
| RGB565            | ✗         |
| RGB888            | ✓         |
| RGB888_BLUESCREEN | ✗         |
| RGBA16161616      | ✗         |
| RGBA16161616F     | ✗         |
| RGBA8888          | ✓         |
| UV88              | ✗         |
| UVLX8888          | ✗         |
| UVWQ8888          | ✗         |

Most VTF Files are using either DXT1 or DXT5.

_Note:_ DXT1 and DXT5 decoding algorithms were adapted from [Harry Jeffery](https://github.com/eXeC64/)'s implementation
on [vtf2png](https://github.com/eXeC64/vtf2png).
fruit 0.3.5
Create and run automations python scripts
License: MIT
Requires Python: >=3.6
Keywords: fruit,automation,python


Fruit
=====

Fruit is an automation framework written in python.

Configuration
-------------

Fruit, when installed via pip, can be called via the command ``fruit`` from the 
terminal. 

Targets
^^^^^^^

Targets are entry points of the **fruit make** process. They may be executed with the command ``fruit make <target>`` from the command line.

Each target may consist of multiple steps or even multiple sub targets. Each of these elemts will be automatically detected during the execution of a target. All sub targets and steps will be automatically listed and added to the result tracking of the called target.

To create a new target, use the decorator ``@fruit.target()``.

The following example will create a target with the name ``build`` and an empty
help text.

.. code-block:: python

   @fruit.target()
   def build():
     pass

The name and the help text of the target can be overwritten by using the argumetns ``name`` and ``help`` of ``@fruit.target()``.

.. code-block:: python

   # Create a target with the name 'build-new'
   @fruit.target(name='build-new', help='Build a new castle')
   def build():
     pass

The target results will be generated during the target execution process and the results will be shown after target is finished. May the target process be aborted, the results will show the unsuccessful execution with the proper error message.

Steps
^^^^^

Steps are the parts of targets and they serve diagnostic purposes and ease the
generation of detailed reports. They are not mandatory to define, but the provide nice diagnostics and cli output for longer processes.

Steps can be created by using the decorator ``@fruit.step()``. The step name will be the name of the decorated function by default but it can be overwritten
by the argument ``name``.

.. code-block:: python

   # Create a step called step1 without help text
   @fruit.step()
   def step1():
     pass

   # Create a step called 'GIT version' with help text
   @fruit.step(name='GIT version', help='Get the current version of the GIT repo')
   def step2():
     pass