Skip to content

Commit

Permalink
refactor: Use __all__ to expose public API (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Aug 17, 2023
1 parent f49d41e commit c3c7251
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/unreleased/Refactored-20230815-200414.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: Refactored
body: Use `__all__` to expose public API
time: 2023-08-15T20:04:14.027511-06:00
custom:
Issue: "935"
7 changes: 7 additions & 0 deletions src/citric/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
else:
from typing_extensions import Self, Unpack

__all__ = [
"QuestionReference",
"FileMetadata",
"UploadedFile",
"Client",
]

EMAILS_SENT_STATUS_PATTERN = re.compile(r"(-?\d+) left to send")


Expand Down
15 changes: 15 additions & 0 deletions src/citric/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@

import enum

__all__ = [
"StringEnum",
"ImportGroupType",
"ImportSurveyType",
"NewSurveyType",
"StatisticsExportFormat",
"ResponsesExportFormat",
"SurveyCompletionStatus",
"HeadingType",
"ResponseType",
"TimelineAggregationPeriod",
"QuotaAction",
"EmailSendStrategy",
]


class StringEnum(str, enum.Enum):
"""Enum with string values."""
Expand Down
2 changes: 2 additions & 0 deletions src/citric/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import typing as t

__all__ = ["Method"]

T = t.TypeVar("T")


Expand Down
16 changes: 16 additions & 0 deletions src/citric/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@

from citric import enums

__all__ = [
"Result",
"FileUploadResult",
"GroupProperties",
"LanguageProperties",
"OperationStatus",
"QuestionsListElement",
"QuestionProperties",
"QuotaListElement",
"QuotaProperties",
"RPCResponse",
"SetQuotaPropertiesResult",
"SurveyProperties",
"CPDBParticipantImportResult",
]

Result: TypeAlias = t.Any
YesNo: TypeAlias = t.Literal["Y", "N"]

Expand Down

0 comments on commit c3c7251

Please sign in to comment.