semvec/pypi-packages huggingface dataset:
argparse-logging 2020.11.26
This is a simple library to configure logging from command line argument when using argparse.
Requires Python: >=3.6

# Argparse_logging

This is a simple library to configure logging from command line argument when using argparse.

Without `argparse_logging`:
```
from argparse import ArgumentParser

parser = ArgumentParser()
parser.add_argument(
    "--log-level",
    default=logging.INFO,
    type=lambda x: getattr(logging, x)),
    help="Configure the logging level.",
)
args = parser.parse_args()
logging.basicConfig(level=args.log_level)
```

This is a bit annoying to copy paste in every program.

Instead you can use argparse_logging to get the following:
```
from argparse import ArgumentParser
from argparse_logging import add_log_level_argument

parser = ArgumentParser()
add_log_level_argument(parser)
args = parser.parse_args()
```

# Deployment

You will need `git`, `pipenv`, `python`, `pre-commit`. Then you can set up your virtual environment:

```
$ git clone git@github.com:nanassito/argparse_logging.git
$ cd argparse_logging
$ pipenv update --dev
```

Do whatever changes you want. You can run the tests and linting with:

```
$ pipenv run py.test
$ pre-commit
```
chino-io-scriba 0.0.0
Chino.io Scriba SDK Python
Keywords: Chino.io Scriba API

# chinoscriba
Chino.io :: Scriba Documentation: the Application Programming Interface

This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: v1
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

## Requirements.

Python 2.7 and 3.4+

## Installation & Usage

Install the generated package (see on top here or):

    pip install chinoscriba

## Getting Started

```python
import chinoscriba
from chinoscriba.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: Basic
configuration = chinoscriba.Configuration()
configuration.username = 'customer_id'
configuration.password = 'customer_key'

# create an instance of the API class
api_instance = chinoscriba.DefaultApi(chinoscriba.ApiClient(configuration))
limit = 56 # int | Number of results to return per page
offset = 0 # int | The initial index from which to return the results


# # Audit logs # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

# Create a new Log
body = chinoscriba.AuditLog() # AuditLog | 
try:
    api_response = api_instance.logs_create(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->logs_create: %s\n" % e)


# Create multiple Logs (bulk)
body = [chinoscriba.AuditLog()] # list[AuditLog] | 
try:
    api_response = api_instance.logs_multiple(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->logs_multiple: %s\n" % e)

try:
    # List all Logs
    api_response = api_instance.logs_list(limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->logs_list: %s\n" % e)

try:
    # Search by query
    api_response = api_instance.logs_search(body, limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->logs_search: %s\n" % e)

try:
    # Retrieve customer statistics
    api_response = api_instance.stats_read()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->stats_read: %s\n" % e)


# # Exporter # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

try:
    # List exportable Blocks
    api_response = api_instance.exported_list(limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->exported_list: %s\n" % e)


# Export a Block
block_id = "" # string | ID of the Block to download
try:
    api_instance.exported_read(block_id)
except ApiException as e:
    print("Exception when calling DefaultApi->exported_read: %s\n" % e)

```
teleshell 0.0.6
A shell for telethon

# teleshell
Install:

```
pip install teleshell
```

Quick start:
```python
import teleshell
from telethon import TelegramClient, Button


users = []

async def message_first(event):
    users.append(event.chat_id)
    return event.chat_id


async def inline_first(event):
    users.append(event.query.user_id)
    return event.query.user_id

client = TelegramClient('bot', api_id, 'api_hash').start(bot_token='token')
shell = teleshell.ClientShell(client=client, message_first=message_first, inline_first=inline_first)
handle = shell.handle
inline = shell.inline
button = shell.button


@handle(command='start')
async def func(event, first=None):
    await event.reply('Started!')


@handle(command='help', first=None)
async def func(event, first=None):
    await event.reply('Help!')


@handle(text=r'he(l)+o', regular=True, lower=True)
async def func(event, first=None):
    await event.reply('Hello!')


@handle(command='buttons')
async def func(event, first=None):
    keyboard = [
        [
            Button.inline("First option", b"1"),
            Button.inline("Second option", b"2")
        ]
    ]

    await event.reply('OK!', buttons=keyboard)


@inline(command='smth', lower=True)
async def func(event, first=None):
    await client.send_message(event.query.user_id, 'Smth to!')


@button(text=b'1')
async def func(event, first=None):
    await event.answer('hello')

client.run_until_disconnected()
```

Version: 0.0.2
ascii-magic-LEANDROBARONE 1.0.0
Converts pictures into ASCII art
Requires Python: >=3.5

# ASCII Magic

Python package that converts images into ASCII art. Requires colorama and PIL.

## Basic usage

```python
import ascii_magic
output = ascii_magic.from_image_file('picture.jpg')
ascii_magic.to_terminal(output)
```

## Available functions

### from_image_file()

Converts an image file into ASCII art with terminal color codes.

```python
from_image_file(
    path:str,
    columns:int=120,
    width_ratio:float=2.5,
    char:str=None
) -> str
```

- path => a PIL-compatible file, such as picture.jpg
- columns (optional) => the number of characters per row, more columns = wider art
- pixel_width (optional) => ASCII characters are not square, so this adjusts the width to height ratio
- char (optional) => instead of using many different ASCII glyphs, you can use a single one, such as '#'

Example:

```python
ascii_art = ascii_magic.from_image_file('images/1.jpg', columns=100, width_ratio=2.6, char='@')
```

### from_image()

As above, but using an image loaded with Pillow.

```python
from_image(
    img:Image,
    # ... as above
) -> str
```

- img => PIL image

Example:

```python
from PIL import Image
img = Image.open('images/1.jpg')
ascii_art = ascii_magic.from_image_file(img, columns=100, width_ratio=2.6, char='@')
img.close()
```


### to_terminal()

Initializes colorama (which is required on Windows) and prints ASCII art to the terminal. It's the same as doing ```colorama.init()``` before printing normally.

```python
to_terminal(ascii_art:str) -> None
```

## Licence

Copyright Â©2020 Leandro Barone.

Usage is provided under the MIT License. See LICENSE for the full details.