Python "DSCore" CLR Library Guide/Dictionary Documentation

I’m learning to translate design script into python nodes in dynamo.

I found forum post about importing the design script library into python through CLR
Import all Design Script Methods to Python

import clr

clr.AddReference('DSCoreNodes')
import DSCore

The problem is that I don’t want to import all the methods available in the library.
Does anyone know of any guides or dictionary documentation that explains the sublibrary or children’s methods of the library?

Excluding the use of the Python dir() method.
Preferably like the Revit API website Revit API Docs

The end result will be that I can input a specified library from “DSCore”

import clr

clr.AddReference('DSCoreNodes')
from DSCore import String #example only import String Method Library (Part of DSCore)

or

import clr

clr.AddReference('DSCoreNodes')
from DSCore.String import StartsWith #example only import String.StartsWith Method (Part of DSCore)

Most of the DSCore library functions have a Python equivalent which ought to be utilized instead of the Dynamo counterpart (ie: list, dictionary, string…). However there are a few specifics which are worth knowing of.

The simplest and most direct method will be to use dir or inspect in Python - this is what I utilize as it’s quicker, allows faster iteration, and ensures I can test the imports in the context of the code as I go for things like type conversion errors.

The other way will be to utilize the github, as each method will list it’s parent class. Dynamo/src/Libraries at master · DynamoDS/Dynamo · GitHub

4 Likes

Thanks for the reply
So as a recap, there is no public dictionary documentation for DSCore

The only way is to look at the GitHub repo of DSCore in this folder
DSCore Github Library
And read every .cs file to look for available classes and their methods under the “DSCore” C# Namespace

example: DSCore.String.Length()
Search this: namespace DSCore / Class String / Methodname Length

1 Like

As far as I know, yes.

That said it would be fairly easy to develop the full list of classes and methods as an external document which could be halted elsewhere by writing the data found via inspect module out to an external document.

1 Like