GithubHelp home page GithubHelp logo

bitranox / lib_shopware6_api_base Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 0.0 141 KB

python3 base API client for shopware6

License: MIT License

Makefile 0.90% Python 85.71% Jupyter Notebook 0.98% Shell 11.77% Batchfile 0.64%

lib_shopware6_api_base's People

Contributors

bitranox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lib_shopware6_api_base's Issues

Uploading a document

I'm currently using this library to integrate my Odoo based ERP system with shopware. So far, it is working great.

However, I'm now trying to figure out how I can upload the PDF invoices as shopware 'documents', and it seems it is not possible via this library:

  • I don't see a way to override the Contet-Type that is sent in POST requests. the _get_header() method always returns application/json.
  • I don't see how I could post non-JSON data as the use of json.dumps(payload) is hard-coded in the _request() method

The REST API reference for this can be found at https://shopware.stoplight.io/docs/admin-api/b3A6MTMzMTcwNzM-upload-a-file-for-a-document

Do you have any thoughts how you'd want to support this feature? I would assume that a base API module should ideally be flexible/generic enough to do anything the shopware6 API offers.

typo in ConfShopware6ApiBase

  • **I'm submitting a ... **
    • [ x] bug report
    • feature request
    • support request

Heads up for this library. Greatly appreciated.
Just came across a typo in the ConfShopware6ApiBase Code.

Copied admin/settings/system/itegrations in my URL and was wondering why it was not working. ;-)

Needs to be '/admin#/sw/integration/index'

Guesss this is too trivial for a pull request.

cheers tom

Possibility to add request specific headers to requests

  • **I'm submitting a ... **

    • bug report
    • feature request
    • support request
  • Do you want to request a feature or report a bug?
    feature

  • What is the current behavior?
    Out of the Box it is currently not possible to add custom headers to requests.

  • What is the expected behavior?
    I would like to add custom headers to requests.

  • What is the motivation / use case for changing the behavior?
    Endpoints like /api/_action/sync (Documentation) require request specific custom headers to manipulate the api behavior.

library uses 'attrs' module without minimum version but in fact requires >= 21.3

I'm on Debian unstabel and have just installed the lib_shopware6_api_base via pip. pip did not install the attrs module from pypl/pip, as it is already provided by the operating system:

ii  python3-attr                                                21.2.0-1                                     all          Attributes without boilerplate (Python 3)

However:

$ ./shopware_api_test.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/lib_shopware6_api_base/lib_shopware6_api_base.py", line 19, in 
    from conf_shopware6_api_base_classes import *
ModuleNotFoundError: No module named 'conf_shopware6_api_base_classes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/crypt/home_laforge_crypt/projects/kommerz/sysmocom/shopware/api/./shopware_api_test.py", line 3, in 
    from lib_shopware6_api_base import Shopware6AdminAPIClientBase
  File "/usr/local/lib/python3.10/dist-packages/lib_shopware6_api_base/__init__.py", line 9, in 
    from .lib_shopware6_api_base import *
  File "/usr/local/lib/python3.10/dist-packages/lib_shopware6_api_base/lib_shopware6_api_base.py", line 23, in 
    from .conf_shopware6_api_base_classes import *  # type: ignore  # pragma: no cover
  File "/usr/local/lib/python3.10/dist-packages/lib_shopware6_api_base/conf_shopware6_api_base_classes.py", line 7, in 
    import attrs
ModuleNotFoundError: No module named 'attrs'

some more research showed that attrs.validators was only introduced in attrs 21.3.0 in the following commit:

commit e7345584ffb8de9016e2ccf736e702d0289b0401
Author: Hynek Schlawack 
Date:   Sat Dec 25 15:15:10 2021 +0100

    Add attrs namespace (#887)

diff --git a/src/attrs/validators.py b/src/attrs/validators.py
new file mode 100644
index 0000000..ad46fbb
--- /dev/null
+++ b/src/attrs/validators.py
@@ -0,0 +1 @@
+from attr.validators import *  # noqa

and

$  git tag --contains e7345584ffb8de9016e2ccf736e702d0289b0401
21.3.0
21.4.0
21.4.0.post1

So any attrs prior 21.3.0 will have attr.validators and not attrs.validators.

You could either explicitly require versions >= 21.3.0 or simply change from attrs.validators to attr.validators.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.