Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ source .venv/bin/activate
export PYTHONPATH="${PYTHONPATH}:${SCRIPT_DIR}/gooddata-afm-client/"
export PYTHONPATH="${PYTHONPATH}:${SCRIPT_DIR}/gooddata-metadata-client/"
export PYTHONPATH="${PYTHONPATH}:${SCRIPT_DIR}/gooddata-scan-client/"
export PYTHONPATH="${PYTHONPATH}:${SCRIPT_DIR}/gooddata-api-client/"
export PYTHONPATH="${PYTHONPATH}:${SCRIPT_DIR}/gooddata-sdk/"
export PYTHONPATH="${PYTHONPATH}:${SCRIPT_DIR}/gooddata-pandas/"
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# (C) 2021 GoodData Corporation
[flake8]
exclude = .git,.venv,__pycache__,.tox,build,dist,gooddata-afm-client,gooddata-metadata-client,gooddata-scan-client
exclude = .git,.venv,__pycache__,.tox,build,dist,gooddata-afm-client,gooddata-metadata-client,gooddata-scan-client,gooddata-api-client

max-line-length = 120

Expand Down
10 changes: 7 additions & 3 deletions .fossa/prepare_and_populate_pipenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ cd ./gooddata-scan-client
pipenv install --skip-lock -r requirements.txt
cd ..

cd ./gooddata-api-client
pipenv install --skip-lock -r requirements.txt
cd ..

cd ./gooddata-sdk
pipenv install --skip-lock ../gooddata-afm-client/ ../gooddata-metadata-client/ ../gooddata-scan-client/ \
pipenv install --skip-lock ../gooddata-afm-client/ ../gooddata-metadata-client/ ../gooddata-scan-client/ ../gooddata-api-client/ \
-r requirements.txt
cd ..

cd ./gooddata-fdw
pipenv install --skip-lock ../gooddata-afm-client/ ../gooddata-metadata-client/ ../gooddata-scan-client/ \
pipenv install --skip-lock ../gooddata-afm-client/ ../gooddata-metadata-client/ ../gooddata-scan-client/ ../gooddata-api-client/ \
../gooddata-sdk/ -r requirements.txt
cd ..

cd ./gooddata-pandas
pipenv install --skip-lock ../gooddata-afm-client/ ../gooddata-metadata-client/ ../gooddata-scan-client/ \
pipenv install --skip-lock ../gooddata-afm-client/ ../gooddata-metadata-client/ ../gooddata-scan-client/ ../gooddata-api-client/ \
../gooddata-sdk/ -r requirements.txt
cd ..

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- gooddata-afm-client
- gooddata-metadata-client
- gooddata-scan-client
- gooddata-api-client
- gooddata-pandas
- gooddata-fdw
- gooddata-sdk
Expand Down Expand Up @@ -74,6 +75,7 @@ jobs:
- gooddata-afm-client
- gooddata-metadata-client
- gooddata-scan-client
- gooddata-api-client
- gooddata-pandas
- gooddata-fdw
- gooddata-sdk
Expand Down
4 changes: 1 addition & 3 deletions .openapi-generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ OpenAPI client generation is orchestrated by script `scripts/generate_client.sh`
if no such exists or updates existing client code.

Use prepared `make` targets from repository root:
- `make afm-client`
- `make metadata-client`
- `make scan-client`
- `make api-client`

Predefined targets use `http://gooddata-cn-ce:3000` URL to fetch OpenAPI schema and connect generator container to
the `gooddata-python-sdk_default` network. It is prepared to be executed against running `docker-compose.yaml`
Expand Down
13 changes: 13 additions & 0 deletions .openapi-generator/configs/gooddata-api-client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# (C) 2022 GoodData Corporation
generatorName: python
templateDir: /local/.openapi-generator/custom_templates
appName: "GoodData api client OpenAPI definition"
infoName: "GoodData (generated by OpenAPI Generator)"
infoEmail: "support@gooddata.com"
projectName: gooddata-api-client
packageName: gooddata_api_client
packageVersion: 1.1.0
library: urllib3
additionalProperties:
licenseInfo: "MIT"
licenseFile: "LICENSE.txt"
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# ignore all generated code + all snapshots; snapshots must not be processed otherwise they stop matching due to
# addition of new lines
exclude: (gooddata-afm-client|gooddata-metadata-client|gooddata-scan-client|.*\.snapshot\..*|.openapi-generator/custom_templates)
exclude: (gooddata-afm-client|gooddata-metadata-client|gooddata-scan-client|gooddata-api-client|.*\.snapshot\..*|.openapi-generator/custom_templates)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
Expand Down
2 changes: 1 addition & 1 deletion .sonar.settings
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2021 GoodData Corporation
sonar.sources=gooddata-sdk,gooddata-fdw,gooddata-pandas
sonar.exclusions=gooddata-afm-client/**/*,gooddata-metadata-client/**/*,gooddata-scan-client/**/*
sonar.exclusions=gooddata-afm-client/**/*,gooddata-metadata-client/**/*,gooddata-scan-client/**/*,gooddata-api-client/**/*
sonar.python.version=3.7, 3.8, 3.9, 3.10
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) 2022 GoodData Corporation
sonar.sources=gooddata-sdk,gooddata-fdw,gooddata-pandas
sonar.exclusions=gooddata-afm-client/**/*,gooddata-metadata-client/**/*,gooddata-scan-client/**/*
sonar.exclusions=gooddata-afm-client/**/*,gooddata-metadata-client/**/*,gooddata-scan-client/**/*,gooddata-api-client/**/*
sonar.python.version=3.7, 3.8, 3.9, 3.10
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-----------------------

