Comments (4)
It’s a heuristic used by the Python CSV library, which is imperfect as you have noticed. In the future I’ll expose a way to adjust the via an option.
from rich-cli.
Thanks! Do you know what about the input in this case gives CSV
the wrong idea, so that I can work around this?
from rich-cli.
Not sure. You could have a look at the source of the csv module.
from rich-cli.
FYI:
- csv.Sniffer.has_header:
def has_header(self, sample):
# Creates a dictionary of types of data in each column. If any
# column is of a single type (say, integers), *except* for the first
# row, then the first row is presumed to be labels. If the type
# can't be determined, it is assumed to be a string in which case
# the length of the string is the determining factor: if all of the
# rows except for the first are the same length, it's a header.
# Finally, a 'vote' is taken at the end for each column, adding or
# subtracting from the likelihood of the first row being a header.
- I spotted "lexter" @ https://github.com/Textualize/rich-cli/blob/main/src/rich_cli/__main__.py#L569
from rich-cli.
Related Issues (20)
- List of every supported filename extensions HOT 2
- Feature request: support setting `--hyperlinks` via the `RICH_HYPERLINKS` environment variable HOT 3
- --width / --max-width in SVG export don't affect the width of the picture HOT 1
- head / tail operations are slow on larger files
- Provide help for pager
- No lexer fo csv HOT 4
- Multiple emoji encoding issues on Windows HOT 3
- Is it possible to format outputs of commands executed? HOT 4
- feature request: pv equivalent progress bar (using --size) feature HOT 4
- Rich capturing mouse movements from stdin
- Rich as a drop-in replacement for "more"/"less" HOT 1
- Reused option name: -j is used for both JSON and emoji options HOT 2
- Unable to install latest textual and rich-cli together
- Align title to the left in markdown HOT 2
- Feature request: Allow tailing a CSV HOT 2
- `rich --print` always adds an extra newline
- How to set background color inside strings should be documented better HOT 1
- Exposing Text.from_ansi in rich-cli HOT 1
- Feature request: horizontal padding HOT 1
- please detect encoding before opening a file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rich-cli.