Quipus, data retrieval, template manager and delivery all in one!
Documentation: TBD
Source Code: https://github.com/Monkey-Market/quipus
Quipus is a Python package that allows you to retrieve data from different sources, manage templates and deliver them in a single package. It is designed to be simple and easy to use, with a focus on performance and reliability.
Key features:
- Data retrieval: Retrieve data from different sources such as databases, APIs, and files.
- Template manager: Manage templates for different types of documents.
- Delivery: Deliver the generated documents to different destinations such as email, file system, cloud storage and more.
- Easy to use: Simple and easy to use package with a focus on developer experience.
Requirements & Dependencies
Quipus is empowered by the foundational work of industry giants. The following are the key dependencies:
- Pandas for data manipulation.
- WeasyPrint for document generation.
- Boto3 for AWS cloud storage.
Installation
You can install Quipus using pip:
pip install quipus
Or with poetry:
poetry add quipus
Usage Example
Import the package
import quipus as qp
Fetch data from CSV and generate PDFs
template_manager = (
qp.TemplateManager()
.from_csv("data/data_source.csv")
.with_template(qp.Template("templates/pdf_template.html"))
.decide_filename_with(lambda data: f"{data['name']}")
.to_pdf(output_path="output", create_dir=True)
)
Set up SMTP configuration
Note: These can be set up as environment variables for security reasons.
smtp_config = qp.SMTPConfig(
server="smtp.server.com",
port=587,
username="username",
password="password",
use_tls=True,
)
email_sender = qp.EmailSender(smtp_config)
Send emails with attachments
for item in template_manager.data:
smtp_message = (
qp.EmailMessageBuilder(
from_address="example@sender.com",
to_addresses=[item["email"], "another_email@example.com"]
)
.with_body_path("templates/email_body_template.html", "html", item)
.with_subject("Your email subject")
.add_attachment_from_path(f"output/{item['name']}.pdf")
.build()
)
email_sender.send(smtp_message)
This is a simple example of how you can use Quipus to fetch data from a CSV file, generate PDFs using a template, and send emails with the generated PDFs as attachments.
Contributing
Contributions are welcome! Please read our contributing guidelines for more information.
You can always open an issue or submit a pull request if you have any suggestions or improvements.
Contributors
|
Jorge U. Alarcón |
Fernando Nicolás |
Trivia
The name "Quipus" comes from the Quechua word "khipu" which refers to a method used by the Incas to keep records and communicate information through a system of knots and strings.
We thought it was a fitting name for a package that helps you manage and deliver data in a structured and organized way.
You can read more about it in this wikipedia page.
License
This project is licensed under the terms of the GNU General Public License v3.0.
Metadata
Release files for quipus 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| quipus-0.4.0.tar.gz | 39.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| quipus-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 88.1 kB
Release files / quipus-0.4.0.tar.gz
| Download URL | quipus-0.4.0.tar.gz |
|---|---|
| Size | 39.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36cd1bd85c7d2ef8aecf53d909a25b97af22982007f3d9dfa73ef0ff896c612d
|
|
BLAKE2b-256 checksum How to use checksums |
e266da72c4c10273d116196564869923ebd1218a6b0ab6a012676d18c5229373
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.12.9 Linux/6.8.0-1021-azure
|
Release files / quipus-0.4.0-py3-none-any.whl
| Download URL | quipus-0.4.0-py3-none-any.whl |
|---|---|
| Size | 49.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad9218da25b1c09d87158266351ea4ebd4982ddda89762083f79d3fd9e41dc79
|
|
BLAKE2b-256 checksum How to use checksums |
94544845fcddc312da80da6f8e80f048251e583ce90b287a9a766cd6429410ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.12.9 Linux/6.8.0-1021-azure
|