plunetapi


Nameplunetapi JSON
Version 0.3.0 PyPI version JSON
download
home_page
SummaryThin wrapper for the Plunet SOAP API.
upload_time2023-03-06 09:53:04
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords plunet api translation localization tms
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div id="top"></div>


<!-- PROJECT SHIELDS -->


[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]



<!-- PROJECT LOGO -->


<h3 align="center">PlunetAPI</h3>

  <p align="center">
    Thin wrapper for the Plunet SOAP API.
    <br />


  </p>
</div>







<!-- ABOUT THE PROJECT -->

## About The Project

A thin wrapper to facilitate interactions with the PlunetAPI.

<p align="right">(<a href="#top">back to top</a>)</p>

### Built With

* [zeep](https://docs.python-zeep.org/en/master/)
* [Plunet](https://www.plunet.com/)

<p align="right">(<a href="#top">back to top</a>)</p>



<!-- GETTING STARTED -->

## Getting Started

### Installation

Clone the repo

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

Or install via pip

   ```sh
   pip install plunetapi
   ```

<p align="right">(<a href="#top">back to top</a>)</p>



<!-- USAGE EXAMPLES -->

## Usage

Install using pip like so:

```sh
pip install plunetapi
```

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

```sh
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:

```sh
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
}

```

<p align="right">(<a href="#top">back to top</a>)</p>




See the [open issues](https://github.com/kuhnemann/plunetapi/issues) for a full list of proposed features (and known
issues).

<p align="right">(<a href="#top">back to top</a>)</p>



<!-- CONTRIBUTING -->

## 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

<p align="right">(<a href="#top">back to top</a>)</p>



<!-- LICENSE -->

## License

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

<p align="right">(<a href="#top">back to top</a>)</p>



<!-- CONTACT -->

## Contact

Henrik Kühnemann - [@hkuhnemann](https://twitter.com/hkuhnemann) - [hello@yellownape.se](mailto:hello@yellownape.se)

Project Link: [https://github.com/kuhnemann/plunetapi](https://github.com/kuhnemann/plunetapi)

<p align="right">(<a href="#top">back to top</a>)</p>



<p align="right">(<a href="#top">back to top</a>)</p>



<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

[contributors-shield]: https://img.shields.io/github/contributors/kuhnemann/plunetapi.svg?style=for-the-badge

[contributors-url]: https://github.com/kuhnemann/plunetapi/graphs/contributors

[forks-shield]: https://img.shields.io/github/forks/kuhnemann/plunetapi.svg?style=for-the-badge

[forks-url]: https://github.com/kuhnemann/plunetapi/network/members

[stars-shield]: https://img.shields.io/github/stars/kuhnemann/plunetapi.svg?style=for-the-badge

[stars-url]: https://github.com/kuhnemann/plunetapi/stargazers

[issues-shield]: https://img.shields.io/github/issues/kuhnemann/plunetapi.svg?style=for-the-badge

[issues-url]: https://github.com/kuhnemann/plunetapi/issues

[license-shield]: https://img.shields.io/github/license/kuhnemann/plunetapi.svg?style=for-the-badge

[license-url]: https://github.com/kuhnemann/plunetapi/blob/main/LICENCE

[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555

[linkedin-url]: https://linkedin.com/in/henrik-kuhnemann

[product-screenshot]: images/screenshot.png

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "plunetapi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "plunet,api,translation,localization,tms",
    "author": "",
    "author_email": "Henrik K\u00fchnemann <hello@yellownape.se>",
    "download_url": "https://files.pythonhosted.org/packages/c3/47/43c038cb08ca6a1ebd51b231c6b19a84e65ae223a5a6da429bd491b684c2/plunetapi-0.3.0.tar.gz",
    "platform": null,
    "description": "<div id=\"top\"></div>\n\n\n<!-- PROJECT SHIELDS -->\n\n\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n\n\n<!-- PROJECT LOGO -->\n\n\n<h3 align=\"center\">PlunetAPI</h3>\n\n  <p align=\"center\">\n    Thin wrapper for the Plunet SOAP API.\n    <br />\n\n\n  </p>\n</div>\n\n\n\n\n\n\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\nA thin wrapper to facilitate interactions with the PlunetAPI.\n\n<p align=\"right\">(<a href=\"#top\">back to top</a>)</p>\n\n### Built With\n\n* [zeep](https://docs.python-zeep.org/en/master/)\n* [Plunet](https://www.plunet.com/)\n\n<p align=\"right\">(<a href=\"#top\">back to top</a>)</p>\n\n\n\n<!-- GETTING STARTED -->\n\n## Getting Started\n\n### Installation\n\nClone the repo\n\n   ```sh\n   git clone https://github.com/kuhnemann/plunetapi.git\n   ```\n\nOr install via pip\n\n   ```sh\n   pip install plunetapi\n   ```\n\n<p align=\"right\">(<a href=\"#top\">back to top</a>)</p>\n\n\n\n<!-- USAGE EXAMPLES -->\n\n## Usage\n\nInstall using pip like so:\n\n```sh\npip install plunetapi\n```\n\nThe wrapper is thin by design and intended to be used by a client. For example something along these lines:\n\n```sh\nfrom plunetapi import PlunetAPI\nfrom typing import Union, Callable\n\nclass PlunetClient:\n    def __init__(self, base_url: str):\n        self.plunet = PlunetAPI(base_url=base_url)\n        self.uuid = None\n\n    def login(self, username: str, password: str):\n        uuid = self.plunet.PlunetAPI.login(username, password)\n        if uuid == \"refused\":\n            raise ConnectionRefusedError(\"Login refused\")\n        else:\n            self.uuid = uuid\n\n    def _make_request(self, operation_proxy: Callable, argument: Union[dict, str, int, list]):\n        result = operation_proxy(self.uuid, argument)\n        if result.statusCode != 0:\n            raise Exception(result.statusMessage)\n        else:\n            return result.data\n\n    def get_customer_object(self, customer_id: int):\n        data_item = self._make_request(self.plunet.DataCustomer30.getCustomerObject, customer_id)\n        return data_item\n\n```\n\nAs a complement to the Plunet JavaDocs, use the propagated zeep factory method to explore objects as definied in the different WSDLs. For example:\n\n```sh\nplunet = PlunetAPI(base_url=base_url)\nplunet.DataJob30.factory.PriceLine()\n{\n    'amount': None,\n    'amount_perUnit': None,\n    'memo': None,\n    'priceLineID': None,\n    'priceUnitID': None,\n    'sequence': None,\n    'taxType': None,\n    'time_perUnit': None,\n    'unit_price': None\n}\n\n```\n\n<p align=\"right\">(<a href=\"#top\">back to top</a>)</p>\n\n\n\n\nSee the [open issues](https://github.com/kuhnemann/plunetapi/issues) for a full list of proposed features (and known\nissues).\n\n<p align=\"right\">(<a href=\"#top\">back to top</a>)</p>\n\n\n\n<!-- CONTRIBUTING -->\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any\ncontributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also\nsimply open an issue with the tag \"enhancement\". Don't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n<p align=\"right\">(<a href=\"#top\">back to top</a>)</p>\n\n\n\n<!-- LICENSE -->\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n<p align=\"right\">(<a href=\"#top\">back to top</a>)</p>\n\n\n\n<!-- CONTACT -->\n\n## Contact\n\nHenrik K\u00fchnemann - [@hkuhnemann](https://twitter.com/hkuhnemann) - [hello@yellownape.se](mailto:hello@yellownape.se)\n\nProject Link: [https://github.com/kuhnemann/plunetapi](https://github.com/kuhnemann/plunetapi)\n\n<p align=\"right\">(<a href=\"#top\">back to top</a>)</p>\n\n\n\n<p align=\"right\">(<a href=\"#top\">back to top</a>)</p>\n\n\n\n<!-- MARKDOWN LINKS & IMAGES -->\n<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->\n\n[contributors-shield]: https://img.shields.io/github/contributors/kuhnemann/plunetapi.svg?style=for-the-badge\n\n[contributors-url]: https://github.com/kuhnemann/plunetapi/graphs/contributors\n\n[forks-shield]: https://img.shields.io/github/forks/kuhnemann/plunetapi.svg?style=for-the-badge\n\n[forks-url]: https://github.com/kuhnemann/plunetapi/network/members\n\n[stars-shield]: https://img.shields.io/github/stars/kuhnemann/plunetapi.svg?style=for-the-badge\n\n[stars-url]: https://github.com/kuhnemann/plunetapi/stargazers\n\n[issues-shield]: https://img.shields.io/github/issues/kuhnemann/plunetapi.svg?style=for-the-badge\n\n[issues-url]: https://github.com/kuhnemann/plunetapi/issues\n\n[license-shield]: https://img.shields.io/github/license/kuhnemann/plunetapi.svg?style=for-the-badge\n\n[license-url]: https://github.com/kuhnemann/plunetapi/blob/main/LICENCE\n\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555\n\n[linkedin-url]: https://linkedin.com/in/henrik-kuhnemann\n\n[product-screenshot]: images/screenshot.png\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Thin wrapper for the Plunet SOAP API.",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://github.com/kuhnemann/plunet-api"
    },
    "split_keywords": [
        "plunet",
        "api",
        "translation",
        "localization",
        "tms"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9b59fd61106c4484b9711599565038bf418c3e9e0aafc813ce6e32b8056d27d0",
                "md5": "220dad563931f8b712e04955ffe0f12d",
                "sha256": "4b368085c6904faa32ed8ee87caac7ff4dd5842fb6de4f7f195da880157ca656"
            },
            "downloads": -1,
            "filename": "plunetapi-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "220dad563931f8b712e04955ffe0f12d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6456,
            "upload_time": "2023-03-06T09:53:01",
            "upload_time_iso_8601": "2023-03-06T09:53:01.970137Z",
            "url": "https://files.pythonhosted.org/packages/9b/59/fd61106c4484b9711599565038bf418c3e9e0aafc813ce6e32b8056d27d0/plunetapi-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c34743c038cb08ca6a1ebd51b231c6b19a84e65ae223a5a6da429bd491b684c2",
                "md5": "ef3a06e467b05e114c2c83b88fce34df",
                "sha256": "d5612f776de8f6ee101015cdfaf1287870158e41fd0ad672ab8df7132ab0bc70"
            },
            "downloads": -1,
            "filename": "plunetapi-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ef3a06e467b05e114c2c83b88fce34df",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 8062,
            "upload_time": "2023-03-06T09:53:04",
            "upload_time_iso_8601": "2023-03-06T09:53:04.941887Z",
            "url": "https://files.pythonhosted.org/packages/c3/47/43c038cb08ca6a1ebd51b231c6b19a84e65ae223a5a6da429bd491b684c2/plunetapi-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-06 09:53:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kuhnemann",
    "github_project": "plunet-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "plunetapi"
}
        
Elapsed time: 0.06588s