followthemoney 3.6.4__py2.py3-none-any.whl → 3.7.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. followthemoney/__init__.py +1 -1
  2. followthemoney/mapping/entity.py +15 -6
  3. followthemoney/proxy.py +4 -4
  4. followthemoney/schema/BankAccount.yaml +1 -1
  5. followthemoney/schema/Documentation.yml +3 -2
  6. followthemoney/schema/Organization.yaml +1 -1
  7. followthemoney/schema/Person.yaml +2 -2
  8. followthemoney/schema/Position.yaml +1 -1
  9. followthemoney/schema/Post.yaml +1 -1
  10. followthemoney/schema/Project.yaml +1 -1
  11. followthemoney/translations/ar/LC_MESSAGES/followthemoney.mo +0 -0
  12. followthemoney/translations/ar/LC_MESSAGES/followthemoney.po +5 -5
  13. followthemoney/translations/bs/LC_MESSAGES/followthemoney.mo +0 -0
  14. followthemoney/translations/bs/LC_MESSAGES/followthemoney.po +3 -3
  15. followthemoney/translations/de/LC_MESSAGES/followthemoney.mo +0 -0
  16. followthemoney/translations/de/LC_MESSAGES/followthemoney.po +5 -5
  17. followthemoney/translations/es/LC_MESSAGES/followthemoney.mo +0 -0
  18. followthemoney/translations/es/LC_MESSAGES/followthemoney.po +5 -5
  19. followthemoney/translations/fr/LC_MESSAGES/followthemoney.mo +0 -0
  20. followthemoney/translations/fr/LC_MESSAGES/followthemoney.po +5 -5
  21. followthemoney/translations/fr/followthemoney.po +3 -3
  22. followthemoney/translations/messages.pot +143 -60
  23. followthemoney/translations/nb/LC_MESSAGES/followthemoney.mo +0 -0
  24. followthemoney/translations/nb/LC_MESSAGES/followthemoney.po +3 -3
  25. followthemoney/translations/nl/LC_MESSAGES/followthemoney.mo +0 -0
  26. followthemoney/translations/nl/LC_MESSAGES/followthemoney.po +3 -3
  27. followthemoney/translations/pt_BR/LC_MESSAGES/followthemoney.mo +0 -0
  28. followthemoney/translations/pt_BR/LC_MESSAGES/followthemoney.po +3 -3
  29. followthemoney/translations/ru/LC_MESSAGES/followthemoney.mo +0 -0
  30. followthemoney/translations/ru/LC_MESSAGES/followthemoney.po +5 -5
  31. followthemoney/translations/ru/followthemoney.po +4 -4
  32. followthemoney/translations/tr/LC_MESSAGES/followthemoney.mo +0 -0
  33. followthemoney/translations/tr/LC_MESSAGES/followthemoney.po +3 -3
  34. followthemoney/types/checksum.py +1 -0
  35. followthemoney/types/common.py +12 -4
  36. followthemoney/types/country.py +1 -0
  37. followthemoney/types/date.py +1 -0
  38. followthemoney/types/gender.py +1 -0
  39. followthemoney/types/iban.py +4 -1
  40. followthemoney/types/identifier.py +1 -0
  41. followthemoney/types/ip.py +1 -0
  42. followthemoney/types/language.py +1 -0
  43. followthemoney/types/phone.py +1 -0
  44. followthemoney/types/string.py +5 -2
  45. followthemoney/types/topic.py +2 -0
  46. followthemoney/types/url.py +1 -0
  47. {followthemoney-3.6.4.dist-info → followthemoney-3.7.0.dist-info}/METADATA +36 -36
  48. {followthemoney-3.6.4.dist-info → followthemoney-3.7.0.dist-info}/RECORD +53 -53
  49. {followthemoney-3.6.4.dist-info → followthemoney-3.7.0.dist-info}/WHEEL +1 -1
  50. {followthemoney-3.6.4.dist-info → followthemoney-3.7.0.dist-info}/LICENSE +0 -0
  51. {followthemoney-3.6.4.dist-info → followthemoney-3.7.0.dist-info}/entry_points.txt +0 -0
  52. {followthemoney-3.6.4.dist-info → followthemoney-3.7.0.dist-info}/namespace_packages.txt +0 -0
  53. {followthemoney-3.6.4.dist-info → followthemoney-3.7.0.dist-info}/top_level.txt +0 -0
