Skip to content

Commit 5f03b46

Browse files
committed
Fix request package and update to Carbone API v5
1 parent c03d320 commit 5f03b46

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### v1.1.0
2+
- Fixed: Added "requests" as required install.
3+
- Update to Carbone version 5
4+
15
### v1.0.8
26
- Add function `set_api_url` to set the Carbone API URL
37

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
# Carbone Render Python SDK
1+
# Carbone Python SDK
2+
23
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/carboneio/carbone-sdk-python?style=for-the-badge&logo=python)](https://pypi.org/project/carbone-sdk)
34
[![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg?style=for-the-badge)](./API-REFERENCE.md)
45

5-
6-
Python SDK to use Carbone Render easily.
6+
Generate Documents in Python: Seamless Integration with Carbone API.
77

88
## About Carbone
99

10-
Carbone is a powerful document generator (PDF, DOCX, XLSX, ODT, PPTX, ODS, XML, CSV...) using templates and JSON data. It is based on LibreOffice and can convert any document. It is also possible to convert HTML to PDF. Learn more about [supported files and features](https://carbone.io/documentation.html#supported-files-and-features-list).
10+
Carbone is a document generator that utilizes Templates and JSON data to create a wide range of file formats, including PDF, DOCX, XLSX, ODT, PPTX, ODS, XML, CSV, and more. With Carbone, you can produce professional, high-quality, rich reports without limitations and streamline document creation processes across all industries:
11+
- **For Organizations**: Effortlessly generate contracts, agreements, invoices, receipts, financial statements, marketing materials, employment contracts, NDAs, training manuals, and compliance documents.
12+
- **For Governments**: Create legislation and regulations, policy documents, budget reports, permits and licenses, public records, certificates, audit reports, and health and safety regulations with ease.
13+
- **For Finance**: Produce budget reports, tax returns, investment portfolios, loan agreements, audit reports, insurance policies, and financial forecasts efficiently.
14+
- **For Health**: Generate medical records, prescriptions, medical certificates, lab reports, and health insurance claims seamlessly.
15+
16+
Learn more about [Carbone](https://carbone.io) and [Supported files and features](https://carbone.io/documentation.html#supported-files-and-features-list).
1117

1218
### 🔖 [API REFERENCE](./API-REFERENCE.md)
1319

@@ -64,7 +70,7 @@ render_options = {
6470
# https://carbone.io/api-reference.html#pdf-export-filter-options
6571
}
6672

67-
# Render and return the report as bytes and a unique report name
73+
# Generate and return the document as bytes and a unique report name
6874
report_bytes, unique_report_name = csdk.render(template_id, render_options)
6975
fd = open(unique_report_name, "wb")
7076
fd.write(report_bytes)
@@ -94,8 +100,7 @@ $ make uninstall
94100
### Tests - Run manually
95101
Install:
96102
```
97-
$ pip install pytest
98-
$ pip install requests_mock
103+
$ pip install -r requirements.txt
99104
```
100105

101106
To run all the test (-v for verbose output):

carbone_sdk/carbone_sdk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import mimetypes
66

77
class CarboneSDK:
8-
'Carbone SDK class used to call Carbone Render easily'
8+
'Carbone SDK class used to call Carbone API easily'
99

1010
def __init__(self, api_token = None):
1111
if ('CARBONE_TOKEN' in os.environ):
@@ -16,7 +16,7 @@ def __init__(self, api_token = None):
1616
self._api_timeout = 60
1717
self._api_headers = {
1818
"Authorization": "Bearer " + api_token,
19-
"carbone-version": "4"
19+
"carbone-version": "5"
2020
}
2121

2222
def add_template(self, template_file_name = None, salt = ""):

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
requests
12
pytest
23
requests_mock

setup.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
setuptools.setup(
77
name="carbone-sdk",
8-
version="1.0.8",
8+
version="1.1.0",
99
author="CarboneIO",
1010
author_email="support@carbone.io",
11-
description="Carbone API Python SDK to generate documents (PDF, docx, xlsx, ods, odt, ...) from a JSON and a template.",
11+
description="Carbone API Python SDK to generate documents (PDF DOCX XLSX PPTX CSV XML HTML ODS ODT and more) from a JSON and a template.",
1212
long_description=long_description,
1313
long_description_content_type="text/markdown",
1414
url="https://github.com/carboneio/carbone-sdk-python",
@@ -19,5 +19,8 @@
1919
"Operating System :: OS Independent",
2020
],
2121
python_requires='>=3.6',
22-
license='Apache-2.0'
22+
license='Apache-2.0',
23+
install_requires=[
24+
'requests',
25+
]
2326
)

0 commit comments

Comments
 (0)