followthemoney 3.8.1__py3-none-any.whl → 3.8.3__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.

Potentially problematic release.


This version of followthemoney might be problematic. Click here for more details.

@@ -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.8.1"
6
+ __version__ = "3.8.3"
7
7
 
8
8
 
9
9
  model_path = os.path.dirname(__file__)
@@ -2,13 +2,12 @@ import os
2
2
  import json
3
3
  import logging
4
4
  from typing import Any, Dict, Iterable, List, Optional, Set, TextIO
5
- import stringcase # type: ignore
6
5
 
7
6
  from followthemoney.export.csv import CSVMixin, CSVWriter
8
7
  from followthemoney.export.graph import GraphExporter, DEFAULT_EDGE_TYPES
9
8
  from followthemoney.graph import Edge, Node
10
9
  from followthemoney.schema import Schema
11
- from followthemoney.util import PathLike
10
+ from followthemoney.util import PathLike, const_case
12
11
 
13
12
  log = logging.getLogger(__name__)
14
13
  NEO4J_ADMIN_PATH = os.environ.get("NEO4J_ADMIN_PATH", "neo4j-admin")
@@ -72,12 +71,12 @@ class Neo4JCSVExporter(CSVMixin, GraphExporter):
72
71
 
73
72
  def write_edge(self, edge: Edge, extra: List[str]) -> None:
74
73
  if edge.prop is not None:
75
- type_ = stringcase.constcase(edge.prop.name)
74
+ type_ = const_case(edge.prop.name)
76
75
  row = [type_, edge.source_id, edge.target_id, edge.weight]
77
76
  self.links_writer.writerow(row)
78
77
  if edge.proxy is not None:
79
78
  proxy = edge.proxy
80
- type_ = stringcase.constcase(proxy.schema.name)
79
+ type_ = const_case(proxy.schema.name)
81
80
  # That potentially may lead to multiple edges with same id
82
81
  cells = [proxy.id, type_, edge.source_id, edge.target_id]
83
82
  cells.extend(extra or [])
@@ -174,7 +173,7 @@ class CypherGraphExporter(GraphExporter):
174
173
  % {
175
174
  "source": self._to_map({"id": edge.source_id}),
176
175
  "target": self._to_map({"id": edge.target_id}),
177
- "type": stringcase.constcase(edge.type_name),
176
+ "type": const_case(edge.type_name),
178
177
  "map": self._to_map(attributes),
179
178
  }
180
179
  )
@@ -20,6 +20,13 @@ Occupancy:
20
20
  caption:
21
21
  - startDate
22
22
  - endDate
23
+ temporalExtent:
24
+ start:
25
+ - startDate
26
+ - declarationDate
27
+ - date
28
+ end:
29
+ - endDate
23
30
  properties:
24
31
  holder:
25
32
  label: "Holder"
@@ -76,6 +76,15 @@ Thing:
76
76
  range: Address
77
77
  program: # Used by sanctions
78
78
  label: Program
79
+ description: Regulatory program or sanctions list on which an entity is listed.
80
+ programId:
81
+ # This is a unique identifier for the program issued by OpenSanctions, but
82
+ # could also be used for authority-issued IDs in other usage scenarios.
83
+ label: "Program ID"
84
+ type: identifier
85
+ maxLength: 64
86
+ hidden: true
87
+ matchable: false
79
88
  notes:
80
89
  label: Notes
81
90
  type: text
@@ -45,9 +45,9 @@ class CountryType(EnumType):
45
45
  return ftm_country
46
46
  code = countrynames.to_code(text, fuzzy=fuzzy)
47
47
  if code is not None:
48
- lower = code.lower()
49
- if lower in self.codes:
50
- return lower
48
+ territory = get_territory(code)
49
+ if territory is not None:
50
+ return territory.ftm_country
51
51
  return None
52
52
 
53
53
  def country_hint(self, value: str) -> str:
