Skip to main content

pycomment Python package PyPi version Code style: black

Inserting repr value on comment with marker (marker is # =>). This is heavily inspired by xmpfilter of ruby's rocodetools.

install

$ pip install pycomment

how to use

code.py

import sys

print("stderr", file=sys.stderr)
print("hello")
1 + 2 + 3 + 3 + 4 + 5  # =>
1 + 2 + 3 + 3 + 4 + 5  # =>
print("bye")
$ pycomment --inplace code.py
import sys

print("stderr", file=sys.stderr)
print("hello")
1 + 2 + 3 + 3 + 4 + 5  # => 18
1 + 2 + 3 + 3 + 4 + 5  # => 18
print("bye")


# -- stdout --------------------
# >> hello
# >> bye

multi-line output

import numpy as np

np.arange(9).reshape((3, 3))  # => multi-line..
# array([[0, 1, 2],
#        [3, 4, 5],
#        [6, 7, 8]])
# ..multi-line

Release files for pycomment 0.2.0

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

Source distribution (sdist)

Source distribution for pycomment 0.2.0
File Size Uploaded
pycomment-0.2.0.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycomment 0.2.0
File Interpreter ABI Platform
pycomment-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size:22.2 kB

Release files / pycomment-0.2.0.tar.gz

Download URL pycomment-0.2.0.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
beeeecbc61eeadd89f20451591673a291aa7063be5be17b886960babd950e77e
BLAKE2b-256 checksum
How to use checksums
8682963ebc71fad2cc47be6bad7f281733db11ccbca65ea6f4164342a66d285c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / pycomment-0.2.0-py3-none-any.whl

Download URL pycomment-0.2.0-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2476c0be56adae578d63ef84c64757644ba3f7caa0e2b50a830704bbf2f56091
BLAKE2b-256 checksum
How to use checksums
e9becce49a7093087eaea80bcf309e4eee9e59b1b80f715d6cc182d78c8b1304
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

1 release file

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.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