Skip to content

shreyashankar/vython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

V(ersioned) (P)ython

This lightweight utility for versioning Python captures the contents of any file after you run it. It works with args. To use:

  1. Clone this repo
  2. Run pip install . in the root directory of the repo
  3. Any time you run python ..., run vython ... instead.

Example: run vython helloworld.py in the root directory to get the output:

> vython helloworld.py
hello world

Versions are saved as json files such as:

{
    "timestamp": "2022-04-12 16:13:34.875372", 
    "filename": "/Users/shreyashankar/Documents/projects/vpython/helloworld.py", 
    "command": "/Users/shreyashankar/miniforge3/envs/hawk/bin/python3.9 helloworld.py", 
    "contents": "print(\"hello world\")\n"
}

The default save directory is Path.home()/.vython. To override it, set the VYTHON_SAVE_DIR environment variable.

TODO:

  • Utilities for diffing versions
  • Log stdout to the json files
  • Integrations with git

About

Versioning Python scripts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages