Skip to main content

A Python package to scan project directories and files batch by batch.

Project description

PyPI version License: MIT Downloads

Project Scanner

ProjectScanner is a Python package designed to scan your project's directory and file structure, providing a batch-wise navigational approach. It's especially useful for analyzing large projects with deep directory structures, allowing users to paginate through directories and files effectively.

Installation

To install ProjectScanner, use pip:

pip install project-scanner

Usage

As a Python Module

You can use ProjectScanner as a module in your Python scripts.

Example:

from projectscanner import ProjectScanner

# Initialize the scanner with the root directory of your project
scanner = ProjectScanner(root_dir="path/to/your/project", batch_size=10, max_length=255)

# Scan and print the first batch of items
print("First Batch:")
print(scanner.next_batch())

# Assuming there are more items, scan and print the next batch
print("Next Batch:")
print(scanner.next_batch())

# Go back to the previous batch and print it
print("Previous Batch:")
print(scanner.prev_batch())

Configuration

You can customize the behavior of ProjectScanner by adjusting the initialization parameters:

  • root_dir: The root directory of your project (default is the current working directory).
  • batch_size: The number of items (files or directories) to include in each batch (default is 10).
  • max_length: The maximum character length for file or directory names before truncation (default is 255).
  • relative_path: Set to True to use relative paths for items, or False for absolute paths (default is True).

Output Example

When you run ProjectScanner, it provides you a batch of directory and file names in your project's structure. Here is an example output:

First Batch:
["dir1", "dir2", "file1.txt", "file2.txt"]
Next Batch:
["dir3/subdir1", "dir3/subdir2", "file3.txt", "dir4"]
...

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check issues page.

License

MIT

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

project-scanner-0.1.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

project_scanner-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file project-scanner-0.1.1.tar.gz.

File metadata

  • Download URL: project-scanner-0.1.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.3

File hashes

Hashes for project-scanner-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8ccb084fa9fb3529d46450fd5e46042d1792a1a349ee6215905e0ffbf41f4895
MD5 5fb0762c48b22a154e886ee7437a810f
BLAKE2b-256 721ea0057acd0bb35b3c1fd1c92c583959849d0507a17187bb66254cbc5216b8

See more details on using hashes here.

File details

Details for the file project_scanner-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for project_scanner-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d964dbb0c4fd2eb740f606febc1c555f52eb88a3ee5583910a62b48683404de
MD5 1fed2acdd3303f76a486e34caeb6fb54
BLAKE2b-256 0d707c9e6f4d100992e8627160604d1583b7a6654da563c4a89a4b61fd6048dd

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