Skip to main content

This script moves items (files or directories) containing ISO datestamps like "YYYY-MM-DD" into a directory stucture for the corresponding year.

You define the base directory either in this script (or using the command line argument "--archivedir"). The convention is e.g.:

  • /2009
  • /2010
  • /2011

By default, this script extracts the year from the datestamp of each file and moves it into the corresponding directory for its year:

 m2a 2010-01-01_Jan2010.txt 2011-02-02_Feb2011.txt

... moves "2010-01-01_Jan2010.txt" to "/2010/" ... moves "2011-02-02_Feb2011.txt" to "/2011/"

OPTIONALLY you can define a sub-directory name with option "-d DIR". If it contains no datestamp by itself, a datestamp from the first file of the argument list will be used. This datestamp will be put in front of the name:

 m2a  -d "2009-02-15 bar"  one two three

... moves all items to: "/2009/2009-02-15 bar/"

 m2a  -d bar  2011-10-10_one 2008-01-02_two 2011-10-12_three

... moves all items to: "/2011/2011-10-10 bar/"

If you feel uncomfortable you can simulate the behavior using the "--dryrun" option. You see what would happen without changing anything at all.

Metadata

Release files for move2archive 2023.7.15.1

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

Built distribution (wheel)

Table of built distributions (wheels) for move2archive 2023.7.15.1
File Interpreter ABI Platform
move2archive-2023.7.15.1-py3-none-any.whl Python 3 none any Details

Release files / move2archive-2023.7.15.1-py3-none-any.whl

Download URL move2archive-2023.7.15.1-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4625c21a0460278659b5001b5e09c88ae2d0012d5761be7752371299aea1b071
BLAKE2b-256 checksum
How to use checksums
4b67945c7cbf766d0cdcf083e9232a3f2c5b18d6079da86ea801f6cbfa35de37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2
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