Skip to content
Snippets Groups Projects
Commit 12bedaf9 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Merge branch 'ktools' into 'master'

Ktools

See merge request !2
parents 9ea6d2f2 4ddcafbd
No related branches found
Tags v0.5.0
1 merge request!2Ktools
Pipeline #7526 passed with warnings
#!/usr/bin/env python
# coding=utf-8
# Filename: kprinttree.py
# Author: Tamas Gal <tgal@km3net.de>
"""
Print the available ROOT trees.
Usage:
kprinttree.py FILENAME
kprinttree.py (-h | --help)
Options:
-h --help Show this screen.
"""
import uproot
def print_tree(filename):
f = uproot.open(filename)
for key, ttree in f.items():
try:
print("{} : {}".format(key.decode(), len(ttree)))
except TypeError:
print("{}".format(key.decode()))
def main():
from docopt import docopt
args = docopt(__doc__)
print_tree(args['FILENAME'])
if __name__ == '__main__':
main()
...@@ -32,6 +32,11 @@ setup( ...@@ -32,6 +32,11 @@ setup(
}, },
install_requires=requirements, install_requires=requirements,
python_requires='>=3.5', python_requires='>=3.5',
entry_points={
'console_scripts': [
'KPrintTree=km3io.utils.kprinttree:main'
]
},
classifiers=[ classifiers=[
'Intended Audience :: Developers', 'Intended Audience :: Developers',
'Intended Audience :: Science/Research', 'Intended Audience :: Science/Research',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment