semvec/pypi-packages huggingface dataset:
bootstrap-builder 0.0.5
A small small package I use to turn some objects into Bootstrap HTML
Requires Python: >=3.5

# Bootstrap Builder

This is just a small lil package to make building HTML with Python _hopefully_ a lil easier.

```python
>>> import bootstrap_builder as bb
>>> page = bb.HTMLPage(title="Bootstrap Builder")  # Make a page containing the head and body and etc
>>>
>>> # Time for navbar
>>> navbar_container = page.new_navbar()
>>> print(navbar_container)  # <nav class="navbar" />
>>> navbar_container['class'].append('navbar-expand-sm')  # Add 'navbar-expand-sm' to the class list
>>> print(navbar_container)  # <nav class="navbar navbar-expand-sm" />
>>> with navbar_container.new_navbar_nav() as navbar:
	_ = navbar.new_navbar_nav_item().new_child('a', 'Index', attrs={'href': '/index', 'class': 'nav-link'})  # You can add attrs inside new_XXX methods if you don't want to do it via __setitem__

>>> print(navbar_container)  # <nav class="navbar navbar-expand-sm" ><ul class="navbar-nav"><li class="nav-item"><a href="/index" class="nav-link">Index</a></li></ul></nav>
>>>
>>> child = page.new_child('div')
>>> child['data-test'] = 'test1'  # Add a new attr
>>> child['class'].append('owo')  # Add a new class
>>> print(child)  # <div data-test="test1" class="owo" />
>>>
>>> # Add some content to the tag
>>> child = page.new_child('div')
>>> _ = child.new_child('p', 'Nested Tag')  # This is a nested tag
>>> print(child)  # <div><p>Nested Tag</p></div>
>>>
>>> # We can also just add plain content
>>> child = page.new_child('div')
>>> _ = child.add_child('p', 'New Child')  # Like .new_child, but doesn't create a new object, just adds it to the object
>>> print(child)  # <div>New Child</div>
>>>
```
spriteutil-detection 1.0.2
A small example package
Requires Python: >=3.6

# Sprites Detection
A [**sprite**](<https://en.wikipedia.org/wiki/Sprite_(computer_graphics)>) is a small [**raster graphic**](https://en.wikipedia.org/wiki/Raster_graphics) (a **bitmap**) that represents an object such as a [character, a vehicle, a projectile, etc.](https://www.youtube.com/watch?v=a1yBP5t-fSA)

## Sprite Sheet

It is not uncommon for games to have tens to hundreds of sprites. Loading each of these as an individual image would consume a lot of memory and processing power. To help manage sprites and avoid using so many images, many games use [**sprite sheets**](https://www.youtube.com/watch?v=crrFUYabm6E) (also known as **image sprites**).

A sprite sheet consists of multiple sprites in one image. In other words, sprite sheets pack multiple sprites into a single picture. Using sprite sheet, video game developers create sprite sheet animation representing one or several animation sequences while only loading a single file:


## Sprite Bounding Box

A frame (**bounding box**) can be used to delimit the sprite in the sprite sheet. This bounding box is defined with two 2D points `top_left` and the `bottom_right`, which their respective coordinates `x` and `y` are relative to the top-left corner of the sprite sheet's image.


## Sprite Mask

The mask of a sprite defines the 2D shape of the sprite. 



## Aim of the project
- Detect sprites packed in an image (sheet) and draw their masks and bounding boxes into a new image with the same size of the original image. <br/>
- Present a 2D map of all the the sprites with their labels. <br/>

## Installation
- `pipenv install spriteutil_detection`

## Features
### Find sprites
- For example: <br/>
```python
>>> from spriteutil_detection import SpriteSheet
>>> sprite_sheet = SpriteSheet('Barbarian.gif')
>>> sprites, labels = sprite_sheet.find_sprites()
>>> len(sprites)
39
```

### Create sprites' masks and bouding boxes
- For example: <br/>
```python
>>> from spriteutil_detection import SpriteSheet
>>> sprite_sheet = SpriteSheet('Barbarian.gif')
>>> # Create the mask image with bounding boxes.
>>> image = sprite_sheet.create_sprite_labels_image()
>>> image.save('barbarian_bounding_boxes.png')
```


## Contact Information
- If you have any problems using this library, please use the contact below. <br/>
`Email: duy.phung@f4.intek.edu.vn` <br/>
`Phone: (+84) 934 611 103`