bitranox / lib_shopware6_api_base Goto Github PK
View Code? Open in Web Editor NEWpython3 base API client for shopware6
License: MIT License
python3 base API client for shopware6
License: MIT License
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:
application/json
.json.dumps(payload)
is hard-coded in the _request() methodThe 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.
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
**I'm submitting a ... **
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.
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.
This causes the EqualsAnyFilter to fail.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.