Vast
A utility to easily scale functionality
Table of Contents
Requirements
- Python3.6+
Installation
-
Create a new virtual environment with python 3.6+
- Install the aiovast library
$ git clone https://www.github.com/tannerburns/aiovast $ cd aiovast $ pip3 install .
Information
Details about the aiovast utility
Vast
Main variables
- loop: asyncio.new_event_loop
- max_async_pool: int, default=32
- max_futures_pool: int, default=10000
Vast Event Loop
Main method
- run_in_eventloop
- arg1: functionObject, Callable
- the function to run in the event loop
- arg2: listOfArgs, list
- the list of arguments to be mapped to the function in the event loop
- kwarg: report, default= False
- returns results and statistics about the event loop runtime
- kwarg: disable_progress_bar, default= False
- disables the progress bar from printing while the event loop runs
- kwarg: progress_bar_color, default= green
- provide another color for the progress bar template
- arg1: functionObject, Callable
VastSession
Variables
- loop: asyncio.new_event_loop
- max_async_pool: int, default=32
- max_futures_pool: int, default=10000
- self.session: requests.session
Vast Bulk Requests
A function that can handle any method requests will accept
- bulk_requests
- arg1: listOfCalls, list
- format: [ [[method: string, url: string], options: dictionary], [[method: string, url: string], options: dictionary], .. ]
- arg1: listOfCalls, list
Function calls for single method types
Vast Bulk Get
- bulk_get_requests
- arg1: listOfCalls, list
- format: [ [[url: string], options: dictionary], [[url: string], options: dictionary], .. ]
- arg1: listOfCalls, list
Vast Bulk Post
- bulk_post_requests
- arg1: listOfCalls, list
- format: [ [[url: string], options: dictionary], [[url: string], options: dictionary], .. ]
- arg1: listOfCalls, list
Vast Bulk Put
- bulk_put_requests
- arg1: listOfCalls, list
- format: [ [[url: string], options: dictionary], [[url: string], options: dictionary], .. ]
- arg1: listOfCalls, list
Vast Bulk Delete
- bulk_delete_requests
- arg1: listOfCalls, list
- format: [ [[url: string], options: dictionary], [[url: string], options: dictionary], .. ]
- arg1: listOfCalls, list
Vast Bulk Head
- bulk_head_requests
- arg1: listOfCalls, list
- format: [ [[url: string], options: dictionary], [[url: string], options: dictionary], .. ]
- arg1: listOfCalls, list
Examples
#Basic add example
def add(x, y): return x + y
if __name__ == '__main__':
rets = [add(x, y) for x in range(0, 5) for y in range(5, 10)]
#Example bulk add using aiovast class
from aiovast import Vast
def add(x, y): return x + y
if __name__ == '__main__':
aiovast = Vast()
args = [[[x, y]] for x in range(0, 5) for y in range(5, 10)]
rets = aiovast.run_in_eventloop(add, args)
#Example using Vast context manager
from aiovast import Vast
def add(x, y): return x + y
if __name__ == '__main__':
args = [[[x, y]] for x in range(0, 5) for y in range(5, 10)]
with Vast() as aiovast:
rets = aiovast.run_in_eventloop(add, args)
#Example bulk add using decorator
from aiovast.decorators import vast_loop
@aiovast_loop(max_async_pool=16)
def add_in_bulk(x, y):
return x+y
if __name__ == '__main__':
args = [[[x, y]] for x in range(0, 5) for y in range(5, 10)]
rets = add_in_bulk(args)
#Vast session for sending bulk requests
from aiovast.requests import VastSession
session = VastSession(max_async_pool=4)
calls = [
(['get', 'https://www.google.com'], {'headers': {'User-Agent':'custom'}}),
(['post', 'https://www.github.com'], )
]
responses = session.bulk_requests(calls)
Metadata
Release files for aiovast 4.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiovast-4.0.3.tar.gz | 6.0 kB | Without provenance | Details for aiovast-4.0.3.tar.gz |
Release files / aiovast-4.0.3.tar.gz
| Download URL | aiovast-4.0.3.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55c7fd2c61ac78f3b352dc028f12af30faecca267f7af6ef74596732474f7d95
|
|
BLAKE2b-256 checksum How to use checksums |
a88125e630193ae806f7e99a94fdd67b033b0a4b227f92e897ddc1c7f45d3666
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4
|
Security for aiovast 4.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.