Skip to main content

Python Common Function Tool Set.

Project description

sparrow_tool

image image image image


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.5.9.tar.gz (4.7 MB view details)

Uploaded Source

Built Distribution

sparrow_tool-0.5.9-py3-none-any.whl (9.5 MB view details)

Uploaded Python 3

File details

Details for the file sparrow-tool-0.5.9.tar.gz.

File metadata

  • Download URL: sparrow-tool-0.5.9.tar.gz
  • Upload date:
  • Size: 4.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for sparrow-tool-0.5.9.tar.gz
Algorithm Hash digest
SHA256 f689d7ef39077723f1efb2d8b1bc7252650801cd99e143fa63d9ba9ddd243ef6
MD5 84cca5f171092a80e4dcd57a9c894412
BLAKE2b-256 63571e88042befdad44a592ade2e61191be5329cd08a5fe70e2917dabcd89dc1

See more details on using hashes here.

File details

Details for the file sparrow_tool-0.5.9-py3-none-any.whl.

File metadata

File hashes

Hashes for sparrow_tool-0.5.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1518f32385e432b33f36d7d242ec65908408a9c3021615af528b2f9736ba137d
MD5 86357c93d8719416cf0681a7435bd6d1
BLAKE2b-256 ef009270e9b7cfe19e10ec1ec09ce8681e51a5c99b5b83abf7bcffff743d61d8

See more details on using hashes here.

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