Skip to main content

githublfs is a Python library currently exposing a single method to upload and commit a file to a Github repository using git LFS.

See https://git-lfs.github.com/

Installation

pip install githublfs

Usage

>>> from githublfs import commit_lfs_file
>>> commit_lfs_file(repo="AnesFoufa/githublfs",
                    token="gh_token_with_repo_scope",
                    branch="main",
                    path="assets/logo.jpg",
                    content=b"binary file content",
                    message="my commit message")

To authenticate, an access token with repo scope is needed. See: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

Dependencies

  • Python >= 3.8

  • PyGithub = “^1.55”

  • requests = “^2.28.1”

Implementation details

This library uses LFS’ Basic Transfer API. See https://github.com/git-lfs/git-lfs/blob/main/docs/api/basic-transfers.md

Production warning

This library is still experimental. If you use it in production, please pin the exact version in your requirements, including the minor number.

License

This project is distributed under the MIT license. See the LICENSE file for details.

Release files for githublfs 0.2.1

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

Source distribution (sdist)

Source distribution for githublfs 0.2.1
File Size Uploaded
githublfs-0.2.1.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for githublfs 0.2.1
File Interpreter ABI Platform
githublfs-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size:8.3 kB

Release files / githublfs-0.2.1.tar.gz

Download URL githublfs-0.2.1.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
071184711eb121a6122530ffb8f67a36c6a2e6f3b1552206109c15438c881360
BLAKE2b-256 checksum
How to use checksums
0360d42018e0567cc0ff0b3ae0b51697b05b6b63d191e52845f19b2eda2befdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.27

Release files / githublfs-0.2.1-py3-none-any.whl

Download URL githublfs-0.2.1-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20242f3a0cc3e84b84038ad47f0b22fa90fcbb0716aa4377b4b35b8c0d45c125
BLAKE2b-256 checksum
How to use checksums
17c97cec43a5ea0c7350e288328f41b0c7a01158ad7905967421899152f9fc91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.27

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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