Skip to main content

Python 3 implementation for the PamFax API

Project description

a1pamfax

Python versions

Airport1's PamFax - short name a1pamfax - is a Python (3.6+) package that implements the PamFax API.

This is an adaption of Dynaptico PamFax (Python2) - once written for Python 2 - now adapted to work for Python 3.6 or later. The old code (and style) has been kept whenever possible, on purpose. The behavior should be nearly the same.

For more information about the PamFax API, visit: PamFax for Developers.

As this package is still in development, please report any bugs or issues by raising an issue in this Github repository.

This module is written for Python 3.6+ and has only been tested against Python 3.9. There is a big chance it works for previous versions, however, too.

Installation

You can install a1pamfax either via the Python Package Index (PyPI) or from source.

To install the latest version via pip:

pip install a1pamfax --upgrade

This is my first public package following the instructions on Python-Packaging. So far I included the test, test data (the former pdf file by dynaptico), a config example and a sample.

Requirements

It is required to install at least (e.g. via pip install requests):

  • requests

Tests

It is strongly recommended to use the sandbox environment ('sandbox-apifrontend') for testing. First copy the file config.example.py and rename it to config.py and fill in your credentials. Then run either the sample by:

python sample.py

or the test suite by:

cd test
python test.py

You may adapt the main method of test.py to en-/disable the tests you (dis)like.

Depending on the tests you run it might be required that you already received or sent something, e.g. in the sandbox environment. The online storage tests will partially be skipped if you did not authenticate for e.g. Dropbox before, this is intentionally.

Usage

There is also a sample.py provided, but in short: after logging in follow the PamFax Processors Documentation. E.g. Common::GetCurrentSettings is available as pamfax.get_current_settings() etc. Full example:

from config import HOST, USERNAME, PASSWORD, APIKEY, APISECRET
from pamfax import PamFax

pamfax = PamFax(USERNAME, PASSWORD, host=HOST, apikey=APIKEY, apisecret=APISECRET)
response = pamfax.get_current_settings()
print(response)

Documentation

There is no documentation for this package in Python 3 yet. But: the documentation for the older Python 2 implementation by dynaptico might be still available here: Dynaptico PamFax documentation (Python2)

and nearly all methods and signatures have been kept ON PURPOSE, just adapted for Python 3. Only few private methods were changed.

See also section Particularities.

Integrity

All methods in the PamFax API should be implemented by this package, except the ones introduced after Dynaptico released his Python 2 version. Missing methods will be added, step by step.

Since v0.0.6 Dropbox methods are re-enabled and tested, plus missing methods for Common have been added.

Particularities

As said, the code is heavily based on an old package for Python 2. It was just adapted to run "the same" on Python 3. Intentionally nearly all methods and signatures have been kept, except the implementation might be different sometimes. So the code has only been touched where it was required, e.g. it's using now requests's session with a timeout of 30 seconds. I tried to stick to the coding style of dynaptico. However, few private methods had to be changed in their signature:

  • _get_and_check_response
  • _get
  • _post

Thanks

To Dynaptico, on which this rewrite for Python 3 is heavily based on, see: Dynaptico PamFax (Python2).

Packaging - small tutorial

In general check out Python-Packaging. For Windows do this:

python -m pip install --user --upgrade setuptools wheel

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

a1pamfax-0.0.7.tar.gz (70.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a1pamfax-0.0.7-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file a1pamfax-0.0.7.tar.gz.

File metadata

  • Download URL: a1pamfax-0.0.7.tar.gz
  • Upload date:
  • Size: 70.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for a1pamfax-0.0.7.tar.gz
Algorithm Hash digest
SHA256 86b60aa87ceb67be01df16acaa381ca7f1aba34095d4c8dd41f0d16793ea4d13
MD5 1bde6a7ed8af20578db5cdd677875583
BLAKE2b-256 ef59bd641bccb48d8e1b2629b1631332d5115a0984f10d9f4ca2c0d0ef749ce9

See more details on using hashes here.

File details

Details for the file a1pamfax-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: a1pamfax-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for a1pamfax-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5afb5e4a09139c8ae3cefb2c7ff18558d12cc7e1ae19f9d5c317c4bda5d84a53
MD5 e7a536daa546767756f828fd2d2d4845
BLAKE2b-256 2d5635c25329d48568695434657e32829fd715a44683eda14cd60e1826264ee8

See more details on using hashes here.

Supported by

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