Skip to main content
Release file added late

1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.

Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 1.1.0 instead.
Reason given by maintainers: changed versioning format. 0.2.0 is this with type-hint support. Additional updates will be published under the new version-number format

paragraphs

Incorporate long strings painlessly, beautifully into Python code.

Examples

Easily edited, gq-able, fill-paragraph-able, comprehensive error messages.

from paragraphs import par

class SuddenDeathError(Exception):
    def __init__(self, cause: str) -> None:
        self.cause = cause

    def __str__(self):
        return par(
            f"""
            Y - e - e - e - es, Lord love you! Why should she die of
            {self.cause}? She come through diphtheria right enough the year
            before.I saw her with my own eyes.Fairly blue with it, she was.They
            all thought she was dead; but my father he kept ladling gin down
            her throat til she came to so sudden that she bit the bowl off the
            spoon. 

            What call would a woman with that strength in her have to die of
            {self.cause}?  What become of her new straw hat that should have
            come to me? Somebody pinched it; and what I say is, them as pinched
            it done her in."""
        )

raise SuddenDeathError("influenza")

Nicely-formatted long string data. Spoilers for some old novels here, but these ARE the original titles.

author2titles = {
    "Samuel Penhallow": [
        par(
            """
            The history of the wars of New-England with the Eastern Indians;
            or, a narrative of their continued perfidy and cruelty, from the
            10th of August, 1703, to the peace renewed 13th of July, 1713. And
            from the 25th of July, 1722, to their submission 15th December,
            1725, which was ratified August 5th, 1726"""
        )
    ],
    "Daniel Defoe": [
        par(
            """
            The Life and Strange Surprizing Adventures of Robinson Crusoe, Of
            York, Mariner: Who lived Eight and Twenty Years, all alone in an
            un-inhabited Island on the Coast of America, near the Mouth of the
            Great River of Oroonoque; Having been cast on Shore by Shipwreck,
            wherein all the Men perished but himself. With An Account how he
            was at last as strangely deliver'd by Pyrates"""
        ),
        par(
            """The Fortunes and Misfortunes of the Famous Moll Flanders Who was
            born in Newgate, and during a life of continu’d Variety for
            Threescore Years, besides her Childhood, was Twelve Years a Whore,
            five times a Wife (whereof once to her brother) Twelve Years a
            Thief, Eight Years a Transported Felon in Virginia, at last grew
            Rich, liv’d Honest and died a Penitent"""
        ),
    ],
}

Installation

pip install paragraphs

Use

from paragraphs import par

PARAGRAPH = par("""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
    do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
    minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
    ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
    velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
    cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
    est laborum.""")

# the above is equivalent to

PARAGRAPH = (
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"
    " tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim"
    " veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea"
    " commodo consequat. Duis aute irure dolor in reprehenderit in voluptate"
    " velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint"
    " occaecat cupidatat non proident, sunt in culpa qui officia deserunt"
    " mollit anim id est laborum.")

Features

Joins lines. Removes indentation and leading whitespace.

from paragraphs import par

par('''
    Lorem ipsum dolor
    sit amet,'''
)

# yields
Lorem ipsum dolor sit amet,

Separates paragraphs with double newline ('\n\n').

from paragraphs import par

par '''
    Lorem ipsum dolor
    sit amet,

    consectetur
    adipiscing
    elit'''

# yields
Lorem ipsum dolor sit amet,
<blankline>
consectetur adipiscing elit

Retains one trailing newline (if present).

>>> par('''retains one trailing newline
... ''')
retains one trailing newline
<blankline>

>>> par('''no trailing newline''')
no trailing newline

Metadata

Release files for paragraphs 1.0

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

File added late

1 file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for paragraphs 1.0
File Size Uploaded Provenance Actions
paragraphs-1.0.tar.gz 5.0 kB Without provenance Details for paragraphs-1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for paragraphs 1.0
File Interpreter ABI Platform Actions
paragraphs-1.0.0-py3-none-any.whl Python 3 none any Details for paragraphs-1.0.0-py3-none-any.whl
paragraphs-1.0-py3-none-any.whl Python 3 none any Details for paragraphs-1.0-py3-none-any.whl

Total release size: 15.0 kB

Release files / paragraphs-1.0.tar.gz

Download URL paragraphs-1.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
751d5b7abf17af1f5bc7f1e863a80cb0dd0f7640487866afe0f70a18683991ce
BLAKE2b-256 checksum
How to use checksums
6ccc1443240d9b362ed481717d168ec742472eaf940d1a32eebffcfcbb638dd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / paragraphs-1.0.0-py3-none-any.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL paragraphs-1.0.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f374606631fcedd16703dc7e3c301e28ba9b892f9b2820e6917a330a8a8dba1
BLAKE2b-256 checksum
How to use checksums
0e576e54de09e9732fb2e82a4b03ad9a6833f09c808c05150f8cab54d26871b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / paragraphs-1.0-py3-none-any.whl

Download URL paragraphs-1.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cafb01544531227e7f01f08a84905bb5fb3bc15c10a2a7dda0501375324e970
BLAKE2b-256 checksum
How to use checksums
040b78415378a25b227ffff23a0a169b4072daf16589100837f824b29da881d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Security for paragraphs 1.0

Upload timing

Release file added late

1 file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.


Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

3 release files No provenance

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