Skip to main content

Utilities to encrypt files/directories with utilitz and exchange them through GitHub repositories.

Project description

gitstore

gitstore is a focused Python package for one goal:

  • upload encrypted files/folders to a GitHub-backed repo
  • download and restore encrypted GitHub files later

Installation

pip install gitstore

Dependency on utilitz

This project depends on:

  • utilitz[crypto]
  • requests

Project Structure

gitstore/
  src/gitstore/
    __init__.py
    client.py
    config.py
    crypto_ops.py
    github_ops.py
  pyproject.toml
  README.md

Core API

from gitstore import upload_to_github, download_from_github

Upload

from gitstore import upload_to_github

record = upload_to_github(
    source_path="C:/data/documento.pdf",  # file or directory
    name="documento_ventas_q2",           # logical name only
    repo_path="C:/repos/my-publish-repo", # required
    password=None,                        # default: uses GITSTORE_PASSWORD
    vault_dir="vault",                    # default
    request_timeout=60,                   # default
    security_level="high",                # default
    replace_existing=True,                # default
    force_upload=False,                   # default
    commit_message=None,                  # default: automatic message
)
print(record)

Upload behavior:

  • computes source_hash from source content before encryption
  • skips upload if same name already has same source_hash
  • set force_upload=True to upload even when the current source matches the remote metadata
  • stores artifact as vault/<name>.asc
  • stores metadata in vault/index.json
  • removes temporary encrypted file after processing

Valid Names

name is the logical identifier used to upload an artifact. It is intentionally strict to keep Git paths predictable:

  • allowed characters: letters, numbers, dots, underscores, and hyphens
  • must start with a letter or number
  • spaces and path separators are not allowed

Valid examples:

documento_ventas_q2
maindb-version-0.1
backup.2026_05

Invalid examples:

maindb -version 0.1
../secret
folder/documento

Download

from gitstore import download_from_github

output_path = download_from_github(
    github_url="https://github.com/USER/REPO/blob/main/vault/documento_ventas_q2.asc",
    password=None,      # default: uses GITSTORE_PASSWORD
    output_path=None,   # default: restores in the current working directory
    overwrite=False,    # default
    force_download=False, # default
)
print(output_path)

Download behavior:

  • accepts normal GitHub file URLs (github.com/.../blob/...) and raw URLs
  • skips download when output_path already exists and matches the remote source_hash in vault/index.json
  • set force_download=True to download even when the local output appears aligned
  • downloads the encrypted .asc file to a temporary location
  • restores files or directories automatically with utilitz.crypto
  • removes the temporary encrypted file after restore

Password Source

upload_to_github and download_from_github auto-detect password from:

  • GITSTORE_PASSWORD

If password is not passed, the environment variable is used.

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

gitstore-0.2.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitstore-0.2.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file gitstore-0.2.0.tar.gz.

File metadata

  • Download URL: gitstore-0.2.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for gitstore-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3b85b8857e4499c4b5918e13bbec43938333789f1fb841f2b1c82f70dea92d02
MD5 c99adcbf364cb32fbb83cc780d42d0ea
BLAKE2b-256 7bca263b8f8280f18dc858402fddf6b099a8b396946ddc59f3ec08423a8e3faf

See more details on using hashes here.

File details

Details for the file gitstore-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gitstore-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for gitstore-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 031e1ba4c9feaab0ceff88303fabfa8682895105ef505ea976a39238906600fe
MD5 fab14d57e702e72e7355d5950e408598
BLAKE2b-256 6e05a79056c5335e37f3fea8ded4759af19a6a3a99f7cd42eaceaa667e1f4ce9

See more details on using hashes here.

Supported by

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