No project description provided
Project description
sparrow_tool
Install
pip install sparrow-tool
# Or dev version
pip install sparrow-tool[dev]
# Or
pip install -e .
# Or
pip install -e .[dev]
Usage
Safe logger in multiprocessing
from sparrow.log import Logger
import numpy as np
logger = Logger(name='train-log', log_dir='./logs', )
logger.info("hello","numpy:",np.arange(10))
logger2 = Logger.get_logger('train-log')
print(id(logger2) == id(logger))
>>> True
Multiprocessing SyncManager
Open server first:
$ spr start-server
The defualt port 50001
.
(Process1) productor:
from sparrow.multiprocess.client import Client
client = Client(port=50001)
client.update_dict({'a': 1, 'b': 2})
(Process2) consumer:
from sparrow.multiprocess.client import Client
client = Client(port=50001)
print(client.get_dict_data())
>>> {'a': 1, 'b': 2}
Common tools
-
Kill process by port
$ spr kill {port}
-
pack & unpack
support archive format: "zip", "tar", "gztar", "bztar", or "xztar".$ spr pack pack_dir
$ spr unpack filename extract_dir
Vector Database && Search
Milvus
- start
$ spr milvus start
- stop
$ spr milvus stop
- remove database
$ spr milvus rm
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
sparrow_tool-0.8.7.tar.gz
(4.7 MB
view details)
Built Distribution
File details
Details for the file sparrow_tool-0.8.7.tar.gz
.
File metadata
- Download URL: sparrow_tool-0.8.7.tar.gz
- Upload date:
- Size: 4.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea2e4e86402babdce1015bd45406d2129311427bdf9f206351d4ca951c41f8ee |
|
MD5 | 4b2221685aa984460edb978f3cb631a1 |
|
BLAKE2b-256 | fc60a045d5678cfd9259297faf80b2aa05499616cda571173356884ca894c112 |
File details
Details for the file sparrow_tool-0.8.7-py2.py3-none-any.whl
.
File metadata
- Download URL: sparrow_tool-0.8.7-py2.py3-none-any.whl
- Upload date:
- Size: 4.8 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eacf5f7920e2004c3dd0fcffd2f76eb8d74b0bbbaadb3c280888e1dd323a37e |
|
MD5 | 92291d2501576f3e196c76ff3b0c82c4 |
|
BLAKE2b-256 | c2cd8c71ee10efc97b2f61d98de69717a1fe2fedddee8ea537a880def88423ec |