将structuredText转换为json

simplicit的Python项目详细描述


将structuredText转换为json。

  • 是json列表字典元素
  • 节标题成为列表标题。
  • field定义成为键/值表示。
  • 指令被忽略。

示例

输入

Python------:age:22:typing:dynamic, strongJava----:age:18:typing:static, strong

输出

[{"title":"Python","age":22,"typing":"dynamic, strong"}{"title":"Java","age":18,"typing":"static, strong"}]

用法

$ git clone git@github.com:pydanny/simplicity.git
$ cd simplicity/
$ python simplicity.py sample.rst
[{"description": "A fun programming language.\n\nUsed to build simplicity!",
        "title": "Python",
        "price": 0.0,
        "typing": "dynamic, strong",
        "age": 22,
        "mascot": "snake"},
    {"age": 18,
        "typing": "static, strong",
        "mascot": "???",
        "title": "Java"},
    {"url": "https://github.com",
        "mascot": "Octocat",
        "title": "GitHub"}]

最好与

一起使用

简单性设计用于这些软件包:

  • Complexity:一个令人耳目一新的简单静态站点生成器,适合那些喜欢使用html的人。
  • redis-py:redis python客户端

知道简单的其他好用途吗?告诉我,我会把它加入名单的!

示例

历史

0.6.4(2014-01-29)

  • Handle case where the key is not in the dict (thanks @greatdesignisnotenough)

0.6.3(2013-11-12)

  • Handles RST directives gracefully (ignores them)

0.6.2(2013-07-25)

  • Fixes the problem with normal text after field definitions.

0.6.1(2013-07-23)

  • Better multi-line string support
  • Fixed some Python 3 issues
  • Added tests!

0.6.0(2013-07-19)

  • Support for multi-line strings

0.5.1(2013-07-16)

  • Fighting poorly documented setup.py issues. :P

0.5.0(2013-07-16)

  • API Change for easier-to-navigate result data

0.4.2(2013-07-15)

  • Fix console script entry point

0.4.1(2013-07-15)

  • History update

0.4.0(2013-07-15)

  • added type converter

0.3.0(2013-07-15)

  • Accepts command-line argument

0.2.0(2013-07-15)

  • Working prototype

0.1.0(2013-07-15)

  • Pain point
  • Inspiration

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

推荐PyPI第三方库


热门话题
graph Java自己生成类图   java MouseMotionListener:鼠标和触控板给出不同的结果   java解析清单条目的正确方法是什么。jar中的mf文件?   java如何创建带有半透明色块的透明gif/png图像?   java应用内计费V3:跨设备同步购买   java Spring数据JPA注入失败BeanCreationException:无法自动连接字段   Java数据结构维护插入顺序和重复值   java无法在VSCode中设置JavaFX   java中数据字段初始化的类顺序   java如何使用ClientBuilder为Rest Post Api多部分编写集成测试   JUnit测试divide()方法的java正确方法   java将消息标记为接收前已读   Java ArrayList调用扩展对象函数   java Android:只使用GCM的TCP/IPServer   Java如何将xls数据转换为txt文件   编译为Jar文件后未找到java类   java返回子字符串的所有匹配项   java Get json用户_timeline api twitter 1.1