Skip to main content

S3PdfSplitter Build Status Coverage Status PyPI version PyPI - Python Version

Python aws-s3 pdf spliter

Usage

basic usage :

from PdfSplitter import Splitter

spliter = Splitter("config.json")
spliter.split(data)

exemple config.json :

{
    "aws" : {
        "access_key_id" : "aws-acces-key",
        "secret_access_key" : "aws secret",
    },
    "s3" : {
        "bucket" : "bucket"
    }
}

Note that the config is managed with ConfigEnv so you can provide an .ini file or overide the config with environement variable ( AWS_S3_BUCKET, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY )

example data :

{
    "input" : [
        "firstFile.pdf",
        "secondFile.pdf",
        "http://urlFile.pdf"
    ],
    "output": [
        {
            "s3Key": "output1.pdf",
            "pages": [
                { "index": 0, "pages": [0,1] },
                { "index": 1, "pages": [0,1] }
            ]
        },{
            "s3Key": "output2.pdf",
            "pages": [
                { "index": 0, "pages": [0] },
                { "index": 1, "pages": [0] },
                { "index": 0, "pages": [1] },
                { "index": 1, "pages": [1] }
            ]
        }
    ]
}

this will produce 2 pdfs in your s3:

  • the first, output1.pdf, with page 0 and 1 from firstFile and page 0 and 1 from secondFile
  • the second, output2.pdf, with page 0 from firstFile, page 0 from secondFile, page 1 from firstFile and page 1 from secondFile

Developpement guide

installation

with virtualenv :

# create virtualenv
virtualenv -p python3 .venv

# activate venv
source .venv/bin/activate

# install dependancies
pip install -r requirements.txt
pip install -r requirements-dev.txt

testing

with unittest :

# if your test config is setup :
python -m unittest

# if you want to overide your test config :
S3_BUCKET=<your bucket> AWS_ACCESS_KEY_ID=<your key id> AWS_SECRET_ACCESS_KEY=<your key secret> python -m unittest

Metadata

Release files for S3PdfSplitter 1.2.0

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

Source distribution (sdist)

Source distribution for S3PdfSplitter 1.2.0
File Size Uploaded Provenance Actions
S3PdfSplitter-1.2.0.tar.gz 3.0 kB Without provenance Details for S3PdfSplitter-1.2.0.tar.gz

Release files / S3PdfSplitter-1.2.0.tar.gz

Download URL S3PdfSplitter-1.2.0.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
67949c6ff2a73b1665076cf9a29e8e1d4d97b9f1c38f2c93f506729e0b9e02ba
BLAKE2b-256 checksum
How to use checksums
cec5196f42ee7dc0f5d9fb6066284edfef754211c3b34e82c750cb8d397a7925
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/47.3.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.5.6

Security for S3PdfSplitter 1.2.0

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.

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