Skip to main content

Import files from git repositories to local destinations.

Project description

import-git-files

import-git-files Documentation Status

Read The Docs

import-git-files enables defining file imports from 1 or more git repositories (public or private) to local destinations.

This supports use of polyrepos that may be related. Each repository may follow release definitions that the repository should only contain what is released together, yet it may be a sub-project or related project to other repositories. This import tool allows defining imports into other projects which can include commit shas, tags, and releases.

Installation

Requires Python 3.6+ and either OS X or Linux. It is not tested or supported on Windows. This is only developed and tested against GitHub repositories, but may work elsewhere.

pip install import-git-files

Usage

usage: import-git-files [-h] [--version] [-v] [-t TEMPORARY_DIRECTORY_PARENT]
                        [--ssh-key SSH_KEY]
                        input

Import files from other repositories. Define the imports in a JSON file and
pass as input argument. If the repositories are private and require
authentication but you do not have cached credentials and are using it in a
non-interactive way, you can either define a Personal Access Token in your
Environment under variable GITHUB_TOKEN or you can specify a path to an SSH
Deploy Key.

positional arguments:
  input                 The input json with a hash of repo URLs and their
                        value being hash of source path and destination path.
                        Source path should be relative to root of repository
                        and the destination path can be absolute or it can be
                        relative to the PWD.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -v, --verbose         Set logging to verbose
  -t TEMPORARY_DIRECTORY_PARENT, --temporary-directory-parent TEMPORARY_DIRECTORY_PARENT
                        Optionally set the parent directory for temporary
                        directories or else will use system tmp default.
  --ssh-key SSH_KEY     Path to an SSH Key with access to the repository. This
                        file needs 600 permissions. This cannot be defined in
                        combination with GITHUB_TOKEN environment variable.

note: When needing to setup non-interactive authentication methods, SSH deploy key is preferred over Personal Access Token. If using a PAT, avoid setting verbose logging as it may expose the token.

You can also use import_git_files module in your project and the included context manager, GitExtractedFiles. See the docs for more information.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

import-git-files-0.1.0.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

import_git_files-0.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file import-git-files-0.1.0.tar.gz.

File metadata

  • Download URL: import-git-files-0.1.0.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for import-git-files-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b769a2eb40a4655571072f0f9f478c59b47c08e417a96a1581949c73633c14ca
MD5 cb281926962233a7bde8c65d004f707f
BLAKE2b-256 2a399d8a5bd9721210390aed59212c4cca92701c066cd262b10168856b0d5fc3

See more details on using hashes here.

File details

Details for the file import_git_files-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: import_git_files-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for import_git_files-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 100688c8feb1cd99889889192fd2134a7e9469132376ecbd609f1581dff2970a
MD5 6b6a032336133057788f8e13bb602c2c
BLAKE2b-256 4d7f5ee7c8225c6fcc0ad9b8f480713d58e793ca74b8261ac67a2b33eebb582c

See more details on using hashes here.

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