Skip to content

Commit

Permalink
make xlsx insxlsx unsxlsx - for seperate tabxlsx python module
Browse files Browse the repository at this point in the history
  • Loading branch information
gdraheim committed Jul 30, 2024
1 parent c212d51 commit 3345a9c
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
28 changes: 26 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,31 @@ clean:

############## https://pypi.org/...

TAB=tabxlsx.tmp
xlsx tabxlsx:
test ! -d $(TAB) || rm -rf $(TAB)
mkdir -v $(TAB)
$(MAKE) $(TAB)/setup.py
cd $(TAB) && $(PYTHON3) setup.py sdist
cd $(TAB) && $(TWINE) check dist/*
@echo "(cd $(TAB) && $(TWINE) upload dist/*)"
tabxlsx.tmp/setup.py: setup.tabxlsx.cfg tabxlsx.py tabxlsx.md tabxlsx.tests.py LICENSE Makefile
cp -v setup.tabxlsx.cfg $(dir $@)/setup.cfg
cp -v tabxlsx.py $(dir $@)/
cp -v tabxlsx.md $(dir $@)/
cp -v tabxlsx.tests.py $(dir $@)/
cp -v LICENSE $(dir $@)/tabxlsx.txt
{ echo '#!/usr/bin/env python3' \
; echo 'import setuptools' \
; echo 'setuptools.setup()' ; } > $@
chmod +x $@
insxlsx:
$(MAKE) $(TAB)/setup.py
cd $(TAB) && $(PYTHON3) -m pip install --no-compile --user .
$(MAKE) showxlsx
showxlsx: ; $(PYTHON3) -m pip show -f $$(sed -e '/^name *=/!d' -e 's/.*= *//' setup.tabxlsx.cfg)
unsxlsx: ; $(PYTHON3) -m pip uninstall -vv --yes $$(sed -e '/^name *=/!d' -e 's/.*= *//' setup.tabxlsx.cfg)

README: README.md Makefile
cat README.md | sed -e "/\\/badge/d" -e /^---/q > README
setup.py: Makefile
Expand All @@ -180,8 +205,7 @@ ins install:
$(PYTHON3) -m pip install --no-compile --user .
rm -v setup.py
$(MAKE) show | sed -e "s|[.][.]/[.][.]/[.][.]/bin|$$HOME/.local/bin|"
show:
python3 -m pip show -f $$(sed -e '/^name *=/!d' -e 's/.*= *//' setup.cfg)
show:; $(PYTHON3) -m pip show -f $$(sed -e '/^name *=/!d' -e 's/.*= *//' setup.cfg)
uns uninstall: setup.py
$(MAKE) setup.py
$(PYTHON3) -m pip uninstall -v --yes $$(sed -e '/^name *=/!d' -e 's/.*= *//' setup.cfg)
Expand Down
28 changes: 28 additions & 0 deletions setup.tabxlsx.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# __version__

[metadata]
name = tabxlsx
version = 1.0.3283
license = APL
license_files =
tabxlsx.txt
author = Guido U. Draheim
author-email = [email protected]
home-page = https://github.com/gdraheim/timetrack-odoo
description = tabXLSX reads and writes simple Excel xlsx files. It does not depend on other libraries.
long-description = file: tabxlsx.md
long-description-content-type = text/markdown
requires-dist = setuptools

[options]
include_package_data=True
scripts =
tabxlsx.py

[options.data_files]
data =
tabxlsx.txt
tabxlsx.md

[bdist_wheel]
universal = 1
10 changes: 10 additions & 0 deletions tabxlsx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

## TABXLSX - minimal Excel support

TabXLSX reads and writes Excel xlsx files. It does not depend on other libraries.The output defaults to a markdown table and csv-like output
is available as well. This allows piping the data into other scripts.

A number of output format options are available but less than the tabtotext.py module. The export to xlsx was orginally written with
openpyx1 for tabtotext but it is possible to write simple tables
just with Python's zip and xml.etree builtin modules. That is also
faster.

0 comments on commit 3345a9c

Please sign in to comment.