Skip to main content

Render tree structure diagram using border on Excel.

Project description

pyxltree

エクセルのワークシートの境界線を使って、ツリー構造図を描画します

例1:ディレクトリー・パス

Output:

View

👆 わたしのWindows PCのCドライブの例です

Input:

Data

no,node0,node1,node2,node3,node4,node5,node6,node7,node8
1,C,Users,Muzudho,OneDrive,Documents,Tools,GitHub,,
2,C,Users,Muzudho,OneDrive,Documents,Tools,Shogidokoro,Engine,Lesserkai.exe
3,C,Users,Muzudho,OneDrive,Documents,Tools,Shogidokoro,Engine,Lesserkai_ja.txt
4,C,Users,Muzudho,OneDrive,Documents,Tools,Shogidokoro,Engine,public.bin
5,C,Users,Muzudho,OneDrive,Documents,Tools,Shogidokoro,ja,Shogidokoro.resources.dll
6,C,Users,Muzudho,OneDrive,Documents,Tools,Shogidokoro,Engine.xml,
7,C,Users,Muzudho,OneDrive,Documents,Tools,Shogidokoro,GameResult.xml,
8,C,Users,Muzudho,OneDrive,Documents,Tools,Shogidokoro,Shogidokoro.exe,
9,C,Users,Muzudho,OneDrive,Documents,Tools,Shogidokoro,Shogidokoro.xml,
10,C,Users,Muzudho,OneDrive,Documents,Tools,Shogidokoro,お読みください.txt,
11,C,Users,Muzudho,OneDrive,Documents,Tools,Shogidokoro.zip,,
12,C,Users,Muzudho,OneDrive,Documents,Tools,Visual Studio 2022,,
13,C,Users,Muzudho,OneDrive,Documents,Tools,Default.rdp,,

👆 さきほどの Output の図は、上図の CSV ファイルを読込ませると描いてくれます。
node 列は 0 から始まる連番で増やすことができます。常識的な長さにしてください

Script:

from xltree import WorkbookControl


def execute():

    # 出力先ワークブック指定
    wbc = WorkbookControl(target='./tests/temp/tree_drive.xlsx', mode='w')

    # ワークシート描画
    wbc.render_worksheet(target='Drive', based_on='./examples/data/tree_drive.csv')

    # 何かワークシートを1つ作成したあとで、最初から入っている 'Sheet' を削除
    wbc.remove_worksheet(target='Sheet')

    # 保存
    wbc.save_workbook()

👆 上記はスクリプトの記述例です

例2:しりとり

Output:

View

👆 しりとりというゲームの記録です。図(Diagram)の辺(Edge)にテキストを書くのはオプションです

Input:

Data

no,node0,edge1,node1,edge2,node2,edge3,node3,edge4,node4,edge5,node5,edge6,node6,edge7,node7,edge8,node8,edge9,node9
1,Word Chain Game,Ea,Eagle,E,Euler,R,Rex,$,ended with x,,,,,,,,,,
2,Word Chain Game,Eb,Ebony,Y,Yellow,W,Wood,D,Door,R,Rocket,T,Tax,$,ended with x,,,,
3,Word Chain Game,Ec,Eclair,R,Road,D,Dungeon,N,News,S,Sex,$,ended with x,,,,,,
4,Word Chain Game,Ed,Edelweiss,S,Sox,$,ended with x,,,,,,,,,,,,
7,Word Chain Game,En,English,Ha,Hand,Dog,Dog,G,Gorilla,A,Arm,M,Moon,N,Nice,$,adjective,,
6,Word Chain Game,En,English,Ha,Hand,Doo,Door,R,Ring,G,Grape,E,Egg,G,Golf,F,Fox,$,ended with x
5,Word Chain Game,En,English,Ha,Hand,Dr,Dragon,N,Nob,B,Box,$,ended with x,,,,,,
8,Word Chain Game,En,English,He,Hex,$,ended with x,,,,,,,,,,,,
9,Word Chain Game,En,English,Ho,Hook,Kit,Kitchen,N,Nickel,L,Lemon,N,Nickel,$,time up,,,,
10,Word Chain Game,En,English,Ho,Hook,Kin,King,G,Goal,L,Lemon,N,Nickel,L,Lemon,$,repetition,,

👆 edge 列は 1 から始まる連番で増やすことができます。 node 列より深い番号を付けても無視されます

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xltree-0.0.4.tar.gz (543.9 kB view details)

Uploaded Source

Built Distribution

xltree-0.0.4-py2.py3-none-any.whl (17.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file xltree-0.0.4.tar.gz.

File metadata

  • Download URL: xltree-0.0.4.tar.gz
  • Upload date:
  • Size: 543.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for xltree-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a176d7431fff6ec4fdbe599754b1bca42d0fbcb70db8bbeaf5260610a776628c
MD5 c35c3ef516b4169bdf0e0b653cabbd2a
BLAKE2b-256 a1fe48b99895b5b5be1f26af860c406de53d8024b5470593f7a914a590dc284b

See more details on using hashes here.

File details

Details for the file xltree-0.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: xltree-0.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for xltree-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d8237611611399de4d8d12482f15c60b8595204876e1140ce9112df131e57a5d
MD5 5626b729ef185c11e48e9575f56135e6
BLAKE2b-256 32d44db7e51dbc346bd7e076a31a12a82e6c4d5542f85fb63aed106f8537e540

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page