@@ -3,7 +3,7 @@ import os
3
3
  from followthemoney.model import Model
4
4
  from followthemoney.util import set_model_locale
5
5
 
6
- __version__ = "3.6.4"
6
+ __version__ = "3.7.0"
7
7
 
8
8
 
9
9
  model_path = os.path.dirname(__file__)
@@ -20,7 +20,6 @@ log = logging.getLogger(__name__)
20
20
 
21
21
 
22
22
  class EntityMapping(object):
23
-
24
23
  __slots__ = (
25
24
  "model",
26
25
  "name",
@@ -117,22 +116,30 @@ class EntityMapping(object):
117
116
  if prop.prop.type == registry.country:
118
117
  discarded_values = prop.map(proxy, record, entities)
119
118
  for value in discarded_values:
120
- log.warn(f"[{self.name}] Discarded unclean value \"{value}\" for property \"{prop.prop.qname}\".")
119
+ log.warning(
120
+ f'[{self.name}] Discarded unclean value "{value}" for property "{prop.prop.qname}".'
121
+ )
121
122
 
122
123
  for prop in self.properties:
123
124
  if prop.prop.type != registry.country:
124
125
  discarded_values = prop.map(proxy, record, entities)
125
126
  for value in discarded_values:
126
- log.warn(f"[{self.name}] Discarding unclean value \"{value}\" for property \"{prop.prop.qname}\".")
127
+ log.warning(
128
+ f'[{self.name}] Discarding unclean value "{value}" for property "{prop.prop.qname}".'
129
+ )
127
130
 
128
131
  # Generate the ID at the end to avoid self-reference checks on empty
129
132
  # keys.
130
133
  proxy.id = self.compute_key(record)
131
134
  if proxy.id is None:
132
135
  if self.id_column:
133
- log.warn(f"[{self.name}] Skipping entity because no ID could be computed. Make sure that there are no empty values in the \"{self.id_column}\" column.")
136
+ log.warning(
137
+ f'[{self.name}] Skipping entity because no ID could be computed. Make sure that there are no empty values in the "{self.id_column}" column.'
138
+ )
134
139
  if self.keys:
135
- log.warn(f"[{self.name}] Skipping entity because no ID could be computed. Make sure that there are no empty values in key columns.")
140
+ log.warning(
141
+ f"[{self.name}] Skipping entity because no ID could be computed. Make sure that there are no empty values in key columns."
142
+ )
136
143
  return None
137
144
 
138
145
  for prop in self.properties:
@@ -141,7 +148,9 @@ class EntityMapping(object):
141
148
  # the mapping, not in the model. Basically it means: if
142
149
  # this row of source data doesn't have that field, then do
143
150
  # not map it again.
144
- log.warn(f"[{self.name}] Skipping entity because required property \"{prop.prop.name}\" is empty.")
151
+ log.warning(
152
+ f'[{self.name}] Skipping entity because required property "{prop.prop.name}" is empty.'
153
+ )
145
154
  return None
146
155
  return proxy
147
156
 
followthemoney/proxy.py CHANGED
@@ -220,8 +220,8 @@ class EntityProxy(object):
220
220
  # Somewhat hacky: limit the maximum size of any particular
221
221
  # field to avoid overloading upstream aleph/elasticsearch.
222
222
  value_size = len(value)
223
- if prop.type.max_size is not None:
224
- if self._size + value_size > prop.type.max_size:
223
+ if prop.type.total_size is not None:
224
+ if self._size + value_size > prop.type.total_size:
225
225
  # msg = "[%s] too large. Rejecting additional values."
226
226
  # log.warning(msg, prop.name)
227
227
  return None
@@ -309,7 +309,7 @@ class EntityProxy(object):
309
309
  if self.schema.source_prop is not None and self.schema.target_prop is not None:
310
310
  sources = self.get(self.schema.source_prop)
311
311
  targets = self.get(self.schema.target_prop)
312
- for (source, target) in product(sources, targets):
312
+ for source, target in product(sources, targets):
313
313
  yield (source, target)
314
314
 
315
315
  def get_type_values(
@@ -414,7 +414,7 @@ class EntityProxy(object):
414
414
  for a more generous matching approach than the actual country values."""
415
415
  countries = set(self.countries)
416
416
  if not len(countries):
417
- for (prop, value) in self.itervalues():
417
+ for prop, value in self.itervalues():
418
418
  hint = prop.type.country_hint(value)
419
419
  if hint is not None:
420
420
  countries.add(hint)
@@ -4,7 +4,7 @@ BankAccount:
4
4
  extends:
5
5
  - Asset
6
6
  description: >
7
- An account held at a bank and controlled by an owner. This may also be used
7
+ An account held at a bank and controlled by an owner. This may also be used
8
8
  to describe more complex arrangements like correspondent bank settlement accounts.
9
9
  matchable: true
10
10
  featured:
@@ -2,9 +2,10 @@ Documentation:
2
2
  label: "Documentation"
3
3
  plural: "Documentations"
4
4
  description: >
5
- Links some entity to a document, which might provide further detail or
5
+ Links some entity to a document, which might provide further detail or
6
6
  evidence regarding the entity.
7
- extends: Interest
7
+ extends:
8
+ - Interest
8
9
  matchable: false
9
10
  featured:
10
11
  - document
@@ -5,7 +5,7 @@ Organization:
5
5
  plural: Organizations
6
6
  description: >
7
7
  Any type of incorporated entity that cannot be owned by another (see Company). This
8
- might include charities, foundations or state-owned enterprises, depending on their
8
+ might include charities, foundations or state-owned enterprises, depending on their
9
9
  jurisdiction.
10
10
  matchable: true
11
11
  featured:
@@ -90,8 +90,8 @@ Person:
90
90
  label: Eye color
91
91
  hairColor:
92
92
  label: Hair color
93
- identifyingMarks:
94
- label: Identifying marks
93
+ appearance:
94
+ label: Physical appearance
95
95
  religion:
96
96
  label: Religion
97
97
  political:
@@ -8,7 +8,7 @@ Position:
8
8
  description: >
9
9
  A post, role or position within an organization or body.
10
10
  This describes a position one or more people may occupy
11
- and not the occupation of the post by a specific individual at a
11
+ and not the occupation of the post by a specific individual at a
12
12
  specific point in time.
13
13
 
14
14
  'subnationalArea' should be used to further restrict the scope of the
@@ -9,7 +9,7 @@ Post:
9
9
  # But they're using it to define the post as an abstract thing, this
10
10
  # describes the interval in which it is held by an individual.
11
11
  description: >
12
- A post, role or position held by an individual within an organization
12
+ A post, role or position held by an individual within an organization
13
13
  or body. This describes the period for which the position is held,
14
14
  not the abstract concept of the post.
15
15
  featured:
@@ -24,4 +24,4 @@ Project:
24
24
  phase:
25
25
  label: "Phase"
26
26
  goal:
27
- label: "Project goal"
27
+ label: "Project goal"
@@ -450,7 +450,7 @@ msgstr "حسابات بنكية"
450
450
  #: followthemoney/schema/BankAccount.yaml
451
451
  msgid ""
452
452
  "An account held at a bank and controlled by an owner. This may also be used"
453
- " to describe more complex arrangements like correspondent bank settlement "
453
+ " to describe more complex arrangements like correspondent bank settlement "
454
454
  "accounts.\n"
455
455
  msgstr ""
456
456
 
@@ -1625,7 +1625,7 @@ msgstr "مستندات التوثيق"
1625
1625
  #. Documentation.description
1626
1626
  #: followthemoney/schema/Documentation.yml
1627
1627
  msgid ""
1628
- "Links some entity to a document, which might provide further detail or "
1628
+ "Links some entity to a document, which might provide further detail or "
1629
1629
  "evidence regarding the entity.\n"
1630
1630
  msgstr ""
1631
1631
 
@@ -2761,7 +2761,7 @@ msgstr "منظمات"
2761
2761
  msgid ""
2762
2762
  "Any type of incorporated entity that cannot be owned by another (see "
2763
2763
  "Company). This might include charities, foundations or state-owned "
2764
- "enterprises, depending on their jurisdiction.\n"
2764
+ "enterprises, depending on their jurisdiction.\n"
2765
2765
  msgstr ""
2766
2766
 
2767
2767
  #. Ownership.label
@@ -3129,7 +3129,7 @@ msgstr ""
3129
3129
  #. Position.description
3130
3130
  #: followthemoney/schema/Position.yaml
3131
3131
  msgid ""
3132
- "A post, role or position within an organization or body. This describes a position one or more people may occupy and not the occupation of the post by a specific individual at a specific point in time.\n"
3132
+ "A post, role or position within an organization or body. This describes a position one or more people may occupy and not the occupation of the post by a specific individual at a specific point in time.\n"
3133
3133
  "'subnationalArea' should be used to further restrict the scope of the position. It should not simply represent some regional aspect of the role - e.g. the constituency of a national member of parliament - when their legislative jurisdiction is nationwide.\n"
3134
3134
  msgstr ""
3135
3135
 
@@ -3161,7 +3161,7 @@ msgstr ""
3161
3161
  #. Post.description
3162
3162
  #: followthemoney/schema/Post.yaml
3163
3163
  msgid ""
3164
- "A post, role or position held by an individual within an organization or "
3164
+ "A post, role or position held by an individual within an organization or "
3165
3165
  "body. This describes the period for which the position is held, not the "
3166
3166
  "abstract concept of the post.\n"
3167
3167
  msgstr ""
@@ -440,7 +440,7 @@ msgstr ""
440
440
  #: followthemoney/schema/BankAccount.yaml
441
441
  msgid ""
442
442
  "An account held at a bank and controlled by an owner. This may also be used"
443
- " to describe more complex arrangements like correspondent bank settlement "
443
+ " to describe more complex arrangements like correspondent bank settlement "
444
444
  "accounts.\n"
445
445
  msgstr ""
446
446
 
@@ -1345,7 +1345,7 @@ msgstr ""
1345
1345
  #. Documentation.description
1346
1346
  #: followthemoney/schema/Documentation.yml
1347
1347
  msgid ""
1348
- "Links some entity to a document, which might provide further detail or "
1348
+ "Links some entity to a document, which might provide further detail or "
1349
1349
  "evidence regarding the entity.\n"
1350
1350
  msgstr ""
1351
1351
 
@@ -2416,7 +2416,7 @@ msgstr "Organizacije"
2416
2416
  msgid ""
2417
2417
  "Any type of incorporated entity that cannot be owned by another (see "
2418
2418
  "Company). This might include charities, foundations or state-owned "
2419
- "enterprises, depending on their juristiction.\n"
2419
+ "enterprises, depending on their juristiction.\n"
2420
2420
  msgstr ""
2421
2421
 
2422
2422
  #. Ownership.label
@@ -453,7 +453,7 @@ msgstr "Bankkonten"
453
453
  #: followthemoney/schema/BankAccount.yaml
454
454
  msgid ""
455
455
  "An account held at a bank and controlled by an owner. This may also be used"
456
- " to describe more complex arrangements like correspondent bank settlement "
456
+ " to describe more complex arrangements like correspondent bank settlement "
457
457
  "accounts.\n"
458
458
  msgstr ""
459
459
 
@@ -1623,7 +1623,7 @@ msgstr "Dokumentationen"
1623
1623
  #. Documentation.description
1624
1624
  #: followthemoney/schema/Documentation.yml
1625
1625
  msgid ""
1626
- "Links some entity to a document, which might provide further detail or "
1626
+ "Links some entity to a document, which might provide further detail or "
1627
1627
  "evidence regarding the entity.\n"
1628
1628
  msgstr ""
1629
1629
  "Eine Verweis von einem Objekt auf in Dokument, das weitere Details oder "
@@ -2758,7 +2758,7 @@ msgstr "Organisationen"
2758
2758
  msgid ""
2759
2759
  "Any type of incorporated entity that cannot be owned by another (see "
2760
2760
  "Company). This might include charities, foundations or state-owned "
2761
- "enterprises, depending on their jurisdiction.\n"
2761
+ "enterprises, depending on their jurisdiction.\n"
2762
2762
  msgstr ""
2763
2763
 
2764
2764
  #. Ownership.label
@@ -3129,7 +3129,7 @@ msgstr ""
3129
3129
  #. Position.description
3130
3130
  #: followthemoney/schema/Position.yaml
3131
3131
  msgid ""
3132
- "A post, role or position within an organization or body. This describes a position one or more people may occupy and not the occupation of the post by a specific individual at a specific point in time.\n"
3132
+ "A post, role or position within an organization or body. This describes a position one or more people may occupy and not the occupation of the post by a specific individual at a specific point in time.\n"
3133
3133
  "'subnationalArea' should be used to further restrict the scope of the position. It should not simply represent some regional aspect of the role - e.g. the constituency of a national member of parliament - when their legislative jurisdiction is nationwide.\n"
3134
3134
  msgstr ""
3135
3135
 
@@ -3161,7 +3161,7 @@ msgstr ""
3161
3161
  #. Post.description
3162
3162
  #: followthemoney/schema/Post.yaml
3163
3163
  msgid ""
3164
- "A post, role or position held by an individual within an organization or "
3164
+ "A post, role or position held by an individual within an organization or "
3165
3165
  "body. This describes the period for which the position is held, not the "
3166
3166
  "abstract concept of the post.\n"
3167
3167
  msgstr ""
@@ -450,7 +450,7 @@ msgstr "Cuentas bancarias"
450
450
  #: followthemoney/schema/BankAccount.yaml
451
451
  msgid ""
452
452
  "An account held at a bank and controlled by an owner. This may also be used"
453
- " to describe more complex arrangements like correspondent bank settlement "
453
+ " to describe more complex arrangements like correspondent bank settlement "
454
454
  "accounts.\n"
455
455
  msgstr ""
456
456
 
@@ -1628,7 +1628,7 @@ msgstr "Documentos"
1628
1628
  #. Documentation.description
1629
1629
  #: followthemoney/schema/Documentation.yml
1630
1630
  msgid ""
1631
- "Links some entity to a document, which might provide further detail or "
1631
+ "Links some entity to a document, which might provide further detail or "
1632
1632
  "evidence regarding the entity.\n"
1633
1633
  msgstr ""
1634
1634
 
@@ -2768,7 +2768,7 @@ msgstr "Organizaciones"
2768
2768
  msgid ""
2769
2769
  "Any type of incorporated entity that cannot be owned by another (see "
2770
2770
  "Company). This might include charities, foundations or state-owned "
2771
- "enterprises, depending on their jurisdiction.\n"
2771
+ "enterprises, depending on their jurisdiction.\n"
2772
2772
  msgstr ""
2773
2773
 
2774
2774
  #. Ownership.label
@@ -3137,7 +3137,7 @@ msgstr ""
3137
3137
  #. Position.description
3138
3138
  #: followthemoney/schema/Position.yaml
3139
3139
  msgid ""
3140
- "A post, role or position within an organization or body. This describes a position one or more people may occupy and not the occupation of the post by a specific individual at a specific point in time.\n"
3140
+ "A post, role or position within an organization or body. This describes a position one or more people may occupy and not the occupation of the post by a specific individual at a specific point in time.\n"
3141
3141
  "'subnationalArea' should be used to further restrict the scope of the position. It should not simply represent some regional aspect of the role - e.g. the constituency of a national member of parliament - when their legislative jurisdiction is nationwide.\n"
3142
3142
  msgstr ""
3143
3143
 
@@ -3169,7 +3169,7 @@ msgstr ""
3169
3169
  #. Post.description
3170
3170
  #: followthemoney/schema/Post.yaml
3171
3171
  msgid ""
3172
- "A post, role or position held by an individual within an organization or "
3172
+ "A post, role or position held by an individual within an organization or "
3173
3173
  "body. This describes the period for which the position is held, not the "
3174
3174
  "abstract concept of the post.\n"
3175
3175
  msgstr ""
@@ -452,7 +452,7 @@ msgstr "Comptes bancaires"
452
452
  #: followthemoney/schema/BankAccount.yaml
453
453
  msgid ""
454
454
  "An account held at a bank and controlled by an owner. This may also be used"
455
- " to describe more complex arrangements like correspondent bank settlement "
455
+ " to describe more complex arrangements like correspondent bank settlement "
456
456
  "accounts.\n"
457
457
  msgstr ""
458
458
  "Un compte détenu dans une banque et contrôlé par un propriétaire. Cette "
@@ -1639,7 +1639,7 @@ msgstr "Documentations"
1639
1639
  #. Documentation.description
1640
1640
  #: followthemoney/schema/Documentation.yml
1641
1641
  msgid ""
1642
- "Links some entity to a document, which might provide further detail or "
1642
+ "Links some entity to a document, which might provide further detail or "
1643
1643
  "evidence regarding the entity.\n"
1644
1644
  msgstr ""
1645
1645
  "Associe une entité à un document qui est susceptible d’apporter plus "
@@ -2791,7 +2791,7 @@ msgstr "Organisations"
2791
2791
  msgid ""
2792
2792
  "Any type of incorporated entity that cannot be owned by another (see "
2793
2793
  "Company). This might include charities, foundations or state-owned "
2794
- "enterprises, depending on their jurisdiction.\n"
2794
+ "enterprises, depending on their jurisdiction.\n"
2795
2795
  msgstr ""
2796
2796
 
2797
2797
  #. Ownership.label
@@ -3164,7 +3164,7 @@ msgstr ""
3164
3164
  #. Position.description
3165
3165
  #: followthemoney/schema/Position.yaml
3166
3166
  msgid ""
3167
- "A post, role or position within an organization or body. This describes a position one or more people may occupy and not the occupation of the post by a specific individual at a specific point in time.\n"
3167
+ "A post, role or position within an organization or body. This describes a position one or more people may occupy and not the occupation of the post by a specific individual at a specific point in time.\n"
3168
3168
  "'subnationalArea' should be used to further restrict the scope of the position. It should not simply represent some regional aspect of the role - e.g. the constituency of a national member of parliament - when their legislative jurisdiction is nationwide.\n"
3169
3169
  msgstr ""
3170
3170
 
@@ -3196,7 +3196,7 @@ msgstr ""
3196
3196
  #. Post.description
3197
3197
  #: followthemoney/schema/Post.yaml
3198
3198
  msgid ""
3199
- "A post, role or position held by an individual within an organization or "
3199
+ "A post, role or position held by an individual within an organization or "
3200
3200
  "body. This describes the period for which the position is held, not the "
3201
3201
  "abstract concept of the post.\n"
3202
3202
  msgstr ""
@@ -442,7 +442,7 @@ msgstr "Comptes bancaires"
442
442
  #: followthemoney/schema/BankAccount.yaml
443
443
  msgid ""
444
444
  "An account held at a bank and controlled by an owner. This may also be used"
445
- " to describe more complex arrangements like correspondent bank settlement "
445
+ " to describe more complex arrangements like correspondent bank settlement "
446
446
  "accounts.\n"
447
447
  msgstr ""
448
448
  "Un compte détenu dans une banque et contrôlé par un propriétaire. Cette "
@@ -1368,7 +1368,7 @@ msgstr "Documentations"
1368
1368
  #. Documentation.description
1369
1369
  #: followthemoney/schema/Documentation.yml
1370
1370
  msgid ""
1371
- "Links some entity to a document, which might provide further detail or "
1371
+ "Links some entity to a document, which might provide further detail or "
1372
1372
  "evidence regarding the entity.\n"
1373
1373
  msgstr ""
1374
1374
  "Associe une entité à un document qui est susceptible d’apporter plus "
@@ -2465,7 +2465,7 @@ msgstr "Organisations"
2465
2465
  msgid ""
2466
2466
  "Any type of incorporated entity that cannot be owned by another (see "
2467
2467
  "Company). This might include charities, foundations or state-owned "
2468
- "enterprises, depending on their juristiction.\n"
2468
+ "enterprises, depending on their juristiction.\n"
2469
2469
  msgstr ""
2470
2470
  "Tout type d’entité constituée qui ne peut être détenue par une autre (voir "
2471
2471
  "Société). Il peut s’agir d’une organisation caritative, d’une fondation ou "