@@ -89,6 +89,7 @@ class LanguageType(EnumType):
89
89
  "mya",
90
90
  "khm",
91
91
  "cnr",
92
+ "ben",
92
93
  ]
93
94
  LANGUAGES = get_env_list("FTM_LANGUAGES", LANGUAGES)
94
95
  LANGUAGES = [lang.lower().strip() for lang in LANGUAGES]
@@ -36,6 +36,7 @@ class TopicType(EnumType):
36
36
  "crime.traffick": _("Trafficking"),
37
37
  "crime.traffick.drug": _("Drug trafficking"),
38
38
  "crime.traffick.human": _("Human trafficking"),
39
+ "risk.forced.labor": _("Forced labor"),
39
40
  "wanted": _("Wanted"),
40
41
  "corp.offshore": _("Offshore"),
41
42
  "corp.shell": _("Shell company"),
followthemoney/util.py CHANGED
@@ -105,6 +105,11 @@ def join_text(*parts: Any, sep: str = " ") -> Optional[str]:
105
105
  return sep.join(texts)
106
106
 
107
107
 
108
+ def const_case(text: str) -> str:
109
+ """Convert the given text to a constant case."""
110
+ return text.upper().replace(" ", "_")
111
+
112
+
108
113
  def get_entity_id(obj: Any) -> Optional[str]:
109
114
  """Given an entity-ish object, try to get the ID."""
110
115
  if is_mapping(obj):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: followthemoney
3
- Version: 3.8.1
3
+ Version: 3.8.3
4
4
  Summary: A data model for anti corruption data modeling and analysis.
5
5
  Project-URL: Documentation, https://followthemoney.tech/
6
6
  Project-URL: Repository, https://github.com/alephdata/followthemoney.git
@@ -44,17 +44,15 @@ Requires-Dist: networkx<3.5,>=2.5
44
44
  Requires-Dist: normality<3.0.0,>=2.4.0
45
45
  Requires-Dist: openpyxl<4.0.0,>=3.0.5
46
46
  Requires-Dist: orjson<4.0,>=3.7
47
- Requires-Dist: phonenumbers<9.0.0,>=8.12.22
47
+ Requires-Dist: phonenumbers<10.0.0,>=8.12.22
48
48
  Requires-Dist: prefixdate<1.0.0,>=0.4.0
49
- Requires-Dist: python-stdnum<2.0.0,>=1.16
50
49
  Requires-Dist: pytz>=2021.1
51
50
  Requires-Dist: pyyaml<7.0.0,>=5.0.0
52
51
  Requires-Dist: rdflib<7.2.0,>=6.2.0
53
52
  Requires-Dist: requests<3.0.0,>=2.21.0
54
- Requires-Dist: rigour<1.0.0,>=0.9.3
53
+ Requires-Dist: rigour<1.0.0,>=0.11.1
55
54
  Requires-Dist: sqlalchemy2-stubs
56
55
  Requires-Dist: sqlalchemy<3.0.0,>=1.4.49
57
- Requires-Dist: stringcase<2.0.0,>=1.2.0
58
56
  Requires-Dist: types-pyyaml
59
57
  Provides-Extra: dev
60
58
  Requires-Dist: build; extra == 'dev'
@@ -1,4 +1,4 @@
1
- followthemoney/__init__.py,sha256=Cuo89JNtffF2ZZmMgYEsvlkWKVYHXnFnFvzQ6BRX6Gw,360
1
+ followthemoney/__init__.py,sha256=sJRsdK9ZBunDj47hDo_vq_7drj1cdN16hnj9lXMMIsQ,360
2
2
  followthemoney/compare.py,sha256=1GFkCfTzA8QR0CH90kvySR8hvl9hQRUerW5Xw2Ivmpg,5134
3
3
  followthemoney/exc.py,sha256=ynZs_UnTVxHR-iBfat_CpVLraYzVX5yLtVf5Ti14hl4,734
