Skip to content

Instantly share code, notes, and snippets.

@ilhamije
Created April 6, 2021 07:20
Show Gist options
  • Save ilhamije/143fb2205b88b7401348c7e2990976ac to your computer and use it in GitHub Desktop.
Save ilhamije/143fb2205b88b7401348c7e2990976ac to your computer and use it in GitHub Desktop.
COMPANY_SCHEMA = {
'uid': {'type': 'string', 'required': True},
'company_website': {'type': 'string', "required": True},
'company_name': {'type': 'string', 'required': True, 'coerce': str.title},
'company_name_alias': {'type': 'list', 'schema': {'type': 'string'}},
'company_acronym': {'type': 'string'},
'ticker_symbols': {
'type': 'list',
'schema': {
'type': 'dict',
'schema': {
'symbol': {'type': 'string', 'default': None},
'exchange': {'type': 'string', 'default': None}
}
}
},
'company_industry': {
'type': 'list'
},
'share_holders': {
'type': 'dict',
'schema': {
'name': {'type': 'string'},
'type': {'type': 'string'},
'summary': {'type': 'integer'},
'percentage': {'type': 'float'},
}
},
'company_emails': {
'type': 'list',
'schema': {
'type': 'string',
'regex': r'^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$'
}
},
'company_phones': {
'type': 'list',
'schema': {
'type': 'string',
'regex': r'^([0-9\(\)\/\+ \-~\.]*)$'
}
},
'parent_companies': {'type': 'list'},
'subsidiaries': {'type': 'list'},
'company_address': {
'type': 'list',
'required': True,
'schema': {
'type': 'dict',
'schema': {
'country_code': {
'type': 'string',
'required': True,
'allowed': list(map(itemgetter(0), COUNTRIES))
},
'street': {'type': 'string'},
'address': {'type': 'string'},
'state': {'type': 'string'},
'city': {'type': 'string'},
'postcode': {'anyof_type': ['string', 'integer']}
}
}
},
'company_type': {'type': 'integer'},
'processed': {'type': 'boolean', 'default': False}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment