Skip to main content

pdlog

pdlog provides logging for pandas dataframes, to better enable you to monitor and debug your data pipelines.

For example:

>>> import pdlog
>>> df = df.log.dropna()
2020-05-26 20:55:30,049 INFO <pdlog> dropna: dropped 1 row (17%), 5 rows remaining

Example

The above assumes that the logging module has been configured and that data has been loaded into a pandas DataFrame. Let's walk through those steps with a simple example.

  1. Configure logging:

    >>> import logging
    >>> fmt = "{asctime} {levelname} <{name}> {message}"
    >>> logging.basicConfig(format=fmt, style="{", level=logging.INFO)
    
  2. Load data into a pandas.DataFrame:

    >>> import pandas as pd
    >>> df = pd.DataFrame([0, 1, 2, None, 4])
    >>> df.head()
         0
    0  0.0
    1  1.0
    2  2.0
    3  NaN
    4  4.0
    
  3. Importing pdlog and call a method under the log accessor:

    >>> import pdlog
    >>> df = df.log.dropna()
    2020-05-26 20:55:30,049 INFO <pdlog> dropna: dropped 1 row (17%), 5 rows remaining
    

Supported methods

pdlog currently supports the following pandas.DataFrame methods:

  • Filter rows and select columns:
    • drop_duplicates
    • drop
    • dropna
    • head
    • query
    • sample
    • tail
  • (Re-)set indexes:
    • reset_index
    • set_index
  • Rename indexes:
    • rename
  • Reshape:
    • melt
    • pivot
  • Impute:
    • bfill
    • ffill
    • fillna

pandas-log

pandas-log is aimed at interactive usage. Its messages are friendlier and more verbose than pdlog aims to be. Ideally, each pdlog message should be a single line of dense information to help you understand whether your production code is doing what you think it is, while not overflowing your logs. These don't tend to make particularly friendly messages.

tidylog

pdlog can be considered a port of tidylog (R package) to pandas. Their goals align with ours, and we think they've done a great job at reaching those goals.

Metadata

Release files for pdlog 0.1.0.post0

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

Source distribution (sdist)

Source distribution for pdlog 0.1.0.post0
File Size Uploaded Provenance Actions
pdlog-0.1.0.post0.tar.gz 5.2 kB Without provenance Details for pdlog-0.1.0.post0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pdlog 0.1.0.post0
File Interpreter ABI Platform Actions
pdlog-0.1.0.post0-py3-none-any.whl Python 3 none any Details for pdlog-0.1.0.post0-py3-none-any.whl

Total release size: 11.0 kB

Release files / pdlog-0.1.0.post0.tar.gz

Download URL pdlog-0.1.0.post0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1d6fed8747b7bec2db733474e9bcd581ee2dcea451db5694ee1ae209a54b4f85
BLAKE2b-256 checksum
How to use checksums
86b474962acff6b9123614d47bb0ca128e68b63f6f9b5740261f9fd304b47c3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.5

Release files / pdlog-0.1.0.post0-py3-none-any.whl

Download URL pdlog-0.1.0.post0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f776376c585ed107c8f21537ea7524235be3d864390f0a2f1511faabbac1360
BLAKE2b-256 checksum
How to use checksums
de72a29edfb1c2034f54b5f749e3a06defe4e7090597613665fb4a8406299c19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.5

Security for pdlog 0.1.0.post0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0.post0 This release

2 release files No provenance

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