{"id":29200866,"url":"https://github.com/datopian/giftless-client","last_synced_at":"2025-07-02T11:06:01.660Z","repository":{"id":44553144,"uuid":"315375553","full_name":"datopian/giftless-client","owner":"datopian","description":"A Python implementation of a Git-LFS client, with Giftless extras","archived":false,"fork":false,"pushed_at":"2022-02-08T11:29:16.000Z","size":29,"stargazers_count":15,"open_issues_count":2,"forks_count":5,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-06-22T01:26:06.293Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datopian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-23T16:31:52.000Z","updated_at":"2025-06-03T09:06:16.000Z","dependencies_parsed_at":"2022-08-27T23:10:41.456Z","dependency_job_id":null,"html_url":"https://github.com/datopian/giftless-client","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/datopian/giftless-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datopian%2Fgiftless-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datopian%2Fgiftless-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datopian%2Fgiftless-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datopian%2Fgiftless-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datopian","download_url":"https://codeload.github.com/datopian/giftless-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datopian%2Fgiftless-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262762423,"owners_count":23360323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-02T11:06:01.091Z","updated_at":"2025-07-02T11:06:01.651Z","avatar_url":"https://github.com/datopian.png","language":"Python","readme":"# Giftless Client\n\nA Git LFS client library implemented in Python, compatible with Git LFS servers in general and specifically [Giftless Git LFS server](https://github.com/datopian/giftless). \n\n`giftless-client` is tested on Python 2.7 and 3.6+. \n\n## Installation\n\nYou can install this library directly from pypi:\n\n```shell script\n(venv) $ pip install giftless-client\n```\n\n## API\n\nThis module exposes one main class: `LfsClient`. Typically, you only need to use this class to perform most Git LFS operations. The client provides both a wrapper around the low-level LFS API commands e.g. `batch` as well as higher level methods to upload and download files.\n\n### Instantiating a Client\n\n```python\nfrom giftless_client import LfsClient\n\nclient = LfsClient(\n    lfs_server_url='https://git-lfs.example.com', # Git LFS server URL\n    auth_token='somer4nd0mT0ken==',               # Bearer token if required by the server (optional)\n    transfer_adapters=['basic']                   # Enabled transfer adapters (optional)\n)\n```\nThe `transfer_adapters` parameter is optional, and represents a list of supported transfer adapters by priority\nto negotiate with the server; Typically, there is no reason to provide this parameter.\n\n### Downloading a File from LFS storage \n\nDownload a file and save it to file like object.\n\n```python\ndownload(file_obj, object_sha256, object_size, organization, repo, **extras)\n```\n\n* `file_obj` is expected to be an file-like object open for writing in binary mode\n* `object_sha256`: sha256 of the object you wish to download\n* `object_size`: size of the object you wish to download\n* `organization`, `repo`: used to generate the prefix for the batch request in form `organization/repo`\n* `extras` are added to the batch request attributes dict prefixed with `x-`. This is largely Giftless specific.\n\nNote that the download itself is performed by the selected [Transfer Adapter][transfer].\n\n[transfer]: https://github.com/datopian/giftless-client/blob/master/giftless_client/transfer.py\n\n### Uploading a File to LFS storage\n\nUpload a file to LFS storage\n\n```\nupload(file_obj, organization, repo, **extras)\n```\n\n* `file_obj`: a readable, seekable file-like object\n* Other arguments as per download\n\nNote that the upload itself is performed by the selected [Transfer Adapter][transfer].\n\n[transfer]: https://github.com/datopian/giftless-client/blob/master/giftless_client/transfer.py\n\n### Sending an LFS `batch` API request\n\nSend a [`batch` request][batch] to the LFS server:\n\n`batch(prefix, operation, objects, ref=None, transfers=None)`\n\n* `prefix`: add to LFS server url e.g. if `prefix=abc` and client was created with server url of `https://git-lfs.example.com` then batch request is made by POST to `https://git-lfs.example.com/abc/objects/batch`\n* All other arguments: see [batch command][batch] for definitions \n\n[batch]: https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md\n\nExample:\n\n```\nclient.batch(\n  prefix='myorg/myrepo',\n  operation='download',\n  objects={\n      \"oid\": \"12345678\",\n      \"size\": 123\n    }\n)\n```\n\n## Usage in Command Line\n\nWhile the main use for `giftless-client` is as a client library for other projects, this module does include some \ncommand line functionality.\n\nRun the following command to get more information:\n\n```shell script\n(venv) $ giftless-client --help\n```\n\n## License\n\nGiftless Client is free software distributed under the terms of the MIT license. See [LICENSE](LICENSE) for details.\n \nGiftless Client is (c) 2020 Datopian / Viderum Inc.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatopian%2Fgiftless-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatopian%2Fgiftless-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatopian%2Fgiftless-client/lists"}