xsdata-odoo 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. xsdata_odoo-0.8.0/LICENSE +21 -0
  2. xsdata_odoo-0.8.0/MANIFEST.in +7 -0
  3. xsdata_odoo-0.8.0/PKG-INFO +36 -0
  4. xsdata_odoo-0.8.0/README.rst +71 -0
  5. xsdata_odoo-0.8.0/pyproject.toml +67 -0
  6. xsdata_odoo-0.8.0/setup.cfg +4 -0
  7. xsdata_odoo-0.8.0/tests/__init__.py +0 -0
  8. xsdata_odoo-0.8.0/tests/fixtures/__init__.py +1 -0
  9. xsdata_odoo-0.8.0/tests/fixtures/nfe/leiauteNFe_v4.00.xsd +6978 -0
  10. xsdata_odoo-0.8.0/tests/fixtures/nfe/models.py +6268 -0
  11. xsdata_odoo-0.8.0/tests/fixtures/nfe/tiposBasico_v4.00.xsd +589 -0
  12. xsdata_odoo-0.8.0/tests/fixtures/po/models.py +112 -0
  13. xsdata_odoo-0.8.0/tests/fixtures/po/po.xsd +71 -0
  14. xsdata_odoo-0.8.0/tests/fixtures/po_with_nesting/models.py +121 -0
  15. xsdata_odoo-0.8.0/tests/fixtures/po_with_nesting/po.xsd +80 -0
  16. xsdata_odoo-0.8.0/tests/test_generator.py +198 -0
  17. xsdata_odoo-0.8.0/xsdata_odoo/__init__.py +1 -0
  18. xsdata_odoo-0.8.0/xsdata_odoo/codegen/resolver.py +23 -0
  19. xsdata_odoo-0.8.0/xsdata_odoo/filters.py +536 -0
  20. xsdata_odoo-0.8.0/xsdata_odoo/generator.py +370 -0
  21. xsdata_odoo-0.8.0/xsdata_odoo/hook.py +100 -0
  22. xsdata_odoo-0.8.0/xsdata_odoo/templates/class.jinja2 +27 -0
  23. xsdata_odoo-0.8.0/xsdata_odoo/templates/enum.jinja2 +10 -0
  24. xsdata_odoo-0.8.0/xsdata_odoo/templates/imports.jinja2 +15 -0
  25. xsdata_odoo-0.8.0/xsdata_odoo/templates/module.jinja2 +13 -0
  26. xsdata_odoo-0.8.0/xsdata_odoo/templates/package.jinja2 +14 -0
  27. xsdata_odoo-0.8.0/xsdata_odoo/text_utils.py +182 -0
  28. xsdata_odoo-0.8.0/xsdata_odoo.egg-info/PKG-INFO +36 -0
  29. xsdata_odoo-0.8.0/xsdata_odoo.egg-info/SOURCES.txt +31 -0
  30. xsdata_odoo-0.8.0/xsdata_odoo.egg-info/dependency_links.txt +1 -0
  31. xsdata_odoo-0.8.0/xsdata_odoo.egg-info/entry_points.txt +2 -0
  32. xsdata_odoo-0.8.0/xsdata_odoo.egg-info/requires.txt +11 -0
  33. xsdata_odoo-0.8.0/xsdata_odoo.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Raphaël Valyi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ include LICENSE README.rst LICENSE tox.ini
