listupy
下の方に日本語の説明があります
Listupy Documentation
Introduction
Listupy is a command-line Python tool that allows you to recursively enumerate Python files within a directory, compute the total number of lines in those files, and consolidate the results into a single markdown file. The name "Listupy" is a portmanteau of "listup" and "python," and is pronounced as "list-a-pie."
Installation
To install Listupy, use the following pip command:
pip install listupy
Usage
You can use Listupy from the command line using the listupy command. Below is an example:
listupy -i /path/to/directory -o /path/to/output.md
The -i argument requires the directory path to be scanned. The -o argument, which is optional, is used to specify the output markdown file path. If the -o argument is not provided, the output will be saved as ./listup_result.md by default.
Code Explanation
Listupy is primarily composed of four functions: r_listup, line_n, listup, and console_command.
r_listup(dir_name)is a recursive function that lists all python files in a directory.line_n(file_ls)calculates the total number of lines from a list of files.listup(dir_name)lists all python files in a directory, computes the total line count, and generates a markdown-formatted string.console_command()handles command-line arguments and orchestrates the listup process.
Notes
- Ensure that the directory you're scanning doesn't contain large numbers of Python files, as this could significantly slow down the performance of Listupy.
Listupyドキュメンテーション
はじめに
Listupyはコマンドラインから利用できるPythonツールで、ディレクトリ内のPythonファイルを再帰的に列挙し、それらのファイルの行数の合計を計算し、結果を1つのmarkdownファイルにまとめます。"Listupy"という名前は"listup"と"python"の合成語で、「リストアッパイ」と読みます。
インストール
Listupyのインストールは以下のpipコマンドで行うことができます:
pip install listupy
使用方法
コマンドラインからlistupyコマンドを使ってListupyを使用できます。以下に使用例を示します:
listupy -i /path/to/directory -o /path/to/output.md
-i引数にはスキャンするディレクトリのパスを指定します。-o引数はオプションで、出力markdownファイルのパスを指定します。-o引数が指定されていない場合、出力はデフォルトで./listup_result.mdとして保存されます。
コードの説明
Listupyは主に4つの関数で構成されています:r_listup、line_n、listup、そしてconsole_command。
r_listup(dir_name)はディレクトリ内の全てのPythonファイルを列挙する再帰関数です。line_n(file_ls)はファイルのリストから行数の合計を計算します。listup(dir_name)はディレクトリ内の全てのPythonファイルを列挙し、行数の合計を計算し、markdown形式の文字列を生成します。console_command()はコマンドライン引数を処理し、リストアッププロセスを調整します。
注意点
- スキャンするディレクトリが大量のPythonファイルを含んでいないことを確認してください。大量のファイルがあるとListupyのパフォーマンスが大幅に低下する可能性があります。
Metadata
Release files for listupy 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| listupy-0.1.0.tar.gz | 4.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| listupy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.8 kB
Release files / listupy-0.1.0.tar.gz
| Download URL | listupy-0.1.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7f19ee0beb4473dde2494438e17fe6c365089830e097e12b0f22cfad63e757a
|
|
BLAKE2b-256 checksum How to use checksums |
b3827c53747b9ad42d7c2fe13ae6b5937ad2d3b49bb386534f8d62b289bf95e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.8.8
|
Release files / listupy-0.1.0-py3-none-any.whl
| Download URL | listupy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2cff847aceeaf7ab420fb23b56003d293ecb9274212d769f2c658d136982cedc
|
|
BLAKE2b-256 checksum How to use checksums |
b741a899e3f924b5f1edd0b3531027b332225d05a3669abb035a9defb8e745f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.8.8
|
Security for listupy 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.