Coder Social home page Coder Social logo

uga-libraries / sort-files Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 17 KB

Do a first pass at appraising files obtained through a web crawl by sorting based on keywords in the title and based on file extensions.

License: Creative Commons Attribution Share Alike 4.0 International

Python 100.00%

sort-files's Introduction

Sort Files

Repo Archived

This script is no longer in use, now that Archive-It is used to crawl state government websites. See Web Download for the current workflow for getting individual state government documents.

Purpose

Do a first pass at appraising files obtained through a web crawl by sorting into folders based on keywords in the title and based on file extensions.

Description

Python script that sorts files into folders to keep and don't keep based on keywords in the file title and based on the file extensions. Files are sorted into folders so that the user can verify the decisions before processing or deleting content.

The script was developed to work with the results of web crawls using the software HTTrack in order to obtain publications from those sites. Therefore, the script is based on the directory structure of HTTrack output:

Parent Folder 
    Website_Name (folder)
        Website_Name (folder)
            images (folder)
                files (these are the files to be sorted)
        hts-cache (folder)
            files
        cookies.txt
        hts-log.txt

The script creates folders "Keep" and "Don't Keep" within each images folder and then sorts the files within that images folder according to the rules.

Usage

Download the script to your computer and give it permission so it is executable.

Run the script with the command: python sort-files.py parentfolder

Where parentfolder is the folder which contains all the folders with files you want to sort.

Dependencies

Python 3

Initial Author

Adriane Hanson, Head of Digital Stewardship, 2018.

Acknowledgements

This script was developed and tested with the assistance of Sarah Causey, Map and Government Information Library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.