Skip to main content

Document Sorter

Document Sorter is a Python package that automatically organizes documents into folders based on their content similarity. It supports various file types including PDF, DOCX, XLSX, CSV, TXT, MD, and TEX.

Features

  • Searches for documents in a specified directory
  • Extracts text from various file types
  • Clusters documents based on content similarity using the elbow method
  • Allows users to specify the number of clusters
  • Supports custom keywords for folder names
  • Sorts documents into folders named after the most relevant keyword for each cluster or user-specified keywords
  • Supports dry run mode for testing
  • Provides verbose output option for detailed information during execution

Installation

You can install Document Sorter using pip:

pip install document-sorter

Usage

After installation, you can use the Document Sorter from the command line:

document-sorter [directory_path] [OPTIONS]

Options

  • directory_path: The directory to search for documents (default: current directory)
  • --dry-run: Perform a dry run without moving files
  • --verbose: Print detailed information during execution
  • --clusters N: Specify the number of clusters to use
  • --keywords KEYWORD1 KEYWORD2 ...: Specify custom keywords for folder names

Examples

  1. Basic usage (current directory):

    document-sorter
    
  2. Specify a directory with verbose output:

    document-sorter /path/to/documents --verbose
    
  3. Perform a dry run:

    document-sorter /path/to/documents --dry-run
    
  4. Specify the number of clusters:

    document-sorter /path/to/documents --clusters 5
    
  5. Use custom keywords:

    document-sorter /path/to/documents --keywords work personal projects research
    
  6. Combine options:

    document-sorter /path/to/documents --verbose --clusters 4 --keywords work personal projects research
    

Behavior

  • If neither --clusters nor --keywords are specified, the script will automatically determine the optimal number of clusters and generate keywords based on document content.
  • If --clusters is specified without --keywords, the script will use the specified number of clusters and generate keywords based on document content.
  • If --keywords is specified without --clusters, the script will automatically determine the optimal number of clusters and use the provided keywords for folder names.
  • If both --clusters and --keywords are specified, the script will use the specified number of clusters and the provided keywords for folder names.

Requirements

Document Sorter requires Python 3.6 or later. For a full list of dependencies, see the requirements.txt file.

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Metadata

Release files for document-sorter 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for document-sorter 0.1.0
File Size Uploaded Provenance Actions
document-sorter-0.1.0.tar.gz 5.5 kB Without provenance Details for document-sorter-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for document-sorter 0.1.0
File Interpreter ABI Platform Actions
document_sorter-0.1.0-py3-none-any.whl Python 3 none any Details for document_sorter-0.1.0-py3-none-any.whl

Total release size: 11.5 kB

Release files / document-sorter-0.1.0.tar.gz

Download URL document-sorter-0.1.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7c2cf9d1f529bc9bd9e1311787aa53881a697ca93d3338245b60c5e95e16b48b
BLAKE2b-256 checksum
How to use checksums
b08b03358e088cf7b8febdb1d843b02f8e7742daa09ad53b029b361f1f555c94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.8

Release files / document_sorter-0.1.0-py3-none-any.whl

Download URL document_sorter-0.1.0-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ef94bfa29ec56c3a5b872f2ad1e181070cb6860b780c41c2042f75b58c254b6
BLAKE2b-256 checksum
How to use checksums
58a9672e0885ab17bf786e4df2b919dd159e06e61df67622cff1b4b1d9334076
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.8

Security for document-sorter 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page