View Source on Github

Attributes

classes

list[ Class ]

Get a recursive list of all classes in the directory and its subdirectories.

dirpath

str

files

list[ File ]

Get a recursive list of all files in the directory and its subdirectories.

functions

list[ Function ]

Get a recursive list of all functions in the directory and its subdirectories.

global_vars

list[ Assignment ]

Get a recursive list of all global variables in the directory and its subdirectories.

import_statements

Get a recursive list of all import statements in the directory and its subdirectories.

items

dict[str, File | Directory ]

name

str

Get the base name of the directory's path.

parent

Directory | None

path

Path

subdirectories

list[ Directory ]

Get a recursive list of all subdirectories in the directory and its subdirectories.

symbols

list[ Symbol ]

Get a recursive list of all symbols in the directory and its subdirectories.

Methods

add_file

Add a file to the directory.

View Source on Github

Returns

None

add_subdirectory

Add a subdirectory to the directory.

View Source on Github

Returns

None

get_class

Get a class by name in the directory and its subdirectories.

View Source on Github

Returns

Class | None

get_file

Get a file by its name relative to the directory.

View Source on Github

Returns

File | None

get_function

Get a function by name in the directory and its subdirectories.

View Source on Github

Returns

Function | None

get_global_var

Get a global variable by name in the directory and its subdirectories.

View Source on Github

Returns

Assignment | None

get_import_statement

Get an import statement by name in the directory and its subdirectories.

View Source on Github

Returns

get_subdirectory

Get a subdirectory by its path relative to the directory.

View Source on Github

Returns

Directory | None

get_symbol

Get a symbol by name in the directory and its subdirectories.

View Source on Github

Returns

Symbol | None

remove

Remove the directory and all its files and subdirectories.

View Source on Github

Returns

None

remove_file

Remove a file from the directory.

View Source on Github

Returns

None

remove_file_by_path

Remove a file from the directory by its path.

View Source on Github

Returns

None

remove_subdirectory

Remove a subdirectory from the directory.

View Source on Github

Returns

None

remove_subdirectory_by_path

Remove a subdirectory from the directory by its path.

View Source on Github

Returns

None

rename

Rename the directory.

View Source on Github

Returns

None

update_filepath

Update the filepath of the directory.

View Source on Github

Returns

None

Was this page helpful?