Skip to main content

Thin wrapper for the Plunet SOAP API.

Project description

Forks Stargazers Issues MIT License LinkedIn

PlunetAPI

Thin wrapper for the Plunet SOAP API.

About The Project

A thin wrapper to facilitate interactions with the PlunetAPI.

(back to top)

Built With

(back to top)

Getting Started

Installation

Clone the repo

git clone https://github.com/kuhnemann/plunetapi.git

Or install via pip

pip install plunetapi

(back to top)

Usage

Install using pip like so:

pip install plunetapi

The wrapper is thin by design and intended to be used by a client. For example something along these lines:

from plunetapi import PlunetAPI
from typing import Union, Callable

class PlunetClient:
    def __init__(self, base_url: str):
        self.plunet = PlunetAPI(base_url=base_url)
        self.uuid = None

    def login(self, username: str, password: str):
        uuid = self.plunet.PlunetAPI.login(username, password)
        if uuid == "refused":
            raise ConnectionRefusedError("Login refused")
        else:
            self.uuid = uuid

    def _make_request(self, operation_proxy: Callable, argument: Union[dict, str, int, list]):
        result = operation_proxy(self.uuid, argument)
        if result.statusCode != 0:
            raise Exception(result.statusMessage)
        else:
            return result.data

    def get_customer_object(self, customer_id: int):
        data_item = self._make_request(self.plunet.DataCustomer30.getCustomerObject, customer_id)
        return data_item

As a complement to the Plunet JavaDocs, use the propagated zeep factory method to explore objects as definied in the different WSDLs. For example:

plunet = PlunetAPI(base_url=base_url)
plunet.DataJob30.factory.PriceLine()
{
    'amount': None,
    'amount_perUnit': None,
    'memo': None,
    'priceLineID': None,
    'priceUnitID': None,
    'sequence': None,
    'taxType': None,
    'time_perUnit': None,
    'unit_price': None
}

(back to top)

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Henrik Kühnemann - @hkuhnemann - hello@yellownape.se

Project Link: https://github.com/kuhnemann/plunetapi

(back to top)

(back to top)

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

plunetapi-0.4.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

plunetapi-0.4.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file plunetapi-0.4.0.tar.gz.

File metadata

  • Download URL: plunetapi-0.4.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.1

File hashes

Hashes for plunetapi-0.4.0.tar.gz
Algorithm Hash digest
SHA256 178977cee166edc9b15d3342291a68209d7d4786b2befa8fe97824c436715dd1
MD5 537a656810ea04033f315f431664ceb1
BLAKE2b-256 2d410c3273d8aa0172c0fbe34e582e945a612182af337a3f385a5d318bbeda49

See more details on using hashes here.

File details

Details for the file plunetapi-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: plunetapi-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.1

File hashes

Hashes for plunetapi-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8648882dac4d0e3f067f3477719050bcf78ce017101e5cd6242dfc7e71166bc3
MD5 6ed8f9bc118eb33de7d609ac730f1ae6
BLAKE2b-256 d08007fa50b0a1f80c2f95b80ac472e5ccb156c9ff95657c795f4aad1f892187

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