a1pamfax


Namea1pamfax JSON
Version 0.0.9 PyPI version JSON
download
home_pagehttp://github.com/bufemc/a1pamfax/
SummaryPython 3 implementation for the PamFax API
upload_time2020-12-21 12:42:16
maintainer
docs_urlNone
authorMarc Bufe (Airport1)
requires_python>=3.6
licenseLICENSE.txt
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # a1pamfax

<img alt="Python versions" src="https://camo.githubusercontent.com/4b34d92404f5a39a6b41ee03b34a2926bbc70db8/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f667269747a636f6e6e656374696f6e2e737667"/> <img src="https://camo.githubusercontent.com/232174f26bac5f71ba94b19698d7374192fbe304/68747470733a2f2f696d672e736869656c64732e696f2f707970692f6c2f667269747a636f6e6e656374696f6e2e737667"/><p/>

[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 for Python - a small tutorial

For developing ensure the package is uninstalled e.g. in the venv and in test.py set ```develop_mode = True```:
```
pip uninstall a1pamfax
```

Pre-testing: in test.py set ```develop_mode = False```, then for e.g. in the venv do this:
```
python setup.py install
python test.py
```


In general check out [Python-Packaging]. After setting up the Test-PyPI and PyPI accounts continue here.

```
cd \workspace\python\a1pamfax
rd /s /q dist build a1pamfax.egg-info
python -m pip install --user --upgrade setuptools wheel
python setup.py sdist bdist_wheel
python -m pip install --user --upgrade twine
```

Uploading to testpypi:
```
python -m twine upload --repository testpypi dist/*
```

And after testing, for production use (e.g. in the venv):
```
python -m twine upload dist/*
pip uninstall a1pamfax
pip install a1pamfax --upgrade
```

[Airport1]: https://www.airport1.de/
[PamFax]: http://www.pamfax.biz/
[PamFax for Developers]: https://www.pamfax.biz/developers/introduction/
[PamFax Processors Documentation]: https://sandbox-apifrontend.pamfax.biz/processors/
[Dynaptico PamFax documentation (Python2)]: http://packages.python.org/dynaptico-pamfax
[Dynaptico PamFax (Python2)]: https://github.com/dynaptico/pamfaxp
[Python-Packaging]: https://packaging.python.org/tutorials/packaging-projects/
[Github]: https://github.com/bufemc/a1pamfax



            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/bufemc/a1pamfax/",
    "name": "a1pamfax",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Marc Bufe (Airport1)",
    "author_email": "bufemc@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bb/b0/8dbc4d6c558d1e823ab992d6707aa08f1722507234d01db6ebdfa84d8878/a1pamfax-0.0.9.tar.gz",
    "platform": "",
    "description": "# a1pamfax\n\n<img alt=\"Python versions\" src=\"https://camo.githubusercontent.com/4b34d92404f5a39a6b41ee03b34a2926bbc70db8/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f667269747a636f6e6e656374696f6e2e737667\"/> <img src=\"https://camo.githubusercontent.com/232174f26bac5f71ba94b19698d7374192fbe304/68747470733a2f2f696d672e736869656c64732e696f2f707970692f6c2f667269747a636f6e6e656374696f6e2e737667\"/><p/>\n\n[Airport1]'s PamFax - short name **a1pamfax** - is a Python (3.6+) package that implements the [PamFax] API. \n\nThis is an adaption of [Dynaptico PamFax (Python2)] - once written for Python 2 - now adapted to work for Python 3.6 or later.\nThe old code (and style) has been kept whenever possible, on purpose. The behavior should be nearly the same.\n\nFor more information about the PamFax API, visit: [PamFax for Developers].\n\nAs this package is still in development, please report any bugs or issues by raising an issue in this [Github] repository.\n\nThis module is written for Python 3.6+ and has only been tested against Python 3.9.\nThere is a big chance it works for previous versions, however, too.\n\n### Installation\n\nYou can install ```a1pamfax``` either via the Python Package Index (PyPI) or from source.\n\nTo install the latest version via pip:\n\n```\npip install a1pamfax --upgrade\n```\n\nThis is my first public package following the instructions on [Python-Packaging]. \nSo far I included the test, test data (the former pdf file by dynaptico), a config example and a sample. \n\n### Requirements\n\nIt is required to install at least (e.g. via ```pip install requests```):\n\n* requests\n\n### Tests\n\nIt is strongly recommended to use the sandbox environment ('sandbox-apifrontend') for testing.\nFirst copy the file ```config.example.py``` and rename it to ```config.py``` and fill in your credentials. Then\nrun either the sample by:\n\n```\npython sample.py\n```\n\nor the test suite by:\n\n```\ncd test\npython test.py\n```\n\nYou may adapt the main method of ```test.py``` to en-/disable the tests you (dis)like.\n\nDepending on the tests you run it might be required that you already received or sent something, e.g. in the\nsandbox environment. \nThe online storage tests will partially be skipped if you did not authenticate for e.g. Dropbox before, this\nis intentionally.\n\n### Usage\n\nThere is also a ```sample.py``` provided, but in short: after logging in follow the\n[PamFax Processors Documentation]. E.g. Common::GetCurrentSettings is available as\npamfax.get_current_settings() etc. Full example:\n\n```\nfrom config import HOST, USERNAME, PASSWORD, APIKEY, APISECRET\nfrom pamfax import PamFax\n\npamfax = PamFax(USERNAME, PASSWORD, host=HOST, apikey=APIKEY, apisecret=APISECRET)\nresponse = pamfax.get_current_settings()\nprint(response)\n```\n\n### Documentation\n\nThere is no documentation for this package in Python 3 yet. But:\nthe documentation for the older Python 2 implementation by dynaptico might be still available here:\n[Dynaptico PamFax documentation (Python2)]\n\nand nearly all methods and signatures have been kept ON PURPOSE, \njust adapted for Python 3. Only few private methods were changed.\n\nSee also section Particularities.\n\n### Integrity\n\nAll methods in the PamFax API should be implemented by this package, except the ones introduced after Dynaptico\nreleased his Python 2 version. Missing methods will be added, step by step.\n\nSince v0.0.6 Dropbox methods are re-enabled and tested, plus missing methods for Common have been added.\n\n### Particularities\n\nAs said, the code is heavily based on an old package for Python 2. It was just adapted to run \"the same\" on Python 3.\nIntentionally nearly all methods and signatures have been kept, except the implementation might be different sometimes.\nSo the code has only been touched where it was required, e.g. it's using now ```requests```'s session with a timeout\nof 30 seconds.\nI tried to stick to the coding style of dynaptico.\nHowever, few private methods had to be changed in their signature:\n\n* _get_and_check_response\n* _get\n* _post   \n\n### Thanks\n\nTo Dynaptico, on which this rewrite for Python 3 is heavily based on, see: [Dynaptico PamFax (Python2)].\n\n### Packaging for Python - a small tutorial\n\nFor developing ensure the package is uninstalled e.g. in the venv and in test.py set ```develop_mode = True```:\n```\npip uninstall a1pamfax\n```\n\nPre-testing: in test.py set ```develop_mode = False```, then for e.g. in the venv do this:\n```\npython setup.py install\npython test.py\n```\n\n\nIn general check out [Python-Packaging]. After setting up the Test-PyPI and PyPI accounts continue here.\n\n```\ncd \\workspace\\python\\a1pamfax\nrd /s /q dist build a1pamfax.egg-info\npython -m pip install --user --upgrade setuptools wheel\npython setup.py sdist bdist_wheel\npython -m pip install --user --upgrade twine\n```\n\nUploading to testpypi:\n```\npython -m twine upload --repository testpypi dist/*\n```\n\nAnd after testing, for production use (e.g. in the venv):\n```\npython -m twine upload dist/*\npip uninstall a1pamfax\npip install a1pamfax --upgrade\n```\n\n[Airport1]: https://www.airport1.de/\n[PamFax]: http://www.pamfax.biz/\n[PamFax for Developers]: https://www.pamfax.biz/developers/introduction/\n[PamFax Processors Documentation]: https://sandbox-apifrontend.pamfax.biz/processors/\n[Dynaptico PamFax documentation (Python2)]: http://packages.python.org/dynaptico-pamfax\n[Dynaptico PamFax (Python2)]: https://github.com/dynaptico/pamfaxp\n[Python-Packaging]: https://packaging.python.org/tutorials/packaging-projects/\n[Github]: https://github.com/bufemc/a1pamfax\n\n\n",
    "bugtrack_url": null,
    "license": "LICENSE.txt",
    "summary": "Python 3 implementation for the PamFax API",
    "version": "0.0.9",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "363471342d05eb6db82be5742cb603a9",
                "sha256": "6423c9c2241ec5c69304bcc5af92822ff6ede02534bb8a09a8f8b8fb3f44ba13"
            },
            "downloads": -1,
            "filename": "a1pamfax-0.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "363471342d05eb6db82be5742cb603a9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 21549,
            "upload_time": "2020-12-21T12:42:15",
            "upload_time_iso_8601": "2020-12-21T12:42:15.301099Z",
            "url": "https://files.pythonhosted.org/packages/0e/cd/61bfabaddc38fdcafb0f0bffd87aaef7a4dae5c642c9ed285f5aeaf7431d/a1pamfax-0.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "3e0a65e8672abf507085c3a3e586e625",
                "sha256": "645f17a8cd03baa50bb5511107745975b5e5c551a3d37eb824a2f56e9133f33c"
            },
            "downloads": -1,
            "filename": "a1pamfax-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "3e0a65e8672abf507085c3a3e586e625",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 72505,
            "upload_time": "2020-12-21T12:42:16",
            "upload_time_iso_8601": "2020-12-21T12:42:16.545953Z",
            "url": "https://files.pythonhosted.org/packages/bb/b0/8dbc4d6c558d1e823ab992d6707aa08f1722507234d01db6ebdfa84d8878/a1pamfax-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-12-21 12:42:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "bufemc",
    "error": "Could not fetch GitHub repository",
    "lcname": "a1pamfax"
}
        
Elapsed time: 0.17260s