Minimal server implementation for package search-me
Project description
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
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 search-me-server-1.0.1.post0.tar.gz.
File metadata
- Download URL: search-me-server-1.0.1.post0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.26.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
722b2ddd0f3604b7843cdc36825ee2a69a626bbd20b3b37159077cc10ae8e029
|
|
| MD5 |
ff2573fa8d0332ba5d11e6b0474fa189
|
|
| BLAKE2b-256 |
1c749305ef56bd2e84d8fafb5983bd72983b685702c9d81c873ccc66492c7167
|
File details
Details for the file search_me_server-1.0.1.post0-py3-none-any.whl.
File metadata
- Download URL: search_me_server-1.0.1.post0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.26.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9eb8785b6aa579ac723e99e87f114bdfd2d87ad22eeee9cf434fb2161d6df014
|
|
| MD5 |
44dd143d2675937ee4c590e52773cb09
|
|
| BLAKE2b-256 |
25fbdd07c0ded4ac4db458444d2593074d6338975c3f05a5eb1ed0ac67d2fe66
|