borb


Nameborb JSON
Version 2.1.25 PyPI version JSON
download
home_pagehttps://github.com/jorisschellekens/borb
Summaryborb is a library for reading, creating and manipulating PDF files in python.
upload_time2024-08-03 11:43:30
maintainerNone
docs_urlNone
authorJoris Schellekens
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements cryptography fonttools Pillow python-barcode qrcode requests setuptools
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# ![borb logo](https://github.com/jorisschellekens/borb/raw/master/logo/borb_64.png) borb


[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Corpus Coverage : 100.0%](https://img.shields.io/badge/corpus%20coverage-100.0%25-green)]()
[![Text Extraction : 93.1%](https://img.shields.io/badge/text%20extraction-93.1%25-green)]()
[![Public Method Documentation : 100%](https://img.shields.io/badge/public%20method%20documentation-100%25-green)]()
[![Number of Tests : 760](https://img.shields.io/badge/number%20of%20tests-760-green)]()
[![Python : 3.8 | 3.9 | 3.10 ](https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10-green)]()
[![Type Checking : 98%](https://img.shields.io/badge/type%20checking-98%25-green)]()


[![Downloads](https://pepy.tech/badge/borb)](https://pepy.tech/project/borb)
[![Downloads](https://pepy.tech/badge/borb/month)](https://pepy.tech/project/borb)

`borb` is a library for creating and manipulating PDF files in python.

## 0. About borb

`borb` is a pure python library to read, write and manipulate PDF documents. 
It represents a PDF document as a JSON-like datastructure of nested lists, dictionaries and primitives (numbers, string, booleans, etc)

This is currently a one-man project, so the focus will always be to support those use-cases that are more common in favor of those that are rare.

## 1. About the Examples

The examples can be found in a separate repository.
This ensures the `borb` repository stays relatively small, whilst still providing a thorough knowledgebase of code-samples, screenshots and explanatory text.

[Check out the examples repository here!](https://github.com/jorisschellekens/borb-examples)

They include; 

- Reading a PDF and extracting meta-information
- Changing meta-information  
- Extracting text from a PDF
- Extracting images from a PDF
- Changing images in a PDF
- Adding annotations (notes, links, etc) to a PDF
- Adding text to a PDF
- Adding tables to a PDF
- Adding lists to a PDF
- Using a PageLayout manager

 and much more
 
### 1.0 Installing `borb`

`borb` can be installed using `pip`

    pip install borb

If you have installed `borb` before, and you want to ensure `pip` downloads the latest version (rather than using its internal cache) you can use the following commands:

    pip uninstall borb
    pip install --no-cache borb

### 1.1 Hello World

To give you an immediate idea of the way `borb` works, 
this is the classic `Hello World` example, in `borb`:

```python
from pathlib import Path

from borb.pdf import Document
from borb.pdf import Page
from borb.pdf import SingleColumnLayout
from borb.pdf import Paragraph
from borb.pdf import PDF

# create an empty Document
pdf = Document()

# add an empty Page
page = Page()
pdf.add_page(page)

# use a PageLayout (SingleColumnLayout in this case)
layout = SingleColumnLayout(page)

# add a Paragraph object
layout.add(Paragraph("Hello World!"))
    
# store the PDF
with open(Path("output.pdf"), "wb") as pdf_file_handle:
    PDF.dumps(pdf_file_handle, pdf)
```

## 2. License

`borb` is dual licensed as AGPL/Commercial software.

AGPL is a free / open source software license.
This doesn't mean the software is [gratis](https://en.wikipedia.org/wiki/Gratis_versus_libre)!

Buying a license is mandatory as soon as you develop commercial activities distributing the borb software inside your product or deploying it on a network without disclosing the source code of your own applications under the AGPL license. 
These activities include:

- Offering paid services to customers as an ASP
- Serving PDFs on the fly in the cloud or in a web application
- Shipping `borb` with a closed source product

[Contact sales](https://borbpdf.com/) for more information.

## 3. Acknowledgements

I would like to thank the following people, for their contributions / advice with regards to developing `borb`:
- Aleksander Banasik
- BenoƮt Lagae
- Michael Klink

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jorisschellekens/borb",
    "name": "borb",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Joris Schellekens",
    "author_email": "joris.schellekens.1989@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a1/f7/8efd8bbb1ae2c63bc62e1869c1edf312b7411c15c76f9a3058384ed89554/borb-2.1.25.tar.gz",
    "platform": null,
    "description": "\n# ![borb logo](https://github.com/jorisschellekens/borb/raw/master/logo/borb_64.png) borb\n\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Corpus Coverage : 100.0%](https://img.shields.io/badge/corpus%20coverage-100.0%25-green)]()\n[![Text Extraction : 93.1%](https://img.shields.io/badge/text%20extraction-93.1%25-green)]()\n[![Public Method Documentation : 100%](https://img.shields.io/badge/public%20method%20documentation-100%25-green)]()\n[![Number of Tests : 760](https://img.shields.io/badge/number%20of%20tests-760-green)]()\n[![Python : 3.8 | 3.9 | 3.10 ](https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10-green)]()\n[![Type Checking : 98%](https://img.shields.io/badge/type%20checking-98%25-green)]()\n\n\n[![Downloads](https://pepy.tech/badge/borb)](https://pepy.tech/project/borb)\n[![Downloads](https://pepy.tech/badge/borb/month)](https://pepy.tech/project/borb)\n\n`borb` is a library for creating and manipulating PDF files in python.\n\n## 0. About borb\n\n`borb` is a pure python library to read, write and manipulate PDF documents. \nIt represents a PDF document as a JSON-like datastructure of nested lists, dictionaries and primitives (numbers, string, booleans, etc)\n\nThis is currently a one-man project, so the focus will always be to support those use-cases that are more common in favor of those that are rare.\n\n## 1. About the Examples\n\nThe examples can be found in a separate repository.\nThis ensures the `borb` repository stays relatively small, whilst still providing a thorough knowledgebase of code-samples, screenshots and explanatory text.\n\n[Check out the examples repository here!](https://github.com/jorisschellekens/borb-examples)\n\nThey include; \n\n- Reading a PDF and extracting meta-information\n- Changing meta-information  \n- Extracting text from a PDF\n- Extracting images from a PDF\n- Changing images in a PDF\n- Adding annotations (notes, links, etc) to a PDF\n- Adding text to a PDF\n- Adding tables to a PDF\n- Adding lists to a PDF\n- Using a PageLayout manager\n\n and much more\n \n### 1.0 Installing `borb`\n\n`borb` can be installed using `pip`\n\n    pip install borb\n\nIf you have installed `borb` before, and you want to ensure `pip` downloads the latest version (rather than using its internal cache) you can use the following commands:\n\n    pip uninstall borb\n    pip install --no-cache borb\n\n### 1.1 Hello World\n\nTo give you an immediate idea of the way `borb` works, \nthis is the classic `Hello World` example, in `borb`:\n\n```python\nfrom pathlib import Path\n\nfrom borb.pdf import Document\nfrom borb.pdf import Page\nfrom borb.pdf import SingleColumnLayout\nfrom borb.pdf import Paragraph\nfrom borb.pdf import PDF\n\n# create an empty Document\npdf = Document()\n\n# add an empty Page\npage = Page()\npdf.add_page(page)\n\n# use a PageLayout (SingleColumnLayout in this case)\nlayout = SingleColumnLayout(page)\n\n# add a Paragraph object\nlayout.add(Paragraph(\"Hello World!\"))\n    \n# store the PDF\nwith open(Path(\"output.pdf\"), \"wb\") as pdf_file_handle:\n    PDF.dumps(pdf_file_handle, pdf)\n```\n\n## 2. License\n\n`borb` is dual licensed as AGPL/Commercial software.\n\nAGPL is a free / open source software license.\nThis doesn't mean the software is [gratis](https://en.wikipedia.org/wiki/Gratis_versus_libre)!\n\nBuying a license is mandatory as soon as you develop commercial activities distributing the borb software inside your product or deploying it on a network without disclosing the source code of your own applications under the AGPL license. \nThese activities include:\n\n- Offering paid services to customers as an ASP\n- Serving PDFs on the fly in the cloud or in a web application\n- Shipping `borb` with a closed source product\n\n[Contact sales](https://borbpdf.com/) for more information.\n\n## 3. Acknowledgements\n\nI would like to thank the following people, for their contributions / advice with regards to developing `borb`:\n- Aleksander Banasik\n- Beno\u00eet Lagae\n- Michael Klink\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "borb is a library for reading, creating and manipulating PDF files in python.",
    "version": "2.1.25",
    "project_urls": {
        "Homepage": "https://github.com/jorisschellekens/borb"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "57fda270259e391e5e8a76cf28694c8a1ee01d2194b2bf9d6aa72eabb3c021f8",
                "md5": "6d02e01d3398b4a89df6d9c03b6e4750",
                "sha256": "708c6b14d298890d75567cda15027d874d818e533089d88637831e495f489088"
            },
            "downloads": -1,
            "filename": "borb-2.1.25-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6d02e01d3398b4a89df6d9c03b6e4750",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 12323441,
            "upload_time": "2024-08-03T11:43:27",
            "upload_time_iso_8601": "2024-08-03T11:43:27.352124Z",
            "url": "https://files.pythonhosted.org/packages/57/fd/a270259e391e5e8a76cf28694c8a1ee01d2194b2bf9d6aa72eabb3c021f8/borb-2.1.25-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a1f78efd8bbb1ae2c63bc62e1869c1edf312b7411c15c76f9a3058384ed89554",
                "md5": "834fb6541c284789c1cd1337f805672a",
                "sha256": "813a25227b96f471d29244bf3c07a7b3df36d61d62bcbecf45b14944b8011ef4"
            },
            "downloads": -1,
            "filename": "borb-2.1.25.tar.gz",
            "has_sig": false,
            "md5_digest": "834fb6541c284789c1cd1337f805672a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 11589747,
            "upload_time": "2024-08-03T11:43:30",
            "upload_time_iso_8601": "2024-08-03T11:43:30.403529Z",
            "url": "https://files.pythonhosted.org/packages/a1/f7/8efd8bbb1ae2c63bc62e1869c1edf312b7411c15c76f9a3058384ed89554/borb-2.1.25.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-03 11:43:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jorisschellekens",
    "github_project": "borb",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "cryptography",
            "specs": [
                [
                    ">=",
                    "41.0.1"
                ]
            ]
        },
        {
            "name": "fonttools",
            "specs": [
                [
                    ">=",
                    "4.38.0"
                ]
            ]
        },
        {
            "name": "Pillow",
            "specs": [
                [
                    "==",
                    "9.5.0"
                ]
            ]
        },
        {
            "name": "python-barcode",
            "specs": [
                [
                    ">=",
                    "0.14.0"
                ]
            ]
        },
        {
            "name": "qrcode",
            "specs": [
                [
                    ">=",
                    "6.1"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.31.0"
                ]
            ]
        },
        {
            "name": "setuptools",
            "specs": [
                [
                    ">=",
                    "68.0.0"
                ]
            ]
        }
    ],
    "lcname": "borb"
}
        
Elapsed time: 0.30077s