Open-source project
GuanYixuan/pyJianYingDraft avatar
GuanYixuan/pyJianYingDraft

pyJianYingDraft: generate JianYing draft files from Python

轻量、灵活、易上手的Python剪映草稿生成及导出工具,构建全自动化视频剪辑/混剪流水线。本项目的CapCut版本正于 https://github.com/GuanYixuan/pyCapCut 内开发

4,467 stars678 forksPythonApache-2.0

At a glance

What is it?
A Python library that writes JianYing (CapCut CN) draft folders programmatically, so a script can assemble cuts, transitions and subtitles instead of a human dragging clips. Version 0.3.0 landed on 2026-07-08.
Who is it for?
Adopt it if you already cut in JianYing and want a script to assemble drafts at volume, and you can pin JianYing 5.9 or accept template mode on newer builds. Do not adopt it if your pipeline must export without a human, or if you only have a Linux or macOS machine, because auto export is Windows-only and needs JianYing 6 or below.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The problem pyJianYingDraft solves, and who it is for

JianYing (the Chinese edition of CapCut) stores each project as a draft folder containing a draft_content.json file. Editing that file by hand is possible but painful, because the schema tracks materials, segments, tracks, keyframes and effects as separate objects that must stay consistent with each other. pyJianYingDraft wraps that schema in Python objects: you create a DraftFolder, ask it for a ScriptFile, add tracks and segments, and call save.

The audience is narrow and specific. It is for people who already edit in JianYing and want to generate drafts in bulk: batch variant cuts of the same footage, template-driven assembly where only the source clips change, or subtitle-driven workflows that start from an .srt file. The README frames the goal as building a fully automated editing pipeline. It is not a video renderer. Nothing in the library encodes or composites frames; JianYing does that when a human opens the draft and exports.

That distinction decides most adoption questions. If you want headless video output on a server, this is the wrong layer.

How the draft generation actually works

