Skip to main content

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

upload-files-to-github-1.2.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

upload_files_to_github-1.2-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

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