Skip to main content

A Python library for rendering code videos

Project description

本库用于渲染并生成输入代码的视频,视频视角跟随光标移动。

说明

使用manim进行动画渲染,使用前请确保manim能够正常运行。

如何使用

本库提供CodeVideo函数,你可以使用它创建一个视频对象。参数如下:

CodeVideo(video_name="CodeVideo", speed=0.2, interval=0.05, floating_interval=True, 
          floating_pos=True, paragraph_config={'font':'Consolas'}, **kwargs):

参数说明

video_name:用于设置视频名称,必须为字符串类型。

speed:用于设置每个字符停留时间(秒),必须为数值类型。

interval:用于设置每个字符之间的间隔(秒),必须为数值类型。

floating_interval:用于设置间隔是否上下浮动,如果为True则间隔会上下浮动0.01秒。

floating_pos:用于设置镜头是否上下浮动,如果为True则镜头会在上方0.05单位长度下方0.05单位长度间上下浮动。

paragraph_config:Manim原版参数,原设置为None,更改为常用编程字体Consolas

**kwargs:可以传入Manim原版Code代码块中的其余参数,详见Code

生成视频

你可以对CodeVideo使用 render方法进行视频生成。

示例

video = CodeVideo(code_string="print('Hello World!')", language='python')
video.render()

你可以在终端查看视频的保存位置。

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

codevideorenderer-1.0.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

CodeVideoRenderer-1.0.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file codevideorenderer-1.0.0.0.tar.gz.

File metadata

  • Download URL: codevideorenderer-1.0.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for codevideorenderer-1.0.0.0.tar.gz
Algorithm Hash digest
SHA256 4d1b59c3209c6f8ea9d471faa72d42fc12d6c0bdbb594271d7e59b48d617a7bf
MD5 be41cf1ecaf1340e1d692ae7e6863b56
BLAKE2b-256 693b1afa871ce30b405ab58e52e544b88b1ee2313372389ffd7f53cbae5b4999

See more details on using hashes here.

File details

Details for the file CodeVideoRenderer-1.0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for CodeVideoRenderer-1.0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1bbac2cecdddc265fad50ecf019972e3f58bc11aa359586412600c946db89943
MD5 1d6de2b287a415ab6f82d5497f4c7847
BLAKE2b-256 50262383708be4cb70425ebfbd798249cd5f4b8dd1d9cd90b47d00829ac9e068

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