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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file sparrow_tool-0.8.2-py2.py3-none-any.whl
.
File metadata
- Download URL: sparrow_tool-0.8.2-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.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa9a1bd7e22e52a17e21a21cdb72458e69010b8941ec4e07a38426ed5cfa7372 |
|
MD5 | 587bbc08f1222ca0ea98a6b6ed451804 |
|
BLAKE2b-256 | 3874be506b51a65a29c83c0fd1881381e4edd4e5971a2fd4dc3dda21e5ea86f7 |