Skip to main content

Converts ReStructuredText into JSON.

  • Sections are JSON list dictionary elements

  • Section Headers become list titles.

  • Field definitions become key/value representations.

  • Directives are ignored.

Example

Input

Python
------
:age: 22
:typing: dynamic, strong

Java
----
:age: 18
:typing: static, strong

Output

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

Usage

$ 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"
    }
]

Best Used With

Simplicity is designed to be used with these packages:

  • Complexity: A refreshingly simple static site generator, for those who like to work in HTML.

  • redis-py: Redis Python Client

Know of any other good uses for Simplicity? Let me know and I’ll add it to the list!

Examples

History

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

Release files for simplicity 0.6.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simplicity 0.6.4
File Size Uploaded
simplicity-0.6.4.tar.gz 5.1 kB Details

Release files / simplicity-0.6.4.tar.gz

Download URL simplicity-0.6.4.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3d3d3fe3f1bbafcc7fe0c9a0dc42dccda7a7326906d85e1c93a0bebd77428fce
BLAKE2b-256 checksum
How to use checksums
36e0f41dc2f8c9b30f0af45fa1626c6180f4e2e65423240d877bbb56747b2a52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.6.4 This release

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

0.6.0

0.5.1

1 release file

0.5.0

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page