Skip to main content

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

Release files for lock-file-smith 0.1.0

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

Source distribution (sdist)

Source distribution for lock-file-smith 0.1.0
File Size Uploaded
lock-file-smith-0.1.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lock-file-smith 0.1.0
File Interpreter ABI Platform
lock_file_smith-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / lock-file-smith-0.1.0.tar.gz

Download URL lock-file-smith-0.1.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
facaa56b59f55e01525f5a10d290fea1a06a7c5293cead652a40de4092650a8e
BLAKE2b-256 checksum
How to use checksums
7277f690114f4a795a8a90d1af194b01738ace68157767461375fa23d1161abd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / lock_file_smith-0.1.0-py3-none-any.whl

Download URL lock_file_smith-0.1.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3fb900532468c50ef4f31405ebceca797e347f1263973f4b6663528cceafe9f3
BLAKE2b-256 checksum
How to use checksums
f7370f6307021aeee4ad25e04c78aa1166a5b9b561c4182206dcec7e6d1225f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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