Skip to main content

Python toolkit for the mass management and analysis of files.

Project description

Archive Manager

Archive Manager is a Python tool designed to help users interact with and manage large archives of files efficiently. Whether you need to sort files, find duplicates, perform equality checks, or remove unnecessary files, this tool provides the necessary functionalities to streamline your file management tasks.

Core concepts and explanation:

  • Archyves are wrappers for built in generators that enable the user to loop through directories revursively.
  • To represent each item that the archyve finds, we have Entry objects - these are wrappers for Path objects that enable some useful features like hashing, sorting etc.

Features

  • Sorting: Organize your files based on various criteria such as file type, size, date modified, etc.
  • Duplicate Finding: Identify and manage duplicate files to free up storage space.
  • Equality Checking: Compare files to ensure they are identical or different.
  • Removal Tools: Safely remove unwanted files from your archives.

Installation

pip install archyve

Examples

Below are some examples of how to use archyve.

  1. Find duplicates in a large library of images:

    from archyve import Archyve, Entry
    
    # Create an archyve
    archyve: Archyve = Archyve(r"<put your path(s) here>")
    
    # Get a list of all the duplicate images and videos
    archyve = archyve.images + archyve.videos
    duplicate_lists: list[list[Entry]] = archyve.duplicates()
    
    # Sort the duplicates by age
    for i in range(len(duplicate_lists)):
        duplicate_lists[i] = sorted(duplicate_lists[i], key=lambda e: e.created)
    
    # Delete the ones that are not the oldest
    delete: list[list[Entry]] = [duplicate_list[1:] for duplicate_list in duplicate_lists]
    for entry_list in delete:
        archyve.delete(entry_list)
    
  2. Get a list of all non-text files recursively in a given directory:

    from archyve import Archyve, EntryType
    
    # Create an archyve
    archyve: Archyve = Archyve(r"p1", r"p2")
    
    # Filter the archyve entries on whatever you need
    archyve = archyve.filter(lambda e: not e.is_type(EntryType.TEXT))
    
    # Loop through the archyve and print the entries
    for entry in archyve:
       print(entry)
    

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

archyve-0.2.5.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

archyve-0.2.5-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file archyve-0.2.5.tar.gz.

File metadata

  • Download URL: archyve-0.2.5.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/11

File hashes

Hashes for archyve-0.2.5.tar.gz
Algorithm Hash digest
SHA256 cdc218d52ca4593b8d993d6252215e18b3a3fc5f8f0716e4fcecc469a9fa64ee
MD5 b64548b644e605d475220a4e4858f28f
BLAKE2b-256 4dfce8ae5918866dd5841ad70cc8abece03a93605353045e3ab972fd5713b3e6

See more details on using hashes here.

File details

Details for the file archyve-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: archyve-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/11

File hashes

Hashes for archyve-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ec5ed4a54788522c191d43e9e566f3d9672fb2095862087d71b7ce5c7d3bba5e
MD5 5602492818d9a8f446ccf40cec7e8047
BLAKE2b-256 30d39a0752b5eefee57de7a25cebbf8d527a9cee07126d74db4f5b73cbb72bc0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page