gitstore
gitstore encrypts directories with utilitz.crypto and exchanges the encrypted text artifacts through GitHub-backed repositories.
Installation
pip install gitstore
Dependency on utilitz
This project depends on:
utilitz[crypto]0.9.1 or newer
Core API
from gitstore import upload_to_github, restore_from_github, restore_from_file
Upload a Directory
from gitstore import upload_to_github
record = upload_to_github(
local_dir="C:/data/my_directory",
name="my_backup_2026_05",
repo_dir="C:/repos/my-vault-repo",
password=None,
vault_subdir="vault",
request_timeout=60,
commit_message=None,
replace_existing=True,
force=False,
include_patterns=None,
exclude_patterns=None,
gitstore_path=None,
push_remote_name=None,
salt_size=16,
iterations=600_000,
key_length=32,
hash_name="sha256",
)
print(record)
Path parameters such as local_dir, repo_dir, and gitstore_path accept either strings or pathlib.Path objects.
push_remote_name lets you force the git remote used for the upload push, for example "github".
This is useful when origin is not the cloud remote you actually want to update.
Upload behavior:
- builds a
utilitz.crypto.CryptoInputfrom the source directory - compares the input
content_hashwith local state in~/.gitstore.json - skips encryption and upload when the local content is unchanged, unless
force=True - encrypts with the security parameters passed through to
utilitz.crypto.Encryptor.encrypt(...) - writes the encrypted UTF-8 text manually as
vault/<name>.asc - stores only
artifact_name,artifact_hash, andtimestampinvault/index.json - keeps the private
content_hashonly in local state - runs
git add,git commit, andgit pushonly for the.ascartifact andindex.json
Encryption Parameters
gitstore does not keep legacy security levels such as standard, high, or paranoid.
Encryption settings are exposed as named upload_to_github(...) parameters and passed directly to utilitz.crypto.Encryptor.encrypt(...).
Supported parameters in utilitz[crypto] 0.9.1:
salt_size: default16iterations: default600_000key_length: default32hash_name: only"sha256"is supported
The defaults match utilitz[crypto] 0.9.1.
Restore a Directory
from gitstore import restore_from_github
restored_path = restore_from_github(
github_raw_url="https://raw.githubusercontent.com/USER/REPO/main/vault/my_backup_2026_05.asc",
password=None,
local_dir="C:/restore/my_backup_2026_05",
overwrite=False,
force=False,
request_timeout=60,
gitstore_path=None,
)
print(restored_path)
local_dir accepts either a string or a pathlib.Path object.
Restore behavior:
- accepts raw GitHub URLs and normalizes
github.com/.../blob/...URLs to raw URLs - downloads text artifacts with
urllib - compares the remote
artifact_hashfromindex.jsonwith local download state - skips the download when the destination exists and the artifact hash is unchanged, unless
force=True - downloads the remote artifact when the hash changed, then delegates existing-destination handling to
utilitz - uses
force=Trueonly to bypass the skip check;overwritestill controls whether the destination may be replaced - decrypts with
utilitz.crypto.Decryptor - restores only with
Decryptor.to_directory(...)
Local restore from an already downloaded .asc file remains available:
from gitstore import restore_from_file
restored_path = restore_from_file(
encrypted_file_path="C:/downloads/my_backup_2026_05.asc",
password=None,
local_dir="C:/restore/my_backup_2026_05",
overwrite=False,
)
print(restored_path)
Valid Names
name is the artifact identifier. 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
JSON Formats
Remote vault/index.json:
[
{
"artifact_name": "my_backup_2026_05",
"artifact_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"timestamp": "2026-05-08T21:10:00Z"
}
]
Local ~/.gitstore.json:
{
"uploads": [
{
"repo_dir": "C:/repos/my-vault-repo",
"vault_subdir": "vault",
"local_dir": "C:/data/my_directory",
"artifact_name": "my_backup_2026_05",
"content_hash": "d57e5433434d3d2c1234...",
"timestamp": "2026-05-08T21:10:00Z"
}
],
"downloads": [
{
"local_dir": "C:/restore/my_backup_2026_05",
"source_url": "https://raw.githubusercontent.com/USER/REPO/main/vault/my_backup_2026_05.asc",
"artifact_hash": "e3b0c44298fc1c149afb...",
"timestamp": "2026-05-08T21:15:00Z"
}
]
}
Password Source
upload_to_github, restore_from_github, and restore_from_file auto-detect password from:
GITSTORE_PASSWORD
If password is not passed, the environment variable is used.
Metadata
Release files for gitstore 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gitstore-1.0.1.tar.gz | 10.7 kB | Without provenance | Details for gitstore-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gitstore-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for gitstore-1.0.1-py3-none-any.whl |
Total release size: 21.5 kB
Release files / gitstore-1.0.1.tar.gz
| Download URL | gitstore-1.0.1.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f978943d80785396b9b59217290512fa5849ef4c05a5f0d82e56fcd00236a452
|
|
BLAKE2b-256 checksum How to use checksums |
0a1f9dced1e31164a53f0b616f269be593db4c1f9da7f37a62aca70e7db532d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Release files / gitstore-1.0.1-py3-none-any.whl
| Download URL | gitstore-1.0.1-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
15b062d979fd30cb327dff007baef00ccaaa9bb1f07adb72e0074618b87f11b7
|
|
BLAKE2b-256 checksum How to use checksums |
15a9f4dff59595d70e88caaa163c8a4a3c3ca40736538c6e42eb7982b1588f31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Security for gitstore 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.