Skip to main content

Minimal server implementation for package search-me

Project description

SEARCH-ME-SERVER

PayPal

Version License Python Status Format Downloads


ASYNC SEARCH-ME-SERVER

PRE-INSTALLING

Look the page of search-me

INSTALLING

pip install search-me-server

SERVER

import logging
from search_me import Google
from search_me_server import SearchMeServer


logging.basicConfig(level=logging.DEBUG)


server = SearchMeServer(
    log=True,
    log_options={
        'file': 'main.log',
        'size': 100000000,
        'format': '%(asctime)s	|	%(levelname)s	|	%(message)s',
        'buffer': 16384
        },
    server={
        'host': '127.0.0.1',
        'port': 8080,
        'api': '/',
        'log_format': '%t	|	%s	|	%a	|	%Tf'
        },
    engine=Google(
        **{
            "app": {
                "interactive": False
                },
            "web": {},
            "pdf": {},
            "social": {}
        }
    )
    )
# Logs enable on http://127.0.0.1:8080/logs
# server = SearchMeServer()
server.run()

CLIENT

import asyncio
import aiohttp


async def main(server, q):
    async with aiohttp.ClientSession() as session:
        async with session.post(f"{server}?q={q}") as resp:
            async for data, chunk in resp.content.iter_chunks():
                if chunk:
                    print(data)


SERVER_URL = "http://127.0.0.1:8080/"
Q = "0X0007EE"

loop = asyncio.get_event_loop()
loop.run_until_complete(main(
    server=SERVER_URL,
    q=Q
    ))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

search-me-server-1.0.1.post0.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

search_me_server-1.0.1.post0-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page