Skip to main content

Simple library to commit lfs files to Github repos

Project description

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.

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

githublfs-0.2.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

githublfs-0.2.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file githublfs-0.2.1.tar.gz.

File metadata

  • Download URL: githublfs-0.2.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.27

File hashes

Hashes for githublfs-0.2.1.tar.gz
Algorithm Hash digest
SHA256 071184711eb121a6122530ffb8f67a36c6a2e6f3b1552206109c15438c881360
MD5 c560310192b5f076d8b70ac6714b6375
BLAKE2b-256 0360d42018e0567cc0ff0b3ae0b51697b05b6b63d191e52845f19b2eda2befdb

See more details on using hashes here.

File details

Details for the file githublfs-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: githublfs-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.27

File hashes

Hashes for githublfs-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 20242f3a0cc3e84b84038ad47f0b22fa90fcbb0716aa4377b4b35b8c0d45c125
MD5 decf56065a3d56f80268c7b1d66a2fcb
BLAKE2b-256 17c97cec43a5ea0c7350e288328f41b0c7a01158ad7905967421899152f9fc91

See more details on using hashes here.

Supported by

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