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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,14 @@ Generate asset models from your Atlan instance:
# Generate models automatically
uv run ./generator

# Force re-download typedefs (bypass cache)
uv run ./generator --override

# Use custom typedefs file
uv run ./generator ./my-typedefs.json

# Both flags can be combined
uv run ./generator --override ./my-typedefs.json
```

This will:
Expand Down
12 changes: 0 additions & 12 deletions docs/api/assets/cloud-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@

::: pyatlan.model.assets.a_d_l_s_object.ADLSObject

## GCS

::: pyatlan.model.assets.g_c_s.GCS

## GCSBucket

::: pyatlan.model.assets.g_c_s_bucket.GCSBucket
Expand All @@ -52,14 +48,6 @@

::: pyatlan.model.assets.a_w_s.AWS

## Google

::: pyatlan.model.assets.google.Google

## Azure

::: pyatlan.model.assets.azure.Azure

## Cloud

::: pyatlan.model.assets.cloud.Cloud
4 changes: 0 additions & 4 deletions docs/api/assets/other-bi.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,6 @@

::: pyatlan.model.assets.sisense_widget.SisenseWidget

## DataStudio

::: pyatlan.model.assets.data_studio.DataStudio

## DataStudioAsset

::: pyatlan.model.assets.data_studio_asset.DataStudioAsset
Expand Down
24 changes: 0 additions & 24 deletions docs/api/assets/other-connectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,3 @@
## DataverseEntity

::: pyatlan.model.assets.dataverse_entity.DataverseEntity

## DremioVirtualDataset

::: pyatlan.model.assets.dremio_virtual_dataset.DremioVirtualDataset

## DremioColumn

::: pyatlan.model.assets.dremio_column.DremioColumn

## DremioSpace

::: pyatlan.model.assets.dremio_space.DremioSpace

## DremioPhysicalDataset

::: pyatlan.model.assets.dremio_physical_dataset.DremioPhysicalDataset

## DremioFolder

::: pyatlan.model.assets.dremio_folder.DremioFolder

## DremioSource

::: pyatlan.model.assets.dremio_source.DremioSource
25 changes: 21 additions & 4 deletions generator
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,26 @@
# This script runs both create_typedefs_file.py and class_generator.py
# It intelligently skips creating typedefs if they already exist and are current

# Usage: ./generator [typedefs_file_path]
# Usage: ./generator [--override] [typedefs_file_path]
# If typedefs_file_path is not provided, defaults to /tmp/typedefs.json
# --override: force re-download of typedefs even if cached file is current

echo "🚀 Starting Atlan Python SDK code generation..."

# Parse flags
FORCE_OVERRIDE=false
TYPE_DEF_FILE_ARG=""
for arg in "$@"; do
case "$arg" in
--override)
FORCE_OVERRIDE=true
;;
*)
TYPE_DEF_FILE_ARG="$arg"
;;
esac
done

# Check if ATLAN_BASE_URL and ATLAN_API_KEY are set
if [ -z "$ATLAN_BASE_URL" ] || [ -z "$ATLAN_API_KEY" ]; then
echo "❌ Error: ATLAN_BASE_URL and ATLAN_API_KEY environment variables must be set."
Expand All @@ -19,8 +34,8 @@ if [ -z "$ATLAN_BASE_URL" ] || [ -z "$ATLAN_API_KEY" ]; then
fi

# Get the typedefs file path from command line argument or use default
if [ -n "$1" ]; then
TYPE_DEF_FILE="$1"
if [ -n "$TYPE_DEF_FILE_ARG" ]; then
TYPE_DEF_FILE="$TYPE_DEF_FILE_ARG"
echo "📁 Using custom typedefs file: $TYPE_DEF_FILE"
else
TMPDIR=${TMPDIR:-/tmp}
Expand All @@ -30,7 +45,9 @@ fi

# Check if typedefs file exists and is current (created today)
SHOULD_CREATE_TYPEDEFS=true
if [ -f "$TYPE_DEF_FILE" ]; then
if [ "$FORCE_OVERRIDE" = true ]; then
echo "🔄 --override flag set, forcing typedefs re-download"
elif [ -f "$TYPE_DEF_FILE" ]; then
# Check if file was created today
if [ "$(date -r "$TYPE_DEF_FILE" +%Y-%m-%d)" = "$(date +%Y-%m-%d)" ]; then
echo "✅ Typedefs file already exists and is current: $TYPE_DEF_FILE"
Expand Down
12 changes: 12 additions & 0 deletions pyatlan/generator/class_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,18 @@ class AssetInfo:
"FabricDataflowEntityColumn",
"FabricReport",
"FabricSemanticModel",
"Agentic",
"Artifact",
"Skill",
"SkillArtifact",
"Context",
"ContextRepository",
"ContextArtifact",
"Dremio",
"Cloud",
Comment thread
Aryamanz29 marked this conversation as resolved.
"Google",
"GCPDataplex",
"GCPDataplexAspectType",
}
_IGNORE_ASSETS = {} # type: ignore[var-annotated]

Expand Down
21 changes: 21 additions & 0 deletions pyatlan/generator/templates/methods/asset/context_artifact.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

@classmethod
@init_guid
def creator(
cls,
*,
name: str,
context_repository_qualified_name: str,
file_type: FileType,
) -> ContextArtifact:
validate_required_fields(
["name", "context_repository_qualified_name", "file_type"],
[name, context_repository_qualified_name, file_type],
)
return ContextArtifact(
attributes=ContextArtifact.Attributes.creator(
name=name,
context_repository_qualified_name=context_repository_qualified_name,
file_type=file_type,
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

@classmethod
@init_guid
def creator(cls, *, name: str) -> ContextRepository:
validate_required_fields(["name"], [name])
return ContextRepository(
attributes=ContextRepository.Attributes.creator(name=name)
)
6 changes: 6 additions & 0 deletions pyatlan/generator/templates/methods/asset/skill.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

@classmethod
@init_guid
def creator(cls, *, name: str) -> Skill:
validate_required_fields(["name"], [name])
return Skill(attributes=Skill.Attributes.creator(name=name))
17 changes: 17 additions & 0 deletions pyatlan/generator/templates/methods/asset/skill_artifact.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

@classmethod
@init_guid
def creator(
cls, *, name: str, skill_qualified_name: str, file_type: FileType
) -> SkillArtifact:
validate_required_fields(
["name", "skill_qualified_name", "file_type"],
[name, skill_qualified_name, file_type],
)
return SkillArtifact(
attributes=SkillArtifact.Attributes.creator(
name=name,
skill_qualified_name=skill_qualified_name,
file_type=file_type,
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

@classmethod
@init_guid
def creator(
cls,
*,
name: str,
context_repository_qualified_name: str,
file_type: FileType,
) -> ContextArtifact.Attributes:
validate_required_fields(
["name", "context_repository_qualified_name", "file_type"],
[name, context_repository_qualified_name, file_type],
)
return ContextArtifact.Attributes(
name=name,
qualified_name=(
f"{context_repository_qualified_name}/artifact/"
f"{file_type.value}/{generate_nanoid()}"
),
file_type=file_type,
context_repository_qualified_name=context_repository_qualified_name,
context_repository=ContextRepository.ref_by_qualified_name(
context_repository_qualified_name
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

@classmethod
@init_guid
def creator(cls, *, name: str) -> ContextRepository.Attributes:
validate_required_fields(["name"], [name])
return ContextRepository.Attributes(
name=name,
qualified_name=f"default/context/{generate_nanoid()}",
)
9 changes: 9 additions & 0 deletions pyatlan/generator/templates/methods/attribute/skill.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

@classmethod
@init_guid
def creator(cls, *, name: str) -> Skill.Attributes:
validate_required_fields(["name"], [name])
return Skill.Attributes(
name=name,
qualified_name=f"default/skill/{generate_nanoid()}",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

@classmethod
@init_guid
def creator(
cls, *, name: str, skill_qualified_name: str, file_type: FileType
) -> SkillArtifact.Attributes:
validate_required_fields(
["name", "skill_qualified_name", "file_type"],
[name, skill_qualified_name, file_type],
)
return SkillArtifact.Attributes(
name=name,
qualified_name=(
f"{skill_qualified_name}/artifact/{file_type.value}"
f"/{generate_nanoid()}"
),
file_type=file_type,
skill_source=Skill.ref_by_qualified_name(skill_qualified_name),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from nanoid import generate as generate_nanoid # type: ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from nanoid import generate as generate_nanoid # type: ignore
1 change: 1 addition & 0 deletions pyatlan/generator/templates/methods/imports/skill.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from nanoid import generate as generate_nanoid # type: ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from nanoid import generate as generate_nanoid # type: ignore
Loading
Loading