Skip to main content

Simple wrapper for Git LFS (Large File Storage) commands.

Project description

lock-file-smith

Simple wrapper for Git LFS (Large File Storage) commands.

Quickstart

As there is no API for interacting with Git LFS, this wrapper provides function that you can use in your Python application for querying, lock/unlock Git LFS files etc.

The LockFile dataclass stores the name, author and ID of a locked file.

Take note that the speed of this library depends on Git. This has not been tested on a Git repository with a large number of locked files.

Usage

from lockfilesmith.cmds import lock, query

# Use this to verify if Git/Git LFS is presence
query.is_git_installed()
query.verify_git_lfs()

# Query for locked files.
locked_files = query.locked_files()  # Will return empty list if no locked files 

# Lock a file (ensure the file format is tracked as LFS)
lock.lock_file("foo/bar.uasset")  # True

# Unlock file (you can retrieve the locked object ID using query.locked_files)
bar = query.locked_files()[0]  # assume bar.uasset is the only locked file
lock.unlock_file(bar.id)

Further reading

https://git-lfs.com/

https://www.atlassian.com/git/tutorials/git-lfs

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

lock-file-smith-0.1.0.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

lock_file_smith-0.1.0-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

Supported by

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