Skip to main content

A portable, extensible BB Code parser written by Condé Nast Britain

Hello, World!

from bbcondeparser import BaseTag, BaseTreeParser

class ExcitedTag(BaseTag):
    tag_name = 'excite'

    def _render(self):
        child_text = self.render_children()
        return '<b><i>{}</i></b>'.format(child_text)

class Parser(BaseTreeParser):
    tags = [ExcitedTag]


parsed = Parser("[excite]Hello, World![/excite]")

print(parsed.render())
>>> python hello_world.py
<b><i>Hello, World!</i></b>
>>>

Documentation

Further documentation is in the works, and will be present on the github page.

Release files for bbcondeparser 1.1.0

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

Source distribution (sdist)

Source distribution for bbcondeparser 1.1.0
File Size Uploaded
bbcondeparser-1.1.0.tar.gz 19.0 kB Details

Release files / bbcondeparser-1.1.0.tar.gz

Download URL bbcondeparser-1.1.0.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
891b3df2417d2e21049069008dd25c4fdede3ea171a85c8adc66d909f868c641
BLAKE2b-256 checksum
How to use checksums
5e93971aed9c21728e0fb1c80b8adc711f199ea8f7c8249e37f4f15b6f3ba79e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/2.7.16

Release history Release notifications | RSS feed

This release

1.1.0 This release

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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