Module crowdin_api.api_resources.source_files.resource
Classes
class SourceFilesResource (requester: APIRequester, project_id: Optional[int] = None, page_size=25)
-
Resource for Source Files.
Source files are resources for translation. You can keep files structure using folders or manage different versions of the content via branches.
Use API to keep the source files up to date, check on file revisions, and manage project branches. Before adding source files to the project, upload each file to the Storage first.
Note: If you use branches, make sure your master branch is the first one you integrate with Crowdin.
Link to documentation: https://developer.crowdin.com/api/v2/#tag/Source-Files
Ancestors
Methods
def add_branch(self, name: str, projectId: Optional[int] = None, title: Optional[str] = None, exportPattern: Optional[str] = None, priority: Optional[Priority] = None)
-
Add Branch.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.branches.post
def add_directory(self, name: str, projectId: Optional[int] = None, branchId: Optional[int] = None, directoryId: Optional[int] = None, title: Optional[int] = None, exportPattern: Optional[str] = None, priority: Optional[Priority] = None)
-
Add Directory.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.directories.post
def add_file(self, storageId: int, name: str, projectId: Optional[int] = None, branchId: Optional[int] = None, directoryId: Optional[int] = None, title: Optional[int] = None, context: Optional[str] = None, type: Optional[FileType] = FileType.AUTO, importOptions: Union[SpreadsheetImportOptions, XmlImportOptions, DocxFileImportOptions, OtherImportOptions, HtmlFileImportOptions, HtmlWithFrontMatterFileImportOptions, MdxV1FileImportOptions, MdxV2FileImportOptions, None] = None, exportOptions: Union[PropertyExportOptions, GeneralExportOptions, JavascriptExportOptions, None] = None, excludedTargetLanguages: Optional[Iterable[str]] = None, attachLabelIds: Optional[Iterable[int]] = None)
-
Add File.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.files.post
def delete_branch(self, branchId: int, projectId: Optional[int] = None)
-
Delete Branch.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.branches.delete
def delete_directory(self, directoryId: int, projectId: Optional[int] = None)
-
Delete Directory.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.directories.delete
def delete_file(self, fileId: int, projectId: Optional[int] = None)
-
Delete File.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.files.delete
def download_file(self, fileId: int, projectId: Optional[int] = None)
-
Download File.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.files.download.get
def download_file_preview(self, fileId: int, projectId: Optional[int] = None)
-
Download File Preview.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.files.preview.get
def edit_branch(self, branchId: int, data: Iterable[BranchPatchRequest], projectId: Optional[int] = None)
-
Edit Branch.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.branches.patch
def edit_directory(self, directoryId: int, data: Iterable[DirectoryPatchRequest], projectId: Optional[int] = None)
-
Edit Directory.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.directories.patch
def edit_file(self, fileId: int, data: Iterable[FilePatchRequest], projectId: Optional[int] = None)
-
Edit File.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.files.patch
def get_branch(self, branchId: int, projectId: Optional[int] = None)
-
Get Branch.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.branches.get
def get_branch_path(self, projectId: int, branchId: Optional[int] = None)
def get_directory(self, directoryId: int, projectId: Optional[int] = None)
-
Get Directory.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.directories.get
def get_directory_path(self, projectId: int, directoryId: Optional[int] = None)
def get_file(self, fileId: int, projectId: Optional[int] = None)
-
Get File.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.files.get
def get_file_path(self, projectId: int, fileId: Optional[int] = None)
def get_file_revision(self, fileId: int, revisionId: int, projectId: Optional[int] = None)
-
Get File Revision.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.files.revisions.get
def get_file_revisions_path(self, projectId: int, fileId: int, revisionId: Optional[int] = None)
def list_directories(self, projectId: Optional[int] = None, orderBy: Optional[Sorting] = None, branchId: Optional[int] = None, directoryId: Optional[int] = None, filter: Optional[str] = None, recursion=None, page: Optional[int] = None, offset: Optional[int] = None, limit: Optional[int] = None)
-
List Directories.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.directories.getMany
def list_file_revisions(self, fileId: int, projectId: Optional[int] = None, page: Optional[int] = None, offset: Optional[int] = None, limit: Optional[int] = None)
-
List File Revisions.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.files.revisions.getMany
def list_files(self, projectId: Optional[int] = None, orderBy: Optional[Sorting] = None, branchId: Optional[int] = None, directoryId: Optional[int] = None, filter: Optional[str] = None, recursion: Any = None, page: Optional[int] = None, offset: Optional[int] = None, limit: Optional[int] = None)
-
List Files.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.files.getMany
def list_project_branches(self, projectId: Optional[int] = None, orderBy: Optional[Sorting] = None, name: Optional[str] = None, page: Optional[int] = None, offset: Optional[int] = None, limit: Optional[int] = None)
-
List Branches.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.branches.getMany
def restore_file(self, fileId: int, revisionId: int, projectId: Optional[int] = None)
-
Restore File.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.files.put
def update_file(self, fileId: int, storageId: int, projectId: Optional[int] = None, updateOption: Optional[FileUpdateOption] = None, importOptions: Union[SpreadsheetImportOptions, XmlImportOptions, DocxFileImportOptions, OtherImportOptions, HtmlFileImportOptions, HtmlWithFrontMatterFileImportOptions, MdxV1FileImportOptions, MdxV2FileImportOptions, None] = None, exportOptions: Union[PropertyExportOptions, GeneralExportOptions, JavascriptExportOptions, None] = None, attachLabelIds: Optional[Iterable[int]] = None, detachLabelIds: Optional[Iterable[int]] = None)
-
Update File.
Link to documentation: https://developer.crowdin.com/api/v2/#operation/api.projects.files.put