<commit_before>Migrater
========================

Summary
-------
Migrater is a Python module to sync up Point B (remote) with Point A (local) based on a list of actions. 

SFTP? FTP? Local? Migrater don't care (just give it the proper configuration).

Status: Works with local directories and SFTP.

Concepts
--------

### Properties
`Properties` is a configuration dictionary: 

	{
		"type": "sftp",										# one of local, sftp, or ftp
		"localroot":  "/full/path/to/local/root",			# "Point A" root
		"remoteroot": "/full/path/to/remote/root",			# "Point B" root
		### extra config for ftp/sftp
		"host": "<EMAIL>",							# required
		"port": 22											# optional (sftp: 22; ftp: ??)
		"password": "<PASSWORD>"								# optional (prompt or keychain)
	}

### Actions
`Actions` are based on the output of 

	$ git diff --name-status ...

For example:

	$ git diff --name-status HEAD HEAD^
	M       README.md
	A       dirfixtures.py
	A       migrate.py
	A       migrater.py
	D       migrater/__init__.py
	D       migrater/migrater.py
	D       migrater/sftp.py
	M       sites/site_id/properties.json
	A       test.py

This shows the *difference* between my last Git commit (`HEAD`) and the previous, (`HEAD^`). In my last commit, for example, I: 

* [A]dded dirfixtures.py
* [D]eleted migrater/sftp.py
* [M]odified README.md

Migrater can accept `actions` in a few ways:

1. Raw text: 

	"M README.md\nA dirfixtures.py\nD migrater/sftp.py"

2. Path to file:

	'~/actions.txt'

3. Migrater compiles the results of either of the following into a dictionary of lists, so you can pass this in directly:


	{
		'A': [ 'dirfixtures.py', ... ],
		'D': [ 'migrater/sftp.py', ... ],
		'M': [ 'README.md', ... ]
	}

The idea being to accept direct Git output or user input conveying the same information. 

Usage
-----













<commit_msg>README: added usage<commit_after>Migrater
========================

Summary
-------
Migrater is a Python module to sync up Point B (remote) with Point A (local) based on a list of actions. 

SFTP? FTP? Local? Migrater don't care (just give it the proper configuration).

Status: Works with local directories and SFTP.

Concepts
--------

### Properties
`Properties` is a configuration dictionary: 

	{
		"type": "sftp",										# one of local, sftp, or ftp
		"localroot":  "/full/path/to/local/root",			# "Point A" root
		"remoteroot": "/full/path/to/remote/root",			# "Point B" root
		### extra config for ftp/sftp
		"host": "<EMAIL>",							# required
		"port": 22											# optional (sftp: 22; ftp: ??)
		"password": "<PASSWORD>"								# optional (prompt or keychain)
	}

### Actions
`Actions` are based on the output of 

	$ git diff --name-status ...

For example:

	$ git diff --name-status HEAD HEAD^
	M       README.md
	A       dirfixtures.py
	A       migrate.py
	A       migrater.py
	D       migrater/__init__.py
	D       migrater/migrater.py
	D       migrater/sftp.py
	M       sites/site_id/properties.json
	A       test.py

This shows the *difference* between my last Git commit (`HEAD`) and the previous, (`HEAD^`). In my last commit, for example, I: 

* [A]dded dirfixtures.py
* [D]eleted migrater/sftp.py
* [M]odified README.md

Migrater can accept `actions` in a few ways:

1. Raw text: 

	"M README.md\nA dirfixtures.py\nD migrater/sftp.py"

2. Path to file:

	'~/actions.txt'

3. Migrater compiles the results of either of the following into a dictionary of lists, so you can pass this in directly:


	{
		'A': [ 'dirfixtures.py', ... ],
		'D': [ 'migrater/sftp.py', ... ],
		'M': [ 'README.md', ... ]
	}

The idea being to accept direct Git output or user input conveying the same information. 

Usage
-----

At this point, modify __main__ in migrater.py to set up your properties and actions and call backup() and migrate(). The hope is that Unified Migration Theory (umt), will create a .umt directory within your project root, where settings and backups are stored and actions are passed via the command line.
{'fraction_non_alphanumeric': 0.13749685217829263, 'fraction_numerical': 0.0035255603122639136, 'mean_word_length': 2.7900763358778624, 'pattern_counts': {'":': 12, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5463387', 'n_tokens_mistral': 1465, 'n_tokens_neox': 1332, 'n_words': 478}