Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hamolicious/labhub
Seamlessly work with with Github, Gitlab and self-hosted Gitlab repositories using one interface
https://github.com/hamolicious/labhub
github gitlab python read-only wrapper
Last synced: 10 days ago
JSON representation
Seamlessly work with with Github, Gitlab and self-hosted Gitlab repositories using one interface
- Host: GitHub
- URL: https://github.com/hamolicious/labhub
- Owner: hamolicious
- License: wtfpl
- Created: 2024-10-27T23:58:45.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-28T00:28:03.000Z (about 2 months ago)
- Last Synced: 2024-11-23T10:46:52.997Z (about 1 month ago)
- Topics: github, gitlab, python, read-only, wrapper
- Language: Python
- Homepage: https://pypi.org/project/labhub/
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# labhub
Seamlessly work with with Github, Gitlab and self-hosted Gitlab repositories using one interface.
> Currently supports read-only operations.
## Install
```bash
pip install labhub
```## Useage
```python
# import repos and types
from labhub import GitHubRepo, GitLabRepo, Directory, File# Create repo objects
gh = GitHubRepo("hamolicious/test-repo", github_token, ref=ref)
gl = GitLabRepo(53, gitlab_token, host="https://gitlab.selfhosted.byme", ref=ref)# list files in repo
files: list[Directory | File] = gh.ls(path)# file operations
f_or_d = gh.ls()[0]
f_or_d.name # base name 'README.md'
f_or_d.path # file and path 'a/b/c'f.get_data() # bytes
d.contents # list[File | Directory]
```