EAClient¶
- class everyaction.client.EAClient(app_name: Optional[str] = None, api_key: Optional[str] = None, *, endpoint: Optional[str] = None, mode: Optional[Union[int, str]] = None, from_env: Optional[bool] = None)¶
- __init__(app_name: Optional[str] = None, api_key: Optional[str] = None, *, endpoint: Optional[str] = None, mode: Optional[Union[int, str]] = None, from_env: Optional[bool] = None) None¶
Use the given arguments and environment variables to initialize the client.
- Parameters
app_name – The API key’s application name. See EveryAction Authentication for more information.
api_key – The API key for the client to use. If the database mode is not specified, the last two characters of the key should be the “pipe” (|) character followed by a digit indicating the database mode. Conversely, this should not be the case when mode is specified. See EveryAction Authentication for more information.
endpoint – The endpoint to use. Supports the aliases “US” for the endpoint for US-based clients and “INTL” for internationally-based clients.
mode – The database mode to use. Supports the case-insensitive names “VoterFile” and “MyCampaign”, as well as the digit to be appended to the API key. The mode should be explicitly specified if and only if it is not implicitly specified in the API key (see api_key above). See EveryAction Authentication for more information.
from_env – When True, retrieve the application name from the EVERYACTION_APP_NAME environment variable and the api key from the EVERYACTION_API_KEY environment variable. from_env should be False or unspecified when either of app_name or api_key is specified. mode may either be explicitly specified, or implicit in the api key environment variable (but not both). When none of app_name, api_key, or from_env is specified, the default behavior is to proceed as if from_env=True.
- activist_codes: ActivistCodes¶
Activist Codes service.
- api_key_profile() APIKeyProfile¶
Retrieves the profile associated with the API key this client is using.
- Returns
The resulting
APIKeyProfileobject.
- property app_name: str¶
Application name for this client.
- bargaining_units: BargainingUnits¶
Bargaining Units service.
- bulk_import: BulkImport¶
Bulk Import service.
- canvass_file_requests: CanvassFileRequests¶
Canvass File Requests service.
- canvass_responses: CanvassResponses¶
Canvass Responses service.
- changed_entities: ChangedEntities¶
Changed Entities service.
- close() None¶
Close the session associated with this client. Note that you will not be able to send requests after calling this method.
- commitments: Commitments¶
Commitments service.
- contributions: Contributions¶
Contributions service.
- custom_fields: CustomFields¶
Custom Fields service.
- property default_limit: int¶
Default limit on the number of records a request may get for a paginated response. Set to 0 for no limit.
- delete(route: str, **kwargs: Any) Response¶
Send a DELETE request to the configured EveryAction endpoint with the given path and arguments.
- Parameters
route – Path to send request to.
kwargs – Additional arguments to pass to the request.
- Returns
The
Responseto the request.
- demographics: ReportedDemographics¶
Reported Demographics service.
- departments: Departments¶
Departments service.
- designations: Designations¶
Designations service.
- disbursements: Disbursements¶
Disbursements service.
- district_fields: DistrictFields¶
District Fields service.
- email: EmailMessages¶
Email service.
- property endpoint: str¶
Endpoint to send EveryAction requests to.
- event_types: EventTypes¶
Event Types service.
- export_jobs: ExportJobs¶
Export Jobs service.
- extended_source_codes: ExtendedSourceCodes¶
Extended Source Codes service.
- file_loading_jobs: FileLoadingJobs¶
File-Loading Jobs service.
- financial_batches: FinancialBatches¶
Financial Batches service.
- forms: OnlineActionsForms¶
Online Actions Forms service.
- get(route: str, **kwargs: Any) Response¶
Send a GET request to the configured EveryAction endpoint with the given path and arguments.
- Parameters
route – Path to send request to.
kwargs – Additional arguments to pass to the request.
- Returns
The
Responseto the request.
- job_classes: JobClasses¶
Job Classes service.
- member_statuses: MemberStatuses¶
Member Statuses service.
- minivan_exports: MiniVANExports¶
MiniVAN Exports service.
- property mode: str¶
Database mode used by the client (VoterFile or MyCampaign).
- patch(route: str, **kwargs: Any) Response¶
Send a PATCH request to the configured EveryAction endpoint with the given path and arguments.
- Parameters
route – Path to send request to.
kwargs – Additional arguments to pass to the request.
- Returns
The
Responseto the request.
- post(route: str, **kwargs: Any) Response¶
Send a POST request to the configured EveryAction endpoint with the given path and arguments.
- Parameters
route – Path to send request to.
kwargs – Additional arguments to pass to the request.
- Returns
The
Responseto the request.
- printed_lists: PrintedLists¶
Printed Lists service.
- put(route: str, **kwargs: Any) Response¶
Send a PUT request to the configured EveryAction endpoint with the given path and arguments.
- Parameters
route – Path to send request to.
kwargs – Additional arguments to pass to the request.
- Returns
The
Responseto the request.
- questions: SurveyQuestions¶
Survey Questions service.
- registration_batches: VoterRegistrationBatches¶
Voter Registration Batches service.
- relationships: Relationships¶
Relationships service.
- saved_lists: SavedLists¶
Saved Lists service.
- schedule_types: ScheduleTypes¶
Schedule Types service.
- score_updates: ScoreUpdates¶
Score Updates service.
- shift_types: ShiftTypes¶
Shift Types service.
- supporter_groups: SupporterGroups¶
Supporter Groups service.
- target_export_jobs: TargetExportJobs¶
Target Export Jobs service.