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.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

githublfs-0.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: githublfs-0.2.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.12.0

File hashes

Hashes for githublfs-0.2.0.tar.gz
Algorithm Hash digest
SHA256 eaf5a5c0d96877d298dfe024c7115a96737c3253fc3d0745bfe31135cdc534cb
MD5 96cec23535d4f6c854eac6870718c933
BLAKE2b-256 c660ad23d682fff002a8b0cc2ea3d20ff92739ba5e37638ef57db5854412833a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: githublfs-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.12.0

File hashes

Hashes for githublfs-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f617a9f74917a3e0425363265411005fe46309004047493af717b1f0789566bc
MD5 4e7ee2dabbb8f6abdd2efa7eda560b48
BLAKE2b-256 b4654ebca94c437db4d4bc7bccdc5e394d38d6d1b7c02e8ce00c3961dedf716e

See more details on using hashes here.

Supported by

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