AssemblyLine.al_general
- AssemblyLine.al_general
- deepcopy
- Callable
- Dict
- List
- Literal
- Union
- Optional
- Any
- Address
- as_datetime
- capitalize
- comma_and_list
- comma_list
- country_name
- DADateTime
- DADict
- DAFile
- DAList
- date_difference
- DAWeb
- ensure_definition
- get_config
- get_country
- her
- his
- Individual
- IndividualName
- its
- phone_number_formatted
- phone_number_is_valid
- showifdef
- state_name
- states_list
- subdivision_type
- their
- url_action
- validation_error
- word
- your
- log
- value
- functions
- random
- re
- pycountry
- __all__
- safe_subdivision_type
- ALAddress
- ALAddressList
- ALNameList
- ALPeopleList
- ALIndividual
- previous_addresses
- other_addresses
- mailing_address
- service_address
- previous_names
- aliases
- preferred_name
- init
- signature_if_final
- phone_numbers
- contact_methods
- merge_letters
- formatted_age
- normalized_address
- name_fields
- address_fields
- gender_fields
- pronoun_fields
- get_pronouns
- list_pronouns
- language_fields
- language_name
- gender_male
- gender_female
- gender_other
- gender_nonbinary
- gender_unknown
- gender_undisclosed
- gender_self_described
- contact_fields
- initials
- address_block
- pronoun
- pronoun_objective
- pronoun_possessive
- pronoun_subjective
- pronoun_reflexive
- name_full
- name_initials
- name_short
- familiar
- __str__
- section_links
- Landlord
- Tenant
- HousingAuthority
- Applicant
- Abuser
- Survivor
- VCIndividual
- AddressList
- PeopleList
- will_send_to_real_court
- filter_letters
- is_sms_enabled
- is_phone_or_email
- github_modified_date
- language_name
- safe_states_list
- has_parsable_pronouns
- parse_custom_pronouns
- get_visible_al_nav_items
deepcopy
Callable
Dict
List
Literal
Union
Optional
Any
Address
as_datetime
capitalize
comma_and_list
comma_list
country_name
DADateTime
DADict
DAFile
DAList
date_difference
DAWeb
ensure_definition
get_config
get_country
her
his
Individual
IndividualName
its
phone_number_formatted
phone_number_is_valid
showifdef
state_name
states_list
subdivision_type
their
url_action
validation_error
word
your
log
value
functions
random
re
pycountry
__all__
safe_subdivision_type
def safe_subdivision_type(country_code: str) -> Optional[str]
Returns the subdivision type for the country with the given country code. If no subdivision type is found, returns None.
Arguments
country_codestr - The ISO-3166-1 alpha-2 code for the country.
Returns
Optional[str]- The subdivision type for the country with the given country code.
Example
The value of address_region_label for a US address:
Input (interview YAML)
code: |
address_region_label = safe_subdivision_type("US")
Output
State
ALAddress Objects
class ALAddress(Address)
This class is used to store addresses. The ALAddress class extends the Address
class with the address_fields() method and "smarter"
handling of the unit attribute when printing a formatted address.
Attributes
addressstr - The street where the person lives.unitstr - The unit number where the person lives.citystr - The city where the person lives.statestr - The state where the person lives.zipstr - The zip code where the person lives.countrystr - The country where the person lives.impoundedOptional[bool] - Whether the address is impounded.
Example
With assembly_line.yml included, users is an ALPeopleList,
users[0] is an ALIndividual, and users[0].address is an ALAddress.
For a custom list, declare it with an objects block as shown below.
Use these question blocks in your interview flow:
objects:
- users: ALPeopleList
question: |
Where do you live?
fields:
- code: users[0].address.address_fields()
question: |
What is your name?
fields:
- code: users[0].name_fields()
question: |
Check your information
subquestion: |
${ users[0].familiar() } lives at ${ users[0].address.on_one_line() }.
init
def init(*pargs, **kwargs) -> None
Standard DAObject init method.
Arguments
*pargs- Positional arguments.**kwargs- Keyword arguments.
Example
Docassemble calls init() automatically during object creation.
See the class example for the rest of the setup.
objects:
- users: ALPeopleList
names_and_addresses_on_one_line
def names_and_addresses_on_one_line(comma_string: str = "; ",
bare=False) -> str
Provide names and addresses of individuals on one line.
Arguments
comma_stringstr, optional - The string to use between name-address pairs. Defaults to '; '.barebool, optional - If True, prevents appending the word "Unit" to the unit attribute. Defaults to False.
Returns
str- Formatted string of names followed by addresses.
Example
In question or Markdown attachment text (Mako):
${ users.names_and_addresses_on_one_line() }
In a DOCX template (Jinja2):
{{ users.names_and_addresses_on_one_line() }}
familiar
def familiar(unique_names: Optional[list] = None,
default: Optional[str] = None) -> str
Provide a list of familiar forms of names of individuals, in the most familiar way possible while preserving uniqueness. When possible, it will return just the first name of each individual.
See ALIndividual.familiar for how the familiar form of each individual is determined.
Arguments
unique_nameslist - A list of unique names to check input against.defaultstr - The default name to use if a unique name is not available.
Returns
str- Formatted string of familiar names.
Example
With a gathered users list containing Alex Morgan Rivera, Jordan
Chen, and Taylor Brooks, in that order, with no suffixes or preferred
names, and the interview language set to English:
Input (Mako)
${ users.familiar() }
Input (Jinja2)
{{ users.familiar() }}
Output
Alex, Jordan, and Taylor
familiar_or
def familiar_or(unique_names: Optional[list] = None,
default: Optional[str] = None) -> str
Provide a list of familiar forms of names of individuals separated by 'or', using the most familiar form possible while preserving uniqueness. When possible, it will return just the first name of each individual.
See ALIndividual.familiar for how the familiar form of each individual is determined.