semvec/pypi-packages huggingface dataset:
api-console-solver 0.0.27
Wrapper oficial da Plataforma Solver
License: MIT License
Keywords: console api

# Material de apoio

O primeiro passo Ã© ter o cÃ³digo de sua biblioteca separado em uma pasta

  

*   meu\_pacote/ # Pasta do projeto
    *   codigos\_da\_biblioteca/ # DiretÃ³rio onde deve ficar os cÃ³digos de sua biblioteca
    *   LICENCE # Um arquivo com a licenÃ§a da sua lib
    *   [README.MD](http://README.MD) # Uma descriÃ§Ã£o do projeto
    *   [setup.py](http://setup.py) # CÃ³digo Python responsÃ¡vel pelo empacotamento

  

Adicione uma licenÃ§a

```plain
The MIT License (MIT)

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```

  

Adicione um readme

```markdown
# Sua descriÃ§Ã£o aqui
```

  

Instale a lib setuptools

```plain
pip install setuptools
```

  

Crie o [setup.py](http://setup.py)

```plain
from setuptools import setup

with open("README.md", "r") as arq:
    readme = arq.read()

setup(name='wrapper-panda-video',
    version='0.0.1',
    license='MIT License',
    author='Caio Sampaio',
    long_description=readme,
    long_description_content_type="text/markdown",
    author_email='caio@pythonando.com.br',
    keywords='panda video',
    description=u'Wrapper nÃ£o oficial do Panda Video',
    packages=['panda_video'],
    install_requires=['requests'],)
```

  

Execute o comando

```plain
python setup.py sdist
```

  

Instale o twine para fazer o upload para o pypi

```plain
pip install twine
```

  

Crie uma conta no pypi

  

Execute o comando para criar um repositÃ³rio de teste

```plain
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
```

  

Ou para criar um repositÃ³rio oficial:

```plain
twine upload dist/*
```
blackbox-adversarial-toolbox 0.1.2
Black-box Adversarial Toolbox (BAT) - Python Library for Deep Learning Security
License: MIT License
Requires Python: >=3.6

<img src="https://bat.wuhanstudio.uk/images/bat.png" width=300px style="float: left;" >

# Black-box Adversarial Toolbox (BAT)

[![Build Status](https://app.travis-ci.com/wuhanstudio/blackbox-adversarial-toolbox.svg?branch=master)](https://app.travis-ci.com/wuhanstudio/blackbox-adversarial-toolbox)
[![PyPI version](https://badge.fury.io/py/blackbox-adversarial-toolbox.svg)](https://badge.fury.io/py/blackbox-adversarial-toolbox)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/blackbox-adversarial-toolbox)](https://pypi.org/project/blackbox-adversarial-toolbox/)
[![](https://img.shields.io/badge/Documentation-infromational)](https://bat.wuhanstudio.uk/)

A Python Library for Deep Learning Security that focuses on Distributed Black-box attacks.

## Installation

```python
pip install blackbox-adversarial-toolbox
```


## Usage (CLI)

```
Usage: bat [OPTIONS] COMMAND [ARGS]...

  The CLI tool for Black-box Adversarial Toolbox (BAT).

Options:
  --help  Show this message and exit.

Commands:
  api      Manage Cloud APIs
  attack   Manage Attacks
  example  Manage Examples
```
Useful commands:
```
# List supported Cloud APIs
$ bat api list

# List supported Attacks
$ bat attack list

# Test Cloud APIs
$ bat api run deepapi
$ bat api run google
$ bat api run imagga

# Run exmaples
$ bat example run simba_deepapi
$ bat example run bandits_deepapi
$ bat example run square_deepapi
```

## Usage (Python)

```python
import numpy as np
from PIL import Image

from bat.attacks import SimBA
from bat.apis.deepapi import DeepAPI_VGG16_Cifar10

# Load Image
x = np.asarray(Image.open("dog.jpg").convert('RGB'))
x = np.array([x])

# Initialize the Cloud API Model
DEEP_API_URL = 'http://localhost:8080'
model = DeepAPI_VGG16_Cifar10(DEEP_API_URL)

# Get Preditction
y_pred = model.predict(x)[0]

# Distributed SimBA Attack
simba = SimBA(model)
x_adv = simba.attack(x, np.argmax(y_pred), epsilon=0.05, max_it=10)
```