No project description provided
Project description
Upload Files to GitHub
This is a Python package and command-line interface (CLI) tool for uploading files or directories to a GitHub repository. It uses the GitHub API to upload the files to a specified repository and branch.
Installation
You can install this package using pip
:
pip install upload-files-to-github
Usage
CLI
The CLI tool is called upload_files_to_github.py
and can be used to upload one or multiple files/directories to a GitHub repository.
To upload a single file:
python upload_files_to_github.py --content "Hello World!" --path "example.txt" --repo "username/repo" --token "YOUR_GITHUB_TOKEN"
To upload multiple files or a directory:
python upload_files_to_github.py --files path/to/file1 path/to/directory --repo "username/repo" --token "YOUR_GITHUB_TOKEN"
Package
You can also use this package in your Python code to upload files to a GitHub repository. Here's an example:
from upload_files_to_github import upload_files_to_github
files = ["path/to/file1", "path/to/directory"]
repo = "username/repo"
token = "YOUR_GITHUB_TOKEN"
branch = "main"
upload_files_to_github(files, repo, token, branch)
GitHub Token
To use this tool or package, you need a GitHub personal access token. You can create a new token with the repo
scope, which allows the tool to read and write to your repositories.
You can provide the token using the --token
argument or by setting the GITHUB_ACCESS_TOKEN
environment variable.
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
Built Distribution
Hashes for upload-files-to-github-1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 271ddfc0035c9b944d07055d996b9d635b2053f5d9267e8f369b6a151b7643ce |
|
MD5 | 11c7c9789c90ed199e65ca578d858c6a |
|
BLAKE2b-256 | 29beafd69d22371719ce925820bd5a905f55934e37984433d55b65a9b98ec8a5 |
Hashes for upload_files_to_github-1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e279c8045d291c684beaa5a4398091908cac5e3ab4fda1e45d1c140706a080a9 |
|
MD5 | c8a40f3d916aaf212e16a1496906fc1d |
|
BLAKE2b-256 | ac787e4989de5fefe2e41f14a2a44ca955b84ade84a5223c194408645e0fff7f |