Skip to main content

Logging for pandas and more.

Project description

redquill

Build Status codecov

Logging for pandas and more.

Description

There are functions specifically to log pandas dataframes as well as functions to count up the total number of errors and warnings.

Dependencies

  • pandas: Tested on 0.20.3 and higher. May work for earlier versions.

Example

For this example, import both the customlogger and pandas.

import redquill as rq
import pandas as pd

Initialize the logger. Note, the logger always logs to the console by default. You may inrqude a log directory and the log file name, which will allow the logs to flow into a file as well.

log = rq.redquill()

The following will log any null values found in df.

df = pd.DataFrame({"A": [1, 2, None, 3],
                   "B": [4, 2, 2, 5]})
log.warn_null_values(df=df)

Console output.

2018-03-04 01:34:33,162 - 23512 - WARNING - test_redquill.test_warn_null_values - 
    A  B
2 NaN  2

The following will log any duplicates found in column B of df.

df = pd.DataFrame({"A": [1, 2, None, 3],
                   "B": [4, 2, 2, 5]})
log.warn_duplicate_values(df=df, subset="B", msg="Duplicates on B.")

Console output.

2018-03-04 02:29:41,419 - 31825 - WARNING - test_redquill.test_warn_duplicate_values - Duplicates on B.
     A  B
1  2.0  2
2  NaN  2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redquill-0.0.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redquill-0.0.0-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file redquill-0.0.0.tar.gz.

File metadata

  • Download URL: redquill-0.0.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.0

File hashes

Hashes for redquill-0.0.0.tar.gz
Algorithm Hash digest
SHA256 e05b8c5dc4ec0a01f757ca10492468ef3e4828e7faf2022ed171c81c43b59a4d
MD5 84497a26a7fe03acd34e867f7e037bba
BLAKE2b-256 00d4bb7800289a5a16e2ac76d3bae89e55768db797cf3f10c490fe9f3bf3214b

See more details on using hashes here.

File details

Details for the file redquill-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: redquill-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.0

File hashes

Hashes for redquill-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29e0f2793241234dcfce751b5bb8adf1205c5b953bb1976d632088822c966634
MD5 11341dbaa76e247b39849f72552159dd
BLAKE2b-256 46164bd2e3952c57288c83a2586672098ba4c6ebc4b3e425f164acf65afa5a75

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page