Skip to main content

Data retrieval, template manager and delivery all in one!

Project description

Quipus, data retrieval, template manager and delivery all in one!

Package version Supported Python versions Pylint


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:

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


License

This project is licensed under the terms of the GNU General Public License v3.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quipus-0.2.2.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

quipus-0.2.2-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file quipus-0.2.2.tar.gz.

File metadata

  • Download URL: quipus-0.2.2.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for quipus-0.2.2.tar.gz
Algorithm Hash digest
SHA256 09a4dc577092a32dd65ac304e215df5e5bd6de246de3aecb8f32bdac6825cd48
MD5 a701cedbd6b2ebbc6a8949513fcc0d04
BLAKE2b-256 3cce8ecd6e608d99397dce1277532d1b9058f2e86f7ad21b6b4ec2e6dd2f06a0

See more details on using hashes here.

File details

Details for the file quipus-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: quipus-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 36.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for quipus-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4cef5345a985329d0e5ac723abf32f8e8adb97c7421911b4e16bba2f48d2e230
MD5 ce246e24969a5f8419b2f8c6ea13e69b
BLAKE2b-256 1f17bb2534c066f102f420c8876c2ace58bd25e6256453872460c73a73406f26

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page