This repository includes source code for gooddata-sdk, gooddata-fdw, gooddata-pandas, gooddata-scan-client, gooddata-metadata-client, and gooddata-afm-client, each of which is licensed under the MIT license above. For additional licensing information related to open source packages included in each of these projects, please see the OSS LICENSES directory.
This repository includes source code for gooddata-sdk, gooddata-fdw, gooddata-pandas, gooddata-scan-client, gooddata-metadata-client, gooddata-afm-client, and gooddata-api-client, each of which is licensed under the MIT license above. For additional licensing information related to open source packages included in each of these projects, please see the OSS LICENSES directory.
38 changes: 31 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,46 @@ format-fix:
isort .

.PHONY: clients
clients: afm-client metadata-client scan-client
clients: afm-client metadata-client scan-client api-client

define download_client
curl "${URL}/$(1)" | jq --sort-keys > schemas/gooddata-$(1)-client.json
endef

define generate_client
./scripts/generate_client.sh gooddata-$(1)-client -f "/local/schemas/gooddata-$(1)-client.json"
endef

define download_generate_client
$(call download_client,$(1))
$(call generate_client,$(1))
endef


.PHONY: afm-client
afm-client:
curl "${URL}/afm" | jq --sort-keys > schemas/gooddata-afm-client.json
./scripts/generate_client.sh gooddata-afm-client -f "/local/schemas/gooddata-afm-client.json"
$(call download_generate_client,afm)

.PHONY: metadata-client
metadata-client:
curl "${URL}/metadata" | jq --sort-keys > schemas/gooddata-metadata-client.json
./scripts/generate_client.sh gooddata-metadata-client -f "/local/schemas/gooddata-metadata-client.json"
$(call download_generate_client,metadata)

.PHONY: scan-client
scan-client:
curl "${URL}/scan" | jq --sort-keys > schemas/gooddata-scan-client.json
./scripts/generate_client.sh gooddata-scan-client -f "/local/schemas/gooddata-scan-client.json"
$(call download_generate_client,scan)

.PHONY: api-client
api-client: download
rm -f schemas/gooddata-api-client.json
cat schemas/gooddata-*.json | jq -S -s 'reduce .[] as $$item ({}; . * $$item) + { tags : ( reduce .[].tags as $$item (null; . + $$item) | unique_by(.name) ) }' > "schemas/gooddata-api-client.json"
$(call generate_client,api)

.PHONY: download
download:
Comment thread
hkad98 marked this conversation as resolved.
$(call download_client,afm)
$(call download_client,metadata)
$(call download_client,scan)
$(call download_client,"export")

.PHONY: mypy
mypy:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ This repository contains Python packages useful for integration with [GoodData.C

## Available packages

### GoodData API Clients
### GoodData API Client

API clients are generated directly from the GoodData.CN OpenAPI specifications and allow you to call any API from
API client is generated directly from the GoodData.CN OpenAPI specifications and allow you to call any API from
Python. Learn more about the clients in their [dedicated readme](./clients_README.md).

### GoodData Python SDK
Expand Down
2 changes: 1 addition & 1 deletion clients_README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated API Clients

The generated clients provide Python classes that you can use to call GoodData.CN REST APIs. The clients contain
The generated client provide Python classes that you can use to call GoodData.CN REST APIs. The client contains
models for API requests and responses and controllers to actually call the APIs.

We recommend using the gooddata_sdk package where possible because:
Expand Down
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pre-commit~=2.14.0
-r ./gooddata-afm-client/requirements.txt
-r ./gooddata-metadata-client/requirements.txt
-r ./gooddata-scan-client/requirements.txt
-r ./gooddata-api-client/requirements.txt
-r ./gooddata-sdk/requirements.txt
-r ./gooddata-pandas/requirements.txt
-r ./gooddata-fdw/requirements.txt
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
environment:
LICENSE_AND_PRIVACY_POLICY_ACCEPTED: "YES"
APP_LOGLEVEL: "INFO"
GDCN_ENABLE_CSV_EXPORT_API: 1

gooddata-fdw:
build:
Expand Down
66 changes: 66 additions & 0 deletions gooddata-api-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.venv/
.python-version
.pytest_cache

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

#Ipython Notebook
.ipynb_checkpoints
6 changes: 6 additions & 0 deletions gooddata-api-client/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# (C) 2022 GoodData Corporation
.openapi-generator-ignore
.gitlab-ci.yml
.travis.yml
git_push.sh
test/**
Loading