4
4
  followthemoney/graph.py,sha256=VNDKrUBkz_-DmKsr5v-Xm8VfxzabnTwkU_MFk92_TjA,10848
@@ -13,7 +13,7 @@ followthemoney/proxy.py,sha256=M7RIPF0k-P3v7GYKYhRVVaO1cnUf5FArJepE-2c0KMQ,20033
13
13
  followthemoney/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  followthemoney/rdf.py,sha256=9wPs-tqN9QILuvrmH_YheNaFQctyIQqoIEqcS465QHs,343
15
15
  followthemoney/schema.py,sha256=vPG2C4r0ar3F74fbU_v-YPq4I3Qfmu9gzxMFWksU7I4,18097
16
- followthemoney/util.py,sha256=dMaCas9EjUPQ9q_a4qtV1pQOxWfxPjyjwR0e84XSN9c,4396
16
+ followthemoney/util.py,sha256=6VR-T5-vT-8xpE6__Skrqe_MpE6y6csvNKERTJlsITA,4527
17
17
  followthemoney/cli/__init__.py,sha256=Fl05wMr5-FlOSMRpmu1HJSNfPRpy8u9as5IRbGXdo4U,421
18
18
  followthemoney/cli/aggregate.py,sha256=Gwfi5Bt1LCwqbpsCu4P1Cr-QJtCWhbaqgGEzfwJUUL4,2142
19
19
  followthemoney/cli/cli.py,sha256=yrPw2iyKY-E-uRWe6KN9W3ayvz-22vfpe_ZeD0RiI0c,3591
@@ -26,7 +26,7 @@ followthemoney/export/common.py,sha256=_YrXrwsqmyboDZDhtJ_PazUUJYe1Y-Trqc9lz4YlV
26
26
  followthemoney/export/csv.py,sha256=AvWgyWg0nICAVLv4k9QgWRlgJhJonKCjzlZkrahe5Tg,2633
27
27
  followthemoney/export/excel.py,sha256=pj6zNpIbye_Zm3vhCamcqHEe9Fw-RyjtWQDCFY6608s,2645
28
28
  followthemoney/export/graph.py,sha256=v0z1FgadyFk5aQ0A5q8E9R4fSO-Tpi5JU9YTDwnRKD8,2765
29
- followthemoney/export/neo4j.py,sha256=JCLb1eW5FFIJXqmnpNMRzRs1KYuYkCtHZp7KJcu-JNY,7104
29
+ followthemoney/export/neo4j.py,sha256=aw1vBOLTRinFbOhn19WThLlQ6NWVbm2gop5Jz_ihc58,7052
30
30
  followthemoney/export/rdf.py,sha256=E6RiW7oIsJdaBaLAVm6o-MTokARZtqONPuayILqTqo0,786
31
31
  followthemoney/mapping/__init__.py,sha256=iwNqzzvrzJNbNDlOCaDLlBTUrNTlnYHIB5cvo_-9oN4,82
32
32
  followthemoney/mapping/csv.py,sha256=Tvc6VSh7-ca63LEE4G0yqOCeGMETkuKzUjIkVn4_d7Q,3185
@@ -73,7 +73,7 @@ followthemoney/schema/Membership.yaml,sha256=IPmaOX4Ai2r4sGcA5ig2WmLvWHb38akdxp4
73
73
  followthemoney/schema/Mention.yaml,sha256=nBeulR_Jm4x75aJ7yNF0TAVhHJqXQaEzOutLIn_YU-4,1086
74
74
  followthemoney/schema/Message.yaml,sha256=PAxZ2NRFVvnOlp9Ohh5fJDEThjJ0jm3M2YCbJ9KtMuE,1565
75
75
  followthemoney/schema/Note.yaml,sha256=NohwtFupxIssZuEgQowiQWqKit4uQ-OatAu3yp9eJj4,411
