
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
The tables have termed.
termtables is a lightweight Python 3 package for pretty-printing tables on the command line. Install with
pip install termtables
The code
import termtables as tt
import numpy
numpy.random.seed(0)
data = numpy.random.rand(5, 2)
tt.print(data)
# tt.to_string(data) returns the string
produces
You can control border style, padding, alignment, and various other attributes. For example,
import termtables as tt
header = ["a", "bb", "ccc"]
data = [
[1, 2, 3], [613.23236243236, 613.23236243236, 613.23236243236]
]
tt.print(
data,
header=header,
style=tt.styles.markdown,
padding=(0, 1),
alignment="lcr"
)
produces
| a | bb | ccc |
|-----------------|-----------------|-----------------|
| 1 | 2 | 3 |
| 613.23236243236 | 613.23236243236 | 613.23236243236 |
which is useful for copy-pasting into websites that support Markdown (like GitHub).
See
test/test_termtables.py
for more examples.
If the styles in termtables.styles
thin
thin_thick
thin_double
rounded
rounded_thick
rounded_double
thick
thick_thin
double
double_thin
booktabs
ascii_thin
ascii_thin_double
ascii_double
ascii_double_thin
ascii_booktabs
markdown
aren't good enough for you, simply provide your own style as a string of length 11 or 15 (the extra 4 including header-separating characters). For example
import termtables as tt
header = ["a", "bb", "ccc"]
data = [
[1, 2, 3], [613.23236243236, 613.23236243236, 613.23236243236]
]
tt.print(
data,
header=header,
style="x0123456789abcd"
)
produces
1xxxxxxxxxxxxxxxxx7xxxxxxxxxxxxxxxxx7xxxxxxxxxxxxxxxxx2
0 a 0 bb 0 ccc 0
abbbbbbbbbbbbbbbbbcbbbbbbbbbbbbbbbbbcbbbbbbbbbbbbbbbbbd
0 1 0 2 0 3 0
5xxxxxxxxxxxxxxxxx9xxxxxxxxxxxxxxxxx9xxxxxxxxxxxxxxxxx6
0 613.23236243236 0 613.23236243236 0 613.23236243236 0
3xxxxxxxxxxxxxxxxx8xxxxxxxxxxxxxxxxx8xxxxxxxxxxxxxxxxx4
To run the termtables unit tests, check out this repository and type
tox
This software is published under the GPL-3.0 license.
FAQs
Pretty tables in the terminal
We found that termtables demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.