Skip to main content

No project description provided

Project description

Upload Files to GitHub

This package provides a simple way to upload multiple files or directories to a GitHub repository using a command-line interface.

Installation

You can install this package using pip:

pip install upload-files-to-github

Usage - CLI

To upload files using the CLI, run the upload_files_to_github.py script with the following arguments:

python upload_files_to_github.py --files <file_or_directory_paths> --repo <user/repo> --token <github_token>
  • <file_or_directory_paths>: a list of file or directory paths to upload, separated by spaces.
  • <user/repo>: the GitHub repository where you want to upload the files.
  • <github_token>: your GitHub personal access token.

For example, to upload all the files in the current directory to a repository myuser/myrepo, you can run:

python upload_files_to_github.py --files . --repo myuser/myrepo --token <github_token>

Usage - Module

You can also use this package as a module in your Python code. After installing the package, you can import the upload_files_to_github function and use it as follows:

from upload_files_to_github import upload_files_to_github

files = ['path/to/file1', 'path/to/file2']
repo = 'myuser/myrepo'
token = 'mygithubtoken'
upload_files_to_github(files, repo, token)

The upload_files_to_github function takes the same arguments as the CLI script, but files should be a list of file paths instead of a space-separated string.

Alternatively, you can also use the package as a module from the command line:

python -m upload_files_to_github --files <file_or_directory_paths> --repo <user/repo> --token <github_token>

This will run the upload_files_to_github function with the same arguments as the CLI script.

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.3.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

upload_files_to_github-1.3-py3-none-any.whl (3.4 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