Open source library with useful utils for fast development
Project description
hexfrost-toolbox
Open source library with useful utils for fast development
Installation
pip install hexfrost-toolbox
Usage
Create async generator from list
from toolbox import create_async_generator
async def main():
urls = ['https://example.com', 'https://example2.com']
async_iterable = create_async_generator(urls)
async for url in async_iterable:
await do_something(url)
Create async function from sync function
from toolbox import sync_to_async
def some_blocking_function():
return 'Hello, World!'
async def main():
async_function = sync_to_async(some_blocking_function)
result = await async_function()
print(result)
Create sync function from async function
from toolbox import async_to_sync
async def some_async_function():
return 'Hello, World!'
def main():
sync_function = async_to_sync(some_async_function)
result = sync_function()
print(result)
That's it! Enjoy! 🚀
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hexfrost_toolbox-0.1.3.tar.gz.
File metadata
- Download URL: hexfrost_toolbox-0.1.3.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.12.8 Linux/6.8.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58fef46ddf621457ae16365be3066d3865dcd908c5e54d4a62dadb9bd178a2f9
|
|
| MD5 |
7326be73c1d22627bab0795de00f06e0
|
|
| BLAKE2b-256 |
21cf2fcb91f15258c49a366287e0d3f63f192893a931e082220e2af9e858e8cd
|
File details
Details for the file hexfrost_toolbox-0.1.3-py3-none-any.whl.
File metadata
- Download URL: hexfrost_toolbox-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.12.8 Linux/6.8.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
917542614064073229e916e04f9b12f723ff52ca93696430484371d69cb77d68
|
|
| MD5 |
56c1e3754f2eefc16cc183f8a8aac9c0
|
|
| BLAKE2b-256 |
fb8184a69502440a82bb90adfc54df87e8a7e9f79e003164e648e26ac603fed1
|