The core object is DraftFolder, constructed with the path to the JianYing drafts directory (the README points to JianYing's global settings, draft location, to find it). From there you either create a script or duplicate an existing draft as a template. The returned ScriptFile holds the track and segment model, and save() writes it back out.

Tracks are typed. The README shows TrackType.audio used to select an imported audio track, and the same enum pattern applies to video and text. Segments carry a source_timerange that selects which part of a material is used, plus effects, animations, fade settings and volume. Materials are separate objects (AudioMaterial is the example given), and segments reference them.

Two modes exist. In plain mode you build everything from scratch. In template mode you load an existing draft, keep its complex features (text effects, compound clips), and replace pieces of it. The README is explicit that imported tracks and library-created tracks are kept separate: you cannot add segments, transitions, fades or effects to an imported track, though you can add new tracks alongside it. That constraint is the single most important thing to understand before choosing template mode.

Installing pyJianYingDraft and building a first draft

Installation is a pip install. The README recommends Python 3.8 or 3.11, the versions used during development, and setup.py declares python_requires of 3.8 or later. The package pulls in pymediainfo and imageio, plus uiautomation on Windows only, which is what drives the optional auto export.

bash
pip install pyJianYingDraft

The quickest first run is the bundled demo.py, which the README says creates a draft with audio and video material, one line of text, an audio fade-in, a video entrance animation, a transition, and a text bubble and flower-word effect. You replace the placeholder with your own drafts folder path and run it.

python
import pyJianYingDraft as draft

draft_folder = draft.DraftFolder("<剪映草稿文件夹>")
script = draft_folder.duplicate_as_template("模板草稿", "新草稿")

script.save()

After running, open JianYing and look for the new draft. The README warns the draft list may not refresh immediately and suggests entering and leaving an existing draft, or restarting JianYing. You should then see the timeline the demo built, and you can inspect the audio volume, the fade-in duration and the entrance animation to confirm they match the code.

For template work, the replacement API is name-based or index-based. Replacing by name swaps the material itself, which the README notes is especially suitable for image assets because no time range changes. Replacing by segment targets one clip and can re-select its source range and stretch it on the timeline, controlled by handle_shrink and handle_extend. The README states the defaults: if the new material is shorter, the segment end moves earlier to match; if longer, the material range is cropped and the segment keeps its original length.

Where pyJianYingDraft breaks: masks, exports and non-plain templates

The support table is the honest part of this project, and it is worth reading before anything else. Video masks work on JianYing 5.9 but are marked unsupported on 10.8, with a fix expected in 0.3.1. Track ordering is marked partial on 10.8: tracks imported from other drafts may come out in the wrong order. Fonts that are not cached require opening the draft a second time on both versions.

The export story is the sharpest limitation. Auto export depends on visible controls in older JianYing builds, and the README states that JianYing 7 and above generally no longer satisfy that precondition. Opening a specified draft, exporting to a chosen location, and setting export resolution and frame rate all work on JianYing 6.8 and below, and are marked unsupported on 10.8. Cross-platform notes say the same thing from another angle: Linux and macOS support draft generation and template mode but not auto export, and drafts generated there still have to be exported in Windows JianYing.

Template mode has its own failure mode. The README states that draft_content.json in newer JianYing versions is often not readable plain JSON, so template loading generally needs an extra reader passed through DraftFolder(..., fallback_loader=...). Without one, the template features degrade.

One more operational caveat: the README notes JianYing tries to download uncached animations, effects and transitions when opening a draft, and that this can time out and surface as a load failure, more often on 5.9.

How it differs from the other automation tools people compare it to

The related searches around this project name several other tools, and the difference is mostly about where the video is actually rendered. pyJianYingDraft does not render. It produces a draft that JianYing renders. That means the output quality, codec and export settings come from JianYing, and the machine doing the export needs JianYing installed and a human or a UI automation step to trigger it.

A pipeline built on a moviepy or ffmpeg-style approach inverts that. Rendering happens in the script, on any machine, with no desktop application in the loop, but you give up JianYing's effects, transitions, text bubbles and flower-word presets, or you reimplement them. For teams whose visual style is defined by JianYing presets, reimplementing is the expensive part; for teams who only need cuts and subtitles, the desktop dependency is the expensive part.

The project's own CapCut edition, pyCapCut, is the other comparison point, and it is a separate repository the README says is still in development. If your target is international CapCut rather than the Chinese JianYing build, that is the repository to check, not this one.

Maintenance, licence and upgrade cost

The repository is not archived, and the last push was on 2026-07-08, which is the same day version 0.3.0 was tagged. Before that, 0.2.7 was tagged on 2026-06-25 and 0.2.6 on 2026-03-16, so the release cadence in the visible window is uneven but not stalled.

The upgrade cost is dominated by JianYing itself, not by the library. Every row of the support table is split by JianYing version, and the 0.3.0 release notes in the README describe a large-scale update with a known mask regression on 10.8. That means a JianYing auto-update can break a working pipeline without any change on the Python side. The README links a related issue about auto-upgrade on JianYing 5.9, which is the practical reason many users pin an old build.

The licence is Apache-2.0. That is a permissive licence with an explicit patent grant, and it permits commercial use and modification. It is not legal advice, and the usual obligations (keeping the licence and notice files with redistributed copies) still apply. One thing worth checking on your own: the library is built to write into JianYing's draft format, and the terms attached to JianYing itself are separate from this project's licence.

Editorial conclusion

Adopt it if you already cut in JianYing and want a script to assemble drafts at volume, and you can pin JianYing 5.9 or accept template mode on newer builds. Do not adopt it if your pipeline must export without a human, or if you only have a Linux or macOS machine, because auto export is Windows-only and needs JianYing 6 or below. Verify first that your installed JianYing version matches the support table, and that your draft_content.json is readable plain text, since the README says newer versions usually are not and require a fallback_loader.

Frequently asked questions

What is pyJianYingDraft and who is it for?

It is a Python library that generates and exports JianYing draft files, aimed at building automated editing or mashup pipelines. It suits people who already edit in JianYing and want scripts to assemble drafts rather than dragging clips by hand.

How do I install pyJianYingDraft?

Install it with pip. The README recommends Python 3.8 or 3.11, the versions used during development, and setup.py declares python_requires of 3.8 or later.

Does pyJianYingDraft work on Linux or macOS?

Draft generation and template mode work, but auto export does not. The README also notes that drafts generated on Linux or macOS still need to be exported in Windows JianYing.

Why does auto export fail on newer versions of JianYing?

Auto export depends on visible controls in older JianYing builds, and the README states that JianYing 7 and above generally no longer meet that precondition. Export control is listed as supported on JianYing 6.8 and below and unsupported on 10.8.

Why does template mode need a fallback_loader?

The README says draft_content.json in newer JianYing versions is often not readable plain JSON, so loading templates generally requires an extra reader passed through DraftFolder(..., fallback_loader=...). Without it, template features are limited.

Official sources

  1. GuanYixuan/pyJianYingDraft on GitHub
  2. Issues
  3. License: Apache-2.0
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/guanyixuan-pyjianyingdraft.svg)](https://hysenlabs.com/projects/guanyixuan-pyjianyingdraft)