Python Common Function Tool Set.
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:
$ sparrow start-server
This will start service at address 0.0.0.0:50001
.
(Process1) productor:
from sparrow.multiprocess.client import Client
client = Client()
client.update_data({'a': 1, 'b': 2})
(Process2) consumer:
from sparrow.multiprocess.client import Client
client = Client()
print(client.get_data())
>>> {'a': 1, 'b': 2}
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.6.3.tar.gz
(4.7 MB
view details)
Built Distribution
File details
Details for the file sparrow-tool-0.6.3.tar.gz
.
File metadata
- Download URL: sparrow-tool-0.6.3.tar.gz
- Upload date:
- Size: 4.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e3bd964ee1e78ea1fdd81b28d0ed64f2532825c12fcb9431ea9fbafb1c3dc26 |
|
MD5 | faeb378d9734670b7a167416379b87bc |
|
BLAKE2b-256 | 8292b753da62066ea7d9be322b5ad675546c199fd3753d0902e73ad551fed62c |
File details
Details for the file sparrow_tool-0.6.3-py3-none-any.whl
.
File metadata
- Download URL: sparrow_tool-0.6.3-py3-none-any.whl
- Upload date:
- Size: 9.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f11f6b48aa3ee3a4ecf61f64c8010cd8227a46ec85173ace508f0f1b19cba8b |
|
MD5 | 5f682aaa6f85a3473d6242bda4998ff0 |
|
BLAKE2b-256 | 500caed0438f8293a50b2e5d2e721c310135fc2c0826bd8565b57e0eba736b4b |