76
- followthemoney/schema/Occupancy.yaml,sha256=hFXUAmPxxy3hNEe92pGKgMp80a9A-v_fNDIZd98NzcY,866
76
+ followthemoney/schema/Occupancy.yaml,sha256=WojlqzuWao84MJxRE9K6a-1D-Jtu78-0h6laODhdKw8,975
77
77
  followthemoney/schema/Organization.yaml,sha256=wPXU1ni0-3QzvttDq-gIjbAYHzcWoo3nsLGLw6cnHKI,1064
78
78
  followthemoney/schema/Ownership.yaml,sha256=tLWESE9VX0aUuhe6C1pToq2-auPVZBdE3xvBmTRfmPc,1057
79
79
  followthemoney/schema/Package.yaml,sha256=gPr-P3lcg7OOAav_KVa8baK4yK57JwfcXwxXheD96UQ,310
@@ -96,7 +96,7 @@ followthemoney/schema/Similar.yaml,sha256=gD8rZEaPQWzU-rEfsKdn62uEucF3KxYBcPMoSd
96
96
  followthemoney/schema/Succession.yaml,sha256=RMJQqZ4Fv88N1RvWTAgjYg9BB5cELSj5CCAjM681Fpg,749
97
97
  followthemoney/schema/Table.yaml,sha256=GcsIAgSO9t2tvObA9zU2HhxlSqTe9CePmUnagu1Z0vI,641
98
98
  followthemoney/schema/TaxRoll.yaml,sha256=ugMzaaS7uyq2OLD50eGLcfvd6Cg0cSt65-T9GVqpRSA,746
99
- followthemoney/schema/Thing.yaml,sha256=PeseDMTO8rDzoTrxRjL9efyJQ0_lGgRQRTzwLu5OwiU,2458
99
+ followthemoney/schema/Thing.yaml,sha256=IWVpyhUGuvR6x5eyObPjJ0eEIyYHuw1FLWGLe6aaNas,2829
100
100
  followthemoney/schema/Trip.yaml,sha256=nLQD_ApmVJ8D56Czl7K700hhNZjzFV9FOQ3NBSQDLiM,771
101
101
  followthemoney/schema/UnknownLink.yaml,sha256=lneS_HZNgeLyJxwzWnLx0ZoyY3MXt99I_K2X_o9z5g8,682
102
102
  followthemoney/schema/UserAccount.yaml,sha256=V1JWwwcggCO4G9ByJY9zlQ0uOVp8HQK2mRXwqaGJnBM,763
@@ -132,7 +132,7 @@ followthemoney/types/__init__.py,sha256=X9XeM6JktzirAw5gGkyDKGM70NuiJ9Tbjoq0IwVc
132
132
  followthemoney/types/address.py,sha256=NnJli6jIs5DfePL4m3dA3Xwv7GA8sdl1J6Mtm-QLeOY,2068
133
133
  followthemoney/types/checksum.py,sha256=OqjCsBPyMIV3_Y20kTTvjkyayy32pBtaI5KKwYQb6lY,937
134
134
  followthemoney/types/common.py,sha256=Yk-7LZ6uDgFzKXUZxQ_j5miN2ZMnlBOziU0iFC7FE9I,10202
135
- followthemoney/types/country.py,sha256=1ORYH_wV1cbT7HQzoKi3EbKVAy4G59nsuGk4m6Rm3-M,1834
135
+ followthemoney/types/country.py,sha256=aYSvTeI37JFzV3ATl-_-r6Vnc4ye8Nc0rVwaXgqbOaU,1863
136
136
  followthemoney/types/date.py,sha256=4lZCd0aws-T3HE2BYkb-a-t8iQDr0nqFSAEBoUKiTlM,2683
137
137
  followthemoney/types/email.py,sha256=zAnMHwC_FZh7IagpDRhGZf-GfQR6uW8d-lZP4UCdGcM,2745
138
138
  followthemoney/types/entity.py,sha256=FA8xXNCkiM7HlF6k5lxTlb_B_LKlUwaoOMaVqAdjgYc,2477
