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
Project details
Release history Release notifications | RSS feed
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 details)
Built Distribution
File details
Details for the file lock-file-smith-0.1.0.tar.gz
.
File metadata
- Download URL: lock-file-smith-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | facaa56b59f55e01525f5a10d290fea1a06a7c5293cead652a40de4092650a8e |
|
MD5 | 66283260ae982fa8f58ce5db243473f7 |
|
BLAKE2b-256 | 7277f690114f4a795a8a90d1af194b01738ace68157767461375fa23d1161abd |
File details
Details for the file lock_file_smith-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: lock_file_smith-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fb900532468c50ef4f31405ebceca797e347f1263973f4b6663528cceafe9f3 |
|
MD5 | f3c8e5110c4c376ab09b4c320f9061a3 |
|
BLAKE2b-256 | f7370f6307021aeee4ad25e04c78aa1166a5b9b561c4182206dcec7e6d1225f8 |