2
+ recursive-include tests *
3
+ recursive-include xsdata_odoo *
4
+
5
+ exclude .pre-commit-config.yaml
6
+
7
+ global-exclude .DS_Store *.pyc
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: xsdata_odoo
3
+ Version: 0.8.0
4
+ Summary: xsdata Odoo abstract model generator plugin
5
+ Author-email: Raphaël Valyi <raphael.valyi@akretion.com>
6
+ License: MIT
7
+ Project-URL: Source, https://github.com/akretion/xsdata-odoo
8
+ Keywords: xsd,wsdl,schema,xml,uml,odoo,generator,cli
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: Implementation :: CPython
20
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
21
+ Classifier: Topic :: Software Development :: Code Generators
22
+ Classifier: Topic :: Text Processing :: Markup :: XML
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: babel
27
+ Requires-Dist: nltk
28
+ Requires-Dist: ruff
29
+ Requires-Dist: lxml>=4.4.1
30
+ Requires-Dist: xsdata[cli]>=25.0
31
+ Provides-Extra: test
32
+ Requires-Dist: codecov; extra == "test"
33
+ Requires-Dist: pre-commit; extra == "test"
34
+ Requires-Dist: pytest; extra == "test"
35
+ Requires-Dist: pytest-cov; extra == "test"
36
+ Dynamic: license-file
@@ -0,0 +1,71 @@
1
+ Odoo abstract model generator from xsd schemas using xsdata
2
+ ======================================
3
+
4
+ .. image:: https://codecov.io/gh/akretion/xsdata-odoo/branch/master/graph/badge.svg
5
+ :target: https://codecov.io/gh/akretion/xsdata-odoo
6
+
7
+ .. image:: https://img.shields.io/pypi/pyversions/xsdata-odoo.svg
8
+ :target: https://pypi.org/pypi/xsdata-odoo/
9
+
10
+ .. image:: https://img.shields.io/pypi/v/xsdata-odoo.svg
11
+ :target: https://pypi.org/pypi/xsdata-odoo/
12
+
13
+ - `xsdata <https://xsdata.readthedocs.io/>`_ based replacement of https://github.com/akretion/generateds-odoo
14
+ - heavily inspired by https://github.com/tefra/xsdata-plantuml
15
+ - explanations https://www.youtube.com/watch?v=6gFOe7Wh8uA
16
+
17
+ Install
18
+ =======
19
+
20
+ .. code:: console
21
+
22
+ $ # Install with cli support
23
+ $ pip install xsdata[cli]
24
+ $ pip install git+https://github.com/akretion/xsdata-odoo
25
+
26
+
27
+ Generate Models
28
+ ===============
29
+
30
+ Odoo Models for the Microsoft Purchase Order demo schema:
31
+
32
+ .. code:: console
33
+
34
+ $ # Generate Odoo models
35
+ $ xsdata generate tests/fixtures/po/po.xsd --output=odoo
36
+ Parsing schema po.xsd
37
+ Compiling schema po.xsd
38
+ Builder: 6 main and 1 inner classes
39
+ Analyzer input: 6 main and 1 inner classes
40
+ Analyzer output: 5 main and 1 inner classes
41
+ Generating package: generated.po
42
+
43
+
44
+ Odoo Models for the Brazilian Electronic Invoices:
45
+
46
+ .. code:: console
47
+
48
+ $ # Generate Odoo models
49
+ $ export XSDATA_SCHEMA=nfe; export XSDATA_VERSION=40; export XSDATA_SKIP="^ICMS.ICMS\d+|^ICMS.ICMSSN\d+"; export XSDATA_LANG="portuguese"
50
+ $ # assuming you are in an akretion/nfelib clone or you downloaded the NFe schemas in nfelib/schemas/nfe/v4_0:
51
+ $ xsdata generate nfelib/nfe/schemas/v4_0 --package nfelib.nfe.odoo.v4_0 --output=odoo
52
+ Generating package: init
53
+ Generating package: nfelib.nfe.odoo.v4_0.xmldsig_core_schema_v1_01
54
+ Generating package: nfelib.nfe.odoo.v4_0.tipos_basico_v4_00
55
+ Generating package: nfelib.nfe.odoo.v4_0.leiaute_nfe_v4_00
56
+ Generating package: nfelib.nfe.odoo.v4_0.leiaute_cons_sit_nfe_v4_00
57
+ Generating package: nfelib.nfe.odoo.v4_0.cons_reci_nfe_v4_00
58
+ Generating package: nfelib.nfe.odoo.v4_0.cons_sit_nfe_v4_00
59
+ Generating package: nfelib.nfe.odoo.v4_0.leiaute_cons_stat_serv_v4_00
60
+ Generating package: nfelib.nfe.odoo.v4_0.cons_stat_serv_v4_00
61
+ Generating package: nfelib.nfe.odoo.v4_0.envi_nfe_v4_00
62
+ Generating package: nfelib.nfe.odoo.v4_0.leiaute_inut_nfe_v4_00
63
+ Generating package: nfelib.nfe.odoo.v4_0.inut_nfe_v4_00
64
+ Generating package: nfelib.nfe.odoo.v4_0.nfe_v4_00
65
+ Generating package: nfelib.nfe.odoo.v4_0.proc_inut_nfe_v4_00
66
+ Generating package: nfelib.nfe.odoo.v4_0.proc_nfe_v4_00
67
+ Generating package: nfelib.nfe.odoo.v4_0.ret_cons_reci_nfe_v4_00
68
+ Generating package: nfelib.nfe.odoo.v4_0.ret_cons_sit_nfe_v4_00
69
+ Generating package: nfelib.nfe.odoo.v4_0.ret_cons_stat_serv_v4_00
70
+ Generating package: nfelib.nfe.odoo.v4_0.ret_envi_nfe_v4_00
71
+ Generating package: nfelib.nfe.odoo.v4_0.ret_inut_nfe_v4_0
@@ -0,0 +1,67 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"] # Specify a modern setuptools version
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "xsdata_odoo"
7
+ dynamic = ["version"]
8
+ description = "xsdata Odoo abstract model generator plugin"
9
+ readme = "README.md" # Replaces long_description and long_description_content_type
10
+ requires-python = ">=3.8"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ { name = "Raphaël Valyi", email = "raphael.valyi@akretion.com" },
14
+ ]
15
+ keywords = ["xsd", "wsdl", "schema", "xml", "uml", "odoo", "generator", "cli"]
16
+ classifiers = [
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3 :: Only",
23
+ "Programming Language :: Python :: 3.9",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Programming Language :: Python :: Implementation :: CPython",
28
+ "Programming Language :: Python :: Implementation :: PyPy",
29
+ "Topic :: Software Development :: Code Generators",
30
+ "Topic :: Text Processing :: Markup :: XML",
31
+ ]
32
+
33
+ dependencies = [
34
+ "babel",
35
+ "nltk",
36
+ "ruff",
37
+ "lxml>=4.4.1",
38
+ "xsdata[cli]>=25.0",
39
+ ]
40
+
41
+ [project.urls]
42
+ Source = "https://github.com/akretion/xsdata-odoo"
43
+ # Homepage = "https://github.com/akretion/xsdata-odoo" # Often the same as Source or a dedicated project page
44
+
45
+ [project.entry-points."xsdata.plugins.cli"]
46
+ xsdata_odoo = "xsdata_odoo.hook"
47
+
48
+ [project.optional-dependencies]
49
+ test = [
50
+ "codecov",
51
+ "pre-commit",
52
+ "pytest",
53
+ "pytest-cov",
54
+ ]
55
+
56
+ # Tool-specific configurations
57
+ [tool.setuptools]
58
+ packages = ["xsdata_odoo"]
59
+ include-package-data = true
60
+ package-data = { "xsdata_odoo" = ["templates/*.jinja2"] }
61
+
62
+ [tool.setuptools.dynamic]
63
+ version = {attr = "xsdata_odoo.__version__"}
64
+
65
+ # Configure Ruff if you're standardizing on it. Example:
66
+ [tool.ruff]
67
+ line-length = 88
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1 @@
1
+ # nothing here