一个CLI工具来可视化你的meme

memethesis的Python项目详细描述


膜促性腺激素

Upload Python Package

3.0.0-beta版更新

自动化已经达到了一个新的水平,其中all现有的格式都是完整的 由memethesizers为其各自的成分自动生成, 包括singlevertical和{}。 添加新格式比以往任何时候都容易, 这就是为什么本次回购对新形式的发行和公关开放, 而不是作者为他们每一个写新的脚本,因为 每个人的精力都有限。 如果您想要一个新的格式,并能负担得起时间和精力来提供 数据,请打开PR; 如果不能,请打开一个问题。 前一类投稿人应该关注这些问题, 尽可能的帮助他们。在

帮助

安装

$ cd ~ # use $HOME
$ git clone https://github.com/fakefred/memethesis-cli # will clone the git repo
$ cd memethesis-cli # will go into directory
$ python3 setup.py bdist_wheel  # will generate .whl
$ pip3 install dist/memethesis* # will install the newly-created memethesis.whl created above

用法

This part assumes you have a working python 3.x environment, which python refers to. If your OS uses python3, you are smart enough.

^{pr2}$

新格式指南

cd到{}。创建一个以 模因。在您创建的目录中创建format.yml。在

formats.yml

规范文档

# Keywords wrapped in <square brackets> are to be modified on demand;
# others are hardcoded. Starred (*) keywords are optional.
<name>:  # The flag you use for the meme format
# For example, if you name it 'drake' it is accessed via '-f drake'
  composition: vertical|horizontal|single
  # Denotes how the meme is made: stacked top to bottom,
  # laid side by side, or a single panel
  # Respective examples: drake, womanyelling, pigeon
  panels:
    # ^ When composition == 'single', things put here
    # are textboxes instead of panels, which are pasted on one panel
    <name>:  # < Flag for this panel/textbox
    # For example, if you named your panel/textbox 'dislike'
    # it is accessed via '--dislike <text>'
    # Make your panel/textbox as unique as possible,
    # and if you can, make it short and descriptive.
    # IMPORTANT: flag names CAN collide. Make your flag different from
    # all others.
      description*: <description>
      # ^ Shown in --list and, if the composition is not single,
      # in --interactive
      image: <dir>/<image>
      # ^ Image path relative to ./memethesis/meme/res/template/
      textbox: [370, 12, 400, 250]
      # ^ Textbox position, in left, top, width, height
      font*: notosans|notosansmono|impact|comicsans
      # ^ Default font for the template
      # (memethesis assumes notosans if none; see `fonts.py`)
      # Overridden when '--font' is specified in command mode
      style*: stroke
      # ^ Use 'stroke' if default font is impact for best effects
    <name>:
      # ...
    # ...
<name>:  # You can combine multiple templates into one dir,
# but only do that when they're relevant and inseparable
# ...

示例

下面是一个来自drake格式的测试示例:

drake:
  composition: vertical
  panels:
    dislike:
      description: Drake dislike
      image: drake/drake_dislike.jpg
      textbox: [370, 12, 400, 250]
    like:
      description: Drake like
      image: drake/drake_like.jpg
      textbox: [370, 20, 400, 250]

以下是一些要点:

  • 使目录和文件与其他或潜在的目录和文件区分开来: 例如,spiderman作为meme格式的一个很差的标识符,因为有无数蜘蛛侠的meme。在
  • 保持图像分辨率适度高。800像素宽就够了。 不要放大太多。在
  • 不要在文件名和yml关键字中包含空格。在
  • 除非有必要,否则使用资本。在
  • 在打开一个PR之前进行测试。通过长时间的输入来确保文本框是正确的 像'mm mm mm mm mm mm mm mm mm mm mm mm mm mm mm mm'这样的字符串。 我会克隆你的叉子然后亲自测试。在
  • 如果确保测试通过,请添加用于测试格式的命令 test.sh在项目的根目录中。在

调试

[make edits]# to test by running module
$ python -m memethesis.__main__ [args]# to test all formats with shell script
$ sudo chmod +x test.sh
$ ./test.sh
# to test by installing wheel
$ python setup.py bdist_wheel  # will generate .whl
$ pip install dist/memethesis-[something].whl

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用Jackson解析非同构JSON对象数组   java为什么'Stream<T>::<A>toArray(IntFunction<A[]>)`接受没有绑定的类型参数A?   java在JavaFX2.0中获取给定布局中的节点大小?   java双链接列表创建节点   java使用HashMap添加、删除和查找   java中push_back(C++)的等效方法是什么?   java在Jetty中运行servlet时获得HTTP 500   用java显示包含图像和文本的页面的最简单文档格式   swing从选项卡窗格Java中的不同选项卡访问数据   字符串Java帮助检查登录类使用。CSV文件   java Struts 1.2.9动作链接   包含max元素的java列表   currentNode上的jcr Java空检查   在Android中使用OpenNLP的POSTaggerMe时出现java NullPointerException   java Logback只将消息记录到syslog一次   如何用Java编写构造函数的API文档   java从gallery中获取所有图像并存储在阵列中   java Maven:将外部jar文件夹添加到类路径