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
  • restore them later by logical name from GitHub raw URLs

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 GitStoreUploader, GitStoreDownloader

Upload

from gitstore import GitStoreUploader

uploader = GitStoreUploader(
    repo_path="C:/repos/my-publish-repo",  # optional, defaults to current working directory
    security_level="high",                 # default
)

record = uploader.store(
    source_path="C:/data/documento.pdf",   # file or directory
    name="documento_ventas_q2",            # logical name only
    replace_existing=True,                   # default: replace and purge previous history
    commit_message=None,                     # default: automatic message
)
print(record)

Download

from gitstore import GitStoreDownloader

downloader = GitStoreDownloader(
    raw_base_url="https://raw.githubusercontent.com/USER/REPO/main",
)

output_path = downloader.restore(
    name="documento_ventas_q2",
    output_path="C:/restore/documento.pdf",
    overwrite=True,
)
print(output_path)

Destroy

from gitstore import GitStoreUploader

uploader = GitStoreUploader(repo_path="C:/repos/my-publish-repo")
uploader.destroy(name="documento_ventas_q2")

destroy(...) removes the current artifact and rewrites Git history for that artifact path.

Password Source

Both classes 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.1.0.tar.gz (6.4 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.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gitstore-0.1.0.tar.gz
Algorithm Hash digest
SHA256 64fa7d014e3429a4c41575dc063c27050c642a1c66b1ed704133995b1b9417c7
MD5 0d80f5627d6bba50eff5b0c65e190907
BLAKE2b-256 7b8d6880349c81652b79c170d23968e927e537da4d707328a7d933751198d5ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gitstore-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3bff84c7df5abaaa0e4f8f04306ee51f7912acfd7963771b1278ee93e29aff01
MD5 04569fc4a58558b9dd486c15c554f914
BLAKE2b-256 be1d68974dcbc0ca8aacdeb0be589c8de17bfefdcf0f95a801b624c96ff4b476

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