Skip to content

Instantly share code, notes, and snippets.

View nodir-malikov's full-sized avatar
:electron:
Coding...

Nodir Malikov nodir-malikov

:electron:
Coding...
View GitHub Profile
@kgantsov
kgantsov / large_file_server.py
Created April 14, 2017 11:18
Example of serving large files using aiohttp server without reading entire file into a memory
import asyncio
import os
from aiohttp import web
from aiohttp import streamer
@streamer
async def file_sender(writer, file_path=None):
"""
@nkhitrov
nkhitrov / logger.py
Last active July 3, 2024 03:12
Configure uvicorn logs with loguru for FastAPI
"""
WARNING: dont use loguru, use structlog
https://gist.github.com/nkhitrov/38adbb314f0d35371eba4ffb8f27078f
Configure handlers and formats for application loggers.
"""
import logging
import sys
from pprint import pformat