trackteroid
1.0.0
FTRACKクエリの宣言的なオブジェクト指向ラッパー。結果として生じるコレクションとの強力な機能スタイルの相互作用。
Trackteroidは、FtrackとそのPython APIに依存しており、メディアおよびエンターテイメント業界向けに設計されたプロジェクト管理および制作追跡ソフトウェアです。これは、映画、テレビ、アニメーション、視覚効果、ゲームの分野で一般的に使用されています。
PIPを使用してインストールして更新します:
pip install trackteroidFTRACK Python APIの周りにラッピングAPIを構築して、Python APIと直接対話するときに発生するいくつかの制限と課題に対処することにしました。 FTRACK Python APIは多くの柔軟性を提供しますが、開発とメンテナンスをより面倒で直感的にすることができる特定の側面があります。ラッピングAPIを作成することにより、これらの課題を克服し、より合理化された開発者に優しい体験を提供することを目指しています。この決定の主な理由は次のとおりです。
クエリの簡素化
クエリパフォーマンスの最適化
データベーススキーマの複雑さを抽象化します
結果として生じるコレクションを強化します
フィールドアクセシビリティが向上しました
要約すると、Trackeroidは、FTRACKプラットフォームと対話するためのより直感的で効率的な方法を提供し、最終的に開発を加速し、コードの品質を改善し、ユーザーエクスペリエンス全体を強化することにより、開発者に力を与えようとします。
Trackteroidで...
# Calculate and display the total time duration logged for
# AssetBuild types within specified Shots and Folders.
#
# output:
# Found 9 assetbuilds.
# Found 1 assetbuilds with timelogs.
# {16.0: ['Drone Craft'],
# 'No time tracked yet.': ['Drawer Cabinet 01',
# 'Gothic Commode 01',
# 'Shelf 01',
# 'Side Table 01',
# 'Small Wooden Table 01',
# 'Vintage Wooden Drawer 01',
# 'Wooden Table 01',
# 'Wooden Table 02']}
from pprint import pprint
from trackteroid import (
Query ,
AssetBuild ,
Folder ,
Task ,
Project
)
assetbuild_collection = Query ( AssetBuild ).
by_name ( Project , "sync" , "showroom" ).
by_name ( Folder , "Asset%" , "Delivery 3" ).
get_all (
projections = [
Task . Timelog ,
Task . Timelog . duration
]
)
print (
f"Found { len ( assetbuild_collection ) } assets. n "
f"Found { assetbuild_collection . count ( lambda ac : ac . Task . Timelog ) } assetbuilds with timelogs."
)
pprint (
assetbuild_collection . group_and_map (
lambda abc : abc . Task . Timelog . fold (
0 ,
lambda current , tc : current + tc . duration [ 0 ] / 3600
) or "No time tracked yet." ,
lambda abc : abc . sort (
lambda abc : abc . name
). name
)
)... FTRACK Python APIとは対照的です。
# Calculate and display the total time duration logged for
# AssetBuild types within specified Shots and Folders.
#
# output:
# Found 9 assetbuilds.
# Found 1 assetbuilds with timelogs.
# {16.0: ['Drone Craft'],
# 'No time tracked yet.': ['Drawer Cabinet 01',
# 'Gothic Commode 01',
# 'Shelf 01',
# 'Side Table 01',
# 'Small Wooden Table 01',
# 'Vintage Wooden Drawer 01',
# 'Wooden Table 01',
# 'Wooden Table 02']}
from pprint import pprint
import ftrack_api
session = ftrack_api . Session ( auto_connect_event_hub = False , auto_populate = False )
project_names = ( "sync" , "showroom" )
folder_specific = "Delivery 3"
folder_unspecific = "Asset%"
query = (
f"select id, name, assets.name, parent.name, project.name, "
f"assets.versions.task.timelogs, assets.versions.task.timelogs.duration "
f"from AssetBuild where project has (name in { project_names } ) "
f"and parent[Folder] has (name is ' { folder_specific } ' or name like ' { folder_unspecific } ')"
)
assetbuilds_no_duration = [ "No time tracked yet." , []]
assetbuilds_timelog_duration = [ 0 , []]
assetbuilds = session . query ( query ). all ()
for assetbuild in assetbuilds :
has_duration = False
for asset in assetbuild [ "assets" ]:
for version in asset [ "versions" ]:
durations = [ _ [ "duration" ] for _ in version [ "task" ][ "timelogs" ]]
if any ( durations ):
for duration in durations :
assetbuilds_timelog_duration [ 0 ] += duration / 3600
if not has_duration :
has_duration = True
if has_duration :
assetbuilds_timelog_duration [ 1 ]. append ( assetbuild [ "name" ])
else :
assetbuilds_no_duration [ 1 ]. append ( assetbuild [ "name" ])
print (
f"Found { len ( assetbuilds ) } assetbuilds. n "
f"Found { len ( assetbuilds_timelog_duration [ 1 ]) } assetbuilds with timelogs."
)
assetbuilds_no_duration [ 1 ]. sort ()
assetbuilds_timelog_duration [ 1 ]. sort ()
pprint (
dict (
[ assetbuilds_no_duration , assetbuilds_timelog_duration ]
)
)使用状況の詳細については、最新のドキュメントを参照してください。