Skip to main content

Converts ReStructuredText into JSON

Project description

Converts ReStructuredText into JSON.

  • Sections are JSON list dictionary elements

  • Section Headers become list titles.

  • Field definitions become key/value representations

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.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

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

simplicity-0.6.2.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file simplicity-0.6.2.tar.gz.

File metadata

  • Download URL: simplicity-0.6.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for simplicity-0.6.2.tar.gz
Algorithm Hash digest
SHA256 efeb2f02b24c41ad7746be66b27c1216f3b27864b360010830ad0acba85edc0e
MD5 356729eeaf3ef5010446ced921d219c8
BLAKE2b-256 f85274cc15f8045fc730b23ce2fa3158d4681a68bf0c35891bd33e26f295e418

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page