@@ -141,17 +141,17 @@ followthemoney/types/iban.py,sha256=QYD49erJCB6I2nbtTagRMvpa4RyjezfB4Fpat2QLwAc,
141
141
  followthemoney/types/identifier.py,sha256=Gk4h75_KyjkdtomrK9Ldsh9rD7-bsenFryevJFwqlX0,2036
142
142
  followthemoney/types/ip.py,sha256=BxGARP9JWEWvyRnr7A7xUNwmTxyFd9kwXSZrKR0TK2Q,1412
143
143
  followthemoney/types/json.py,sha256=Hefwns1-ziJf310MWvdfX5ICkOgj9cnnMJuqq1e6qKY,1676
144
- followthemoney/types/language.py,sha256=CaNKofIzgH8M0yC7YcDt3o2faVCm-NL9xsaC9ypnTyc,2849
144
+ followthemoney/types/language.py,sha256=9w4jgJN4vs5SKPyBIXLcSUo0nupH4F2LukiF4KbPxxY,2864
145
145
  followthemoney/types/mimetype.py,sha256=EZ5hIdn-wosfLc-GjXDaOzevxaSXPbSPHDUJmPT1h0I,1355
146
146
  followthemoney/types/name.py,sha256=_Vu-MPYbgdN55gNBT2qHh-RDgbLQgT2l_kftnqJIEdw,2240
147
147
  followthemoney/types/number.py,sha256=9l5v3hcAoJ4V6jaBS_-Kc1gtdJlQrY9L98ElC5e_PLQ,943
148
148
  followthemoney/types/phone.py,sha256=2YFbPBtMepvCWTdcxXq3Fq4AU8B4QYk1FARBpsH8xjs,4040
149
149
  followthemoney/types/registry.py,sha256=hvQ1oIWz_4PpyUnKA5azbaZCulNb5LCIPyC-AQYVVyw,1936
150
150
  followthemoney/types/string.py,sha256=grDn1OgKWxIzVxGEdp0HjVKIqtQ9W4SW2ty4quv3Pcs,1202
151
- followthemoney/types/topic.py,sha256=6g57JKTFF_I233-afvuaswFxMaN_Kmg5MZ4_iAKZh9c,3754
151
+ followthemoney/types/topic.py,sha256=yOPvLdGGXKfDhQhKeIQ-5nxrqKJd8ef7EC2GCBry1Vk,3802
152
152
  followthemoney/types/url.py,sha256=r7Pd6Yfn--amwMi_nHoTLMwm5SH8h50SMgQaa2G4PJ0,1492
153
- followthemoney-3.8.1.dist-info/METADATA,sha256=7gIc__XwnT9cUwDDaG2AQT3zT51gbYTHm1XEd71V6QY,6145
154
- followthemoney-3.8.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
155
- followthemoney-3.8.1.dist-info/entry_points.txt,sha256=xvTXjAz0CiZplq4V3iQXlmBexaJyW3zNucIvcDP6L_c,593
156
- followthemoney-3.8.1.dist-info/licenses/LICENSE,sha256=3tfmmk9RtT1eh67a-NDRwcmOLzztbCtqlHW6O1U92ZA,1098
157
- followthemoney-3.8.1.dist-info/RECORD,,
153
+ followthemoney-3.8.3.dist-info/METADATA,sha256=Z-vsTWjM4sHAPcy-nPzMw-pTQ57c7eh4BxlTDIRq25I,6065
154
+ followthemoney-3.8.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
155
+ followthemoney-3.8.3.dist-info/entry_points.txt,sha256=xvTXjAz0CiZplq4V3iQXlmBexaJyW3zNucIvcDP6L_c,593
156
+ followthemoney-3.8.3.dist-info/licenses/LICENSE,sha256=3tfmmk9RtT1eh67a-NDRwcmOLzztbCtqlHW6O1U92ZA,1098
157
+ followthemoney-3.8.3.dist-info/RECORD,,