Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
A simple package to walk a directory tree and collect files and sizes into a SQLite DB.
A simple package to walk a directory tree and collect files and sizes into a SQLite DB.
For simple (and most) use cases, simply install the package from PyPI:
pip install treewalker
And run it from the command line:
treewalker --help
treewalker --db test.sqlite --walk C:/temp
This is the preferred and recommended way to run Treewalker.
Get started (change directory to where you want the project first):
pip install treewalker
Run the script with your own .json configuration:
python treewalker.py --cfg my_config.json
{
"database": "test.sqlite",
"walk": "c:/temp"
}
Or run the script entirely from the command line:
python treewalker.py --db test.sqlite --walk c:\temp
Or build a single file executable if you need this to run on Windows systems that won't have Python pre-installed:
scripts/build_pyinstaller.bat c:/target/folder
scripts/build_pyinstaller_xp.bat c:/target/folder
This creates a treewalker.exe
, which can be run 'anywhere':
.\treewalker.exe --db test.sqlite --walk c:\temp
Note that the executable will be limited to running on systems that support the version of Python you're using to build it. I.e. for Windows XP (32-bit or 64-bit), the very latest version of Python you can use is 3.4.4.
You can easily access the contents of any of the sqlite files:
from sqlite3 import connect
conn = connect('test.sqlite')
c = conn.cursor()
# show all the root directories
print(c.execute('SELECT * FROM dirs WHERE parent_dir<0').fetchall())
# show all files that have "test" in their name (case-insensitive)
print(c.execute('SELECT * FROM files WHERE name LIKE "%test%"').fetchall())
Look at the documentation of the Python standard sqlite3 library for more examples. https://docs.python.org/3/library/sqlite3.html and at the documentation of Treewalker at https://treewalker.readthedocs.io
FAQs
A simple package to walk a directory tree and collect files and sizes into a SQLite DB.
We found that treewalker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.