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/

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 neede. See: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

Dependencies

  • python = “^3.7”

  • 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.

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

Uploaded Source

Built Distribution

githublfs-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for githublfs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9b8c2d0af52b13fedab11113ce617d0dbcba3126ac5928b7769c3353834a8c0f
MD5 7c98354c83859b9f0921af5bd72e115e
BLAKE2b-256 62084d48264d9b02ada2ab5d1972918a266bb3ce6af152cd9286b17d0d170a13

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for githublfs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c13d37b5613bcd03cf06d726c0850bd358ac07b3d19f932ec671974fbfbcc11
MD5 e1effd086ef8cb62e8ce363a617c3b86
BLAKE2b-256 caeb508d1b5e89a03470a7977ff013ade2c8fdabb265b8fc44fef6f1c6dae280

See more details on using hashes here.

Supported by

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