trimmy 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- trimmy-0.2.0/.env +1 -0
- trimmy-0.2.0/.github/workflows/release.yml +52 -0
- trimmy-0.2.0/.gitignore +13 -0
- trimmy-0.2.0/.pre-commit-config.yaml +6 -0
- trimmy-0.2.0/.python-version +1 -0
- trimmy-0.2.0/PKG-INFO +6 -0
- trimmy-0.2.0/README.md +64 -0
- trimmy-0.2.0/pyproject.toml +25 -0
- trimmy-0.2.0/trimmy/__init__.py +0 -0
- trimmy-0.2.0/trimmy/__main__.py +12 -0
- trimmy-0.2.0/trimmy/config.py +45 -0
- trimmy-0.2.0/trimmy/main_window.py +659 -0
- trimmy-0.2.0/trimmy/presets.py +176 -0
- trimmy-0.2.0/trimmy/renderer.py +268 -0
- trimmy-0.2.0/trimmy/widgets.py +405 -0
- trimmy-0.2.0/uv.lock +611 -0
trimmy-0.2.0/.env
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
TOKEN=pypi-AgEIcHlwaS5vcmcCJDMxODQxZWU1LTkwYzctNDUzZi05ZDAyLWVkMjQwN2NhNGY5MQACKlszLCI5ZWIxODc4OC0zMjJhLTQ5OWEtYTQ3NS01NDgyZDk5ZGE2M2YiXQAABiAOiLc3nAcjoY7SdWEDaNufxmTPGZDQW8zfmmunCARYCQ
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Bump & Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
release:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
|
|
18
|
+
- uses: astral-sh/setup-uv@v4
|
|
19
|
+
|
|
20
|
+
- name: Configure git
|
|
21
|
+
run: |
|
|
22
|
+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
23
|
+
git config --local user.name "github-actions[bot]"
|
|
24
|
+
|
|
25
|
+
- name: Bump version
|
|
26
|
+
id: bump
|
|
27
|
+
run: |
|
|
28
|
+
if uvx --from commitizen cz bump --yes --changelog; then
|
|
29
|
+
echo "bumped=true" >> $GITHUB_OUTPUT
|
|
30
|
+
else
|
|
31
|
+
rc=$?
|
|
32
|
+
if [ $rc -eq 21 ]; then
|
|
33
|
+
echo "No version bump needed"
|
|
34
|
+
echo "bumped=false" >> $GITHUB_OUTPUT
|
|
35
|
+
else
|
|
36
|
+
exit $rc
|
|
37
|
+
fi
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
- name: Push bump commit and tag
|
|
41
|
+
if: steps.bump.outputs.bumped == 'true'
|
|
42
|
+
run: |
|
|
43
|
+
git push
|
|
44
|
+
git push --tags
|
|
45
|
+
|
|
46
|
+
- name: Build package
|
|
47
|
+
if: steps.bump.outputs.bumped == 'true'
|
|
48
|
+
run: uv build
|
|
49
|
+
|
|
50
|
+
- name: Publish to PyPI
|
|
51
|
+
if: steps.bump.outputs.bumped == 'true'
|
|
52
|
+
run: uv publish --token ${{ secrets.PYPI_TOKEN }}
|
trimmy-0.2.0/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11.8
|
trimmy-0.2.0/PKG-INFO
ADDED
trimmy-0.2.0/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Trimmy
|
|
2
|
+
|
|
3
|
+
Vertical split-crop video editor. Take any video, pick two crop regions, stack them top-and-bottom into a 9:16 frame, and export optimized for social media.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
1. Open or drag-drop a video
|
|
8
|
+
2. Position two crop boxes on the source frame (TOP and BOTTOM)
|
|
9
|
+
3. Adjust the split ratio by dragging the red divider
|
|
10
|
+
4. Trim the timeline to the segment you want
|
|
11
|
+
5. Pick a platform and quality preset
|
|
12
|
+
6. Render — ffmpeg encodes a ready-to-upload vertical video
|
|
13
|
+
|
|
14
|
+
The output stacks the two crops vertically into a single 9:16 video, useful for reaction content, split-screen tutorials, gameplay + facecam, etc.
|
|
15
|
+
|
|
16
|
+
## Platform presets
|
|
17
|
+
|
|
18
|
+
| Platform | Resolution | Max FPS | Max Size | Codec |
|
|
19
|
+
|-----------|-----------|---------|----------|-----------------|
|
|
20
|
+
| Instagram | 1080x1920 | 60 | 300 MB | H.264 High 4.0 |
|
|
21
|
+
| TikTok | 1080x1920 | 60 | 4 GB | H.264 High 4.2 |
|
|
22
|
+
| Twitter/X | 1080x1920 | 60 | 512 MB | H.264 High 4.2 |
|
|
23
|
+
| WhatsApp | 720x1280 | 30 | 16 MB | H.264 Main 3.1 |
|
|
24
|
+
| Telegram | 1080x1920 | 60 | 2 GB | H.264 High 4.2 |
|
|
25
|
+
|
|
26
|
+
Each platform has **Max** (highest quality, slower encode) and **Optimized** (smaller files, faster encode) quality modes. WhatsApp auto-caps bitrate to fit the 16 MB limit.
|
|
27
|
+
|
|
28
|
+
## Requirements
|
|
29
|
+
|
|
30
|
+
- Python 3.11+
|
|
31
|
+
- [ffmpeg](https://ffmpeg.org/) and ffprobe in PATH
|
|
32
|
+
- [uv](https://docs.astral.sh/uv/) (recommended) or pip
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git clone https://github.com/musantro/trimmy.git
|
|
38
|
+
cd trimmy
|
|
39
|
+
uv sync
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
uv run python -m trimmy
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Or open a file directly:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
uv run python -m trimmy path/to/video.mp4
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Keyboard shortcuts
|
|
55
|
+
|
|
56
|
+
| Key | Action |
|
|
57
|
+
|-----------|------------------|
|
|
58
|
+
| Space | Play / Pause |
|
|
59
|
+
| Left | Seek back 5s |
|
|
60
|
+
| Right | Seek forward 5s |
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "trimmy"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
description = "Trimmy — vertical split crop video editor"
|
|
5
|
+
requires-python = ">=3.11"
|
|
6
|
+
dependencies = ["PySide6>=6.5"]
|
|
7
|
+
|
|
8
|
+
[build-system]
|
|
9
|
+
requires = ["hatchling"]
|
|
10
|
+
build-backend = "hatchling.build"
|
|
11
|
+
|
|
12
|
+
[project.scripts]
|
|
13
|
+
trimmy = "trimmy.__main__:main"
|
|
14
|
+
|
|
15
|
+
[dependency-groups]
|
|
16
|
+
dev = [
|
|
17
|
+
"commitizen>=4.16",
|
|
18
|
+
"pre-commit>=4",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[tool.commitizen]
|
|
22
|
+
name = "cz_conventional_commits"
|
|
23
|
+
version_provider = "pep621"
|
|
24
|
+
tag_format = "v$version"
|
|
25
|
+
update_changelog_on_bump = true
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _config_dir() -> Path:
|
|
8
|
+
if sys.platform == "win32":
|
|
9
|
+
base = Path(os.environ.get("LOCALAPPDATA", Path.home() / "AppData" / "Local"))
|
|
10
|
+
elif sys.platform == "darwin":
|
|
11
|
+
base = Path.home() / "Library" / "Application Support"
|
|
12
|
+
else:
|
|
13
|
+
base = Path(os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config"))
|
|
14
|
+
return base / "trimmy"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
CONFIG_PATH = _config_dir() / "config.json"
|
|
18
|
+
|
|
19
|
+
_DEFAULTS = {
|
|
20
|
+
"selected_platform": "instagram",
|
|
21
|
+
"selected_format": "feed",
|
|
22
|
+
"selected_quality": "max",
|
|
23
|
+
"split_ratio": 0.5,
|
|
24
|
+
"crops": {
|
|
25
|
+
"top": {"x": 0.0, "y": 0.0, "w": 0.0, "h": 0.0},
|
|
26
|
+
"bottom": {"x": 0.0, "y": 0.0, "w": 0.0, "h": 0.0},
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def load() -> dict:
|
|
32
|
+
if not CONFIG_PATH.exists():
|
|
33
|
+
return dict(_DEFAULTS)
|
|
34
|
+
try:
|
|
35
|
+
data = json.loads(CONFIG_PATH.read_text(encoding="utf-8"))
|
|
36
|
+
merged = dict(_DEFAULTS)
|
|
37
|
+
merged.update(data)
|
|
38
|
+
return merged
|
|
39
|
+
except (json.JSONDecodeError, OSError):
|
|
40
|
+
return dict(_DEFAULTS)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def save(state: dict):
|
|
44
|
+
CONFIG_PATH.parent.mkdir(parents=True, exist_ok=True)
|
|
45
|
+
CONFIG_PATH.write_text(json.dumps(state, indent=2), encoding="utf-8")
|