Git Product home page Git Product logo

htmltab's Introduction

HTMLTab

Results from latest push build Code coverage report

HTMLTab is a command-line utility to select a table within an HTML document and convert it to CSV. Here we can get the foreign-born population of Edinburgh from Wikipedia:

$ htmltab --select p+table.wikitable.plainrowheaders https://en.wikipedia.org/wiki/Edinburgh
Place of birth,Estimated resident population (2011)[117]
Poland,11651
India,4888
Ireland,4743
Mainland China [A],4188
United States,3700
Germany,3500
Pakistan,2472
Australia,2100
France,2000
Spain,2000
South Africa,1800
Canada,1800
Hong Kong,1600

For further details on installation and usage, see HTMLTab's online documentation. If you find a bug or have a feature request, please create an issue.

htmltab's People

Contributors

dependabot[bot] avatar flother avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

pallih cbluth luisbl

htmltab's Issues

Error when running cli.py

When I run cli.py, I get the following error:

$ python cli.py
Traceback (most recent call last):
  File "cli.py", line 6, in <module>
    import csv
  File "/usr/lib/python3.8/csv.py", line 6, in <module>
    import re
  File "/usr/lib/python3.8/re.py", line 122, in <module>
    import enum
  File "/usr/lib/python3.8/enum.py", line 2, in <module>
    from types import MappingProxyType, DynamicClassAttribute
  File "[path to types.py]", line 1, in <module>
    from click.types import ParamType
  File "$HOME/.local/lib/python3.8/site-packages/click/__init__.py", line 7, in <module>
    from .core import Argument
  File "$HOME/.local/lib/python3.8/site-packages/click/core.py", line 2, in <module>
    import inspect
  File "/usr/lib/python3.8/inspect.py", line 35, in <module>
    import dis
  File "/usr/lib/python3.8/dis.py", line 16, in <module>
    _have_code = (types.MethodType, types.FunctionType, types.CodeType,
AttributeError: partially initialized module 'types' has no attribute 'MethodType' (most likely due to a circular import)

Request: compare lines within two CSV files, difference in new CSV

Hello,

First of all, great work!

I have a feature request (maybe not really in the scope of your project?). Compare two outputs (CSV files) and print lines that differ in a new CSV file. Reason is, I pull a table from an URL, table consists of approximately 2000 lines. Each day a line can be added, but now I have to check the complete file/lines again, to check the differences.

Hope this is clear, otherwise please ask.

Many thanks and keep up the good work.

UTF-8

Hi, there are any ways to use coding UTF-8 while save to file?

About the example provided with the word "Form"

Hello,
I'm a student of Python and I'm confuse about the example provided in the basic functions of htmltab. The example says: "HTMLTab is useful in combination with other tools. We can use the standard Unix tool head to show only the top six teams and format the table with xsv, removing the wordy β€œForm” column in the process,"
Why does this word has to be extracted and why is relevant to do this?
Thanks!

ModuleNotFoundError after installing using pipx

I followed the installation instructions using pipx:

pipx install git+https://github.com/flother/htmltab#egg=htmltab

It claims to have installed htmltab. However, when I run the command:

$ htmltab 
Traceback (most recent call last):
  File "/home/ryan/.local/bin/htmltab", line 5, in <module>
    from htmltab.cli import main
ModuleNotFoundError: No module named 'htmltab'

Looking in the virtualenv that pipx created, there is no htmltab module installed:

$ find ~/.local/pipx/venvs/htmltab/ -iname  '*htmltab*'
/home/ryan/.local/pipx/venvs/htmltab
/home/ryan/.local/pipx/venvs/htmltab/bin/htmltab
/home/ryan/.local/pipx/venvs/htmltab/lib/python3.9/site-packages/htmltab-0.1.1.dev4+g45b62c4.dist-info

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.