Skip to main content

Delphi Python Utilities

This package provides various utilities used by the Delphi group at Carnegie Mellon University for its data pipelines and analyses.

Submodules:

  • archive: Diffing and archiving CSV files.
  • export: DataFrame to CSV export.
  • geomap: Mappings between geographic resolutions.
  • logger: Structured JSON logger.
  • nancodes: Enum constants encoding not-a-number cases.
  • runner: Orchestrator for running an indicator pipeline.
  • signal: Indicator (signal) naming.
  • slack_notifier: Slack notification integration.
  • smooth: Data smoothing functions.
  • utils: JSON parameter interactions.
  • validator: Data sanity checks and anomaly detection.

Source code can be found here: https://github.com/cmu-delphi/covidcast-indicators/

Logger Usage

To make our structured logging as useful as it can be, particularly within the context of how we use logs in Elastic, the event argument (typically the first unnamed arg) should be a static string (to make filtering easier), and each dynamic/varying value should be specified in an individual meaningfully- and consistently-named argument to the logger call (for use in filtering, thresholding, grouping, visualization, etc).

Commonly used argument names:

  • data_source
  • geo_type
  • signal
  • issue_date
  • filename

Single-thread usage.

from delphi_utils.logger import get_structured_logger

logger = get_structured_logger('my_logger')
logger.info('Hello', name='World')

Multi-thread usage.

from delphi_utils.logger import get_structured_logger, pool_and_threadedlogger

def f(x, threaded_logger):
    threaded_logger.info(f'x={x}')
    return x*x

logger = get_structured_logger('my_logger')
logger.info('Hello, world!')
with pool_and_threadedlogger(logger, n_cpu) as (pool, threaded_logger):
    for i in range(10):
        pool.apply_async(f, args=(i, threaded_logger))

Metadata

Release files for delphi-utils 0.3.27

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for delphi-utils 0.3.27
File Size Uploaded
delphi_utils-0.3.27.tar.gz 80.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for delphi-utils 0.3.27
File Interpreter ABI Platform
delphi_utils-0.3.27-py3-none-any.whl Python 3 none any Details

Total release size: 84.8 MB

Release files / delphi_utils-0.3.27.tar.gz

Download URL delphi_utils-0.3.27.tar.gz
Size 80.6 MB
Tags Source
SHA-256 checksum
How to use checksums
f68e6977dadfd8b003dfe597cfaf554796e67b950dadae50cc68d664b02ecc42
BLAKE2b-256 checksum
How to use checksums
8d9268ff6e7bfbfdce196fd93ed7f6b2630ddadc3cdb83887731a50d0c4ad250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / delphi_utils-0.3.27-py3-none-any.whl

Download URL delphi_utils-0.3.27-py3-none-any.whl
Size 4.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b7e6261c8a8e0a31a6ff9a4668126b2415f1650909955b0ec25a2621725c2cb8
BLAKE2b-256 checksum
How to use checksums
4f281f62e241c921afe68107870b5fdd26b2e18b53408ccdca994736322fb9c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.3.27 This release

2 release files

0.3.26

2 release files

0.3.24

2 release files

0.3.23

2 release files

0.3.22

2 release files

0.3.20

2 release files

0.3.19

2 release files

0.3.18

2 release files

0.3.17

2 release files

0.3.15

2 release files

0.3.14

2 release files

0.3.13

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.17

2 release files

0.1.13

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page