Skip to main content

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)

Metadata

Release files for plunetapi 0.4.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 plunetapi 0.4.0
File Size Uploaded
plunetapi-0.4.0.tar.gz 8.2 kB Details

Built distribution (wheel)

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

Total release size: 14.7 kB

Release files / plunetapi-0.4.0.tar.gz

Download URL plunetapi-0.4.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
178977cee166edc9b15d3342291a68209d7d4786b2befa8fe97824c436715dd1
BLAKE2b-256 checksum
How to use checksums
2d410c3273d8aa0172c0fbe34e582e945a612182af337a3f385a5d318bbeda49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.1

Release files / plunetapi-0.4.0-py3-none-any.whl

Download URL plunetapi-0.4.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8648882dac4d0e3f067f3477719050bcf78ce017101e5cd6242dfc7e71166bc3
BLAKE2b-256 checksum
How to use checksums
d08007fa50b0a1f80c2f95b80ac472e5ccb156c9ff95657c795f4aad1f892187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.1

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.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