Metadata-Version: 2.4
Name: bytifi
Version: 0.2.13
Summary: Official Bytifi CLI — encrypt, upload, and decrypt files from the terminal
Project-URL: Homepage, https://bytifi.com
Project-URL: Repository, https://github.com/jpwcguy/Bytifi
Project-URL: Issues, https://github.com/jpwcguy/Bytifi/issues
Author: Bytifi
License-Expression: MIT
Keywords: bytifi,cli,encryption,file-sharing,upload
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.10
Requires-Dist: cryptography>=42.0.0
Requires-Dist: httpx>=0.27.0
Provides-Extra: dev
Requires-Dist: build>=1.2.0; extra == 'dev'
Requires-Dist: twine>=5.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# Bytifi (Python)

Official Bytifi CLI for Python — encrypt, upload, and decrypt files with [bytifi.com](https://bytifi.com).

Published on [PyPI](https://pypi.org/project/bytifi/) as `bytifi`. Crypto and API behavior matches the Node.js npm package.

Requires **Python 3.10+**.

## Install

```bash
pip install bytifi
bytifi --version
```

### Upgrade

```bash
pip install --upgrade bytifi
```

### Verify which binary you are running

```bash
which bytifi
bytifi --version
```

If an old npm copy wins on `PATH`, upgrade it too:

```bash
npm install -g bytifi@latest
hash -r
```

## Setup

```bash
export BYTIFI_API_KEY=usk_your_api_key_here
```

Create an API key in **Account → API** on bytifi.com.

## Usage

```bash
bytifi upload ./photo.png
bytifi upload ./report.pdf --expires 60 --delete-on-download
bytifi upload ./logs.txt --json > upload.json
bytifi upload ./photo.png -q

bytifi decrypt 'https://bytifi.com/link?link=LINK#token=KEY' -o ./restored.png
bytifi decrypt LINK --token ENCRYPTION_TOKEN -o ./restored.png
bytifi decrypt LINK --token ENCRYPTION_TOKEN -o ./restored.bin
```

For offline decrypt of an already-downloaded encrypted blob, use the Node CLI (`bytifi decrypt ./file.bin --upload-json upload.json`).

### Upload options

| Flag | Description |
|------|-------------|
| `-k, --api-key` | API key (default: `BYTIFI_API_KEY`) |
| `-e, --expires` | Link lifetime: `5`, `15`, `30`, `60`, `120` |
| `--delete-on-download` | Delete after first download |
| `--json` | Machine-readable JSON output |
| `-q, --quiet` | Print only the share URL |
| `--verbose` | Print API error details to stderr |
| `--mime-type` | Override detected MIME type |
| `--concurrency` | Parallel part workers, 1–16 |
| `--base-url` | API base URL (default: `https://bytifi.com`) |

### Decrypt options

| Flag | Description |
|------|-------------|
| `--token` | Encryption key from `#token=...` |
| `--upload-json` | Upload `--json` output file |
| `-o, --output` | Output file path |
| `--force` | Overwrite existing output file |
| `--concurrency` | Parallel part download workers, 1–8 |
| `-q, --quiet` | Print only the output path |
| `--verbose` | Print error details to stderr |
| `--base-url` | API base URL (default: `https://bytifi.com`) |

For local encrypted files, `--link`, `--meta`, and `--local-file`, use the [Node.js CLI](../README.md) for now.

**Library API:** see [`API.md`](API.md).

## Local secrets (home / repo)

Recreate local secrets on your PC from the examples (never commit the real files):

```bash
# API keys for the CLI
cp ../.env.example ../.env
# edit ../.env and set BYTIFI_API_KEY / PyPI tokens

# Optional: PyPI credentials in your home directory
cp ../.pypirc.example ~/.pypirc
chmod 600 ~/.pypirc
# edit ~/.pypirc and set your tokens
```

## Development

```bash
cd python
python -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/python -m unittest discover -s tests -v
.venv/bin/python -m build
.venv/bin/bytifi --version
```

## Publishing

Set tokens in the repo root `.env` (see `.env.example`):

```env
PYPI_TEST_API_TOKEN=pypi-...
PYPI_API_TOKEN=pypi-...
```

**TestPyPI:**

```bash
./scripts/publish-testpypi.sh
```

**Production PyPI:**

```bash
./scripts/publish-pypi.sh
```

Install from TestPyPI:

```bash
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ bytifi
```
