Skip to main content

Requirements

You need to have an account in pingen and obtain oauth credentials for your desired grant type (usually client_credentials).

How to obtain these are described here: https://api.pingen.com/documentation#section/Authentication/How-to-obtain-a-Client-ID

Python 3.10+

Installation

You don't need this source code unless you want to modify the package. If you just want to use the package, just run:

pip install --upgrade pingen2sdk

Environments

We have two Environments available: Production and Staging (see https://api.pingen.com/documentation#section/Basics/Environments)

This SDK supports staging as well. When initiating the resource (see Usage), the optional 'staging' attribute should be set, as well as when creating an endpoint object.

Usage

The simplest way to integrate is using the client credentials grant (see https://api.pingen.com/documentation#section/Authentication/Which-grant-type-should-i-use)

import pingen2sdk

pingen2sdk.client_id = "YOUR_CLIENT_ID"
pingen2sdk.client_secret = "YOU_SECRET"

resp = pingen2sdk.OAuth.get_token(
    use_staging=True,
    grant_type="client_credentials",
    scope="letter batch webhook organisation_read",
)

access_token = resp["access_token"]

organisationList = pingen2sdk.Organisations(access_token, True).get_collection()

organisation_id = organisationList.data["data"][0]["id"]

LettersEndpoint = pingen2sdk.Letters(organisation_id, access_token, True)

response = LettersEndpoint.upload_and_create(
    "./letter.pdf",
    "sdk.pdf",
    "left",
    False,
    "fast",
    "simplex",
    "color",
)

letter_id = response.data["data"]["id"]

Examples & Docs

Our API Docs are here: https://api.pingen.com/documentation

On the right-hand side of every endpoint you can see request samples for Python and other languages, which you can copy and paste into your application.

Bugreport & Contribution

If you find a bug, please either create a ticket in github, or initiate a pull request.

Versioning

We adhere to semantic (major.minor.patch) versioning (https://semver.org/). This means that:

  • Patch (x.x.patch) versions fix bugs
  • Minor (x.minor.x) versions introduce new, backwards compatible features or improve existing code.
  • Major (major.x.x) versions introduce radical changes which are not backwards compatible.

In your automation or procedure you can always safely update patch & minor versions without the risk of your application failing.

Testing

Run all tests for a specific Python version (modify -e according to your Python target):

tox -e py312

Run the linter with:

tox -e lint

The library uses Black for code formatting. Code must be formatted with Black before PRs are submitted, otherwise CI will fail. Run the formatter with:

tox -e fmt

Metadata

Release files for pingen2sdk 2.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 pingen2sdk 2.2.0
File Size Uploaded
pingen2sdk-2.2.0.tar.gz 19.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pingen2sdk 2.2.0
File Interpreter ABI Platform
pingen2sdk-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.1 kB

Release files / pingen2sdk-2.2.0.tar.gz

Download URL pingen2sdk-2.2.0.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7eac413c518f66c11937ed4f7ed343d3f46ac3a6a2753d3effa47d70dcca7a39
BLAKE2b-256 checksum
How to use checksums
ec23d0837c678340a929d98876ff30b1cda829c496d8220aaf73584a5061c9e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / pingen2sdk-2.2.0-py3-none-any.whl

Download URL pingen2sdk-2.2.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a3874fb891adad6578600b347e6adccea426ecdc3dabccb38b50bea80afa0b9
BLAKE2b-256 checksum
How to use checksums
0def109f4b044ebe9f0fce709ecce127b8de7b7d8cc08c0618f238c9167d6507
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.0

2 release files

2.0.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.2.0

2 release files

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