followthemoney 3.8.5__py3-none-any.whl → 4.0.1__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 (75) hide show
  1. followthemoney/__init__.py +30 -10
  2. followthemoney/cli/cli.py +1 -1
  3. followthemoney/cli/exports.py +6 -2
  4. followthemoney/cli/statement.py +62 -0
  5. followthemoney/cli/util.py +2 -3
  6. followthemoney/compare.py +26 -16
  7. followthemoney/dataset/__init__.py +17 -0
  8. followthemoney/dataset/catalog.py +77 -0
  9. followthemoney/dataset/coverage.py +29 -0
  10. followthemoney/dataset/dataset.py +146 -0
  11. followthemoney/dataset/publisher.py +25 -0
  12. followthemoney/dataset/resource.py +30 -0
  13. followthemoney/dataset/util.py +55 -0
  14. followthemoney/entity.py +73 -0
  15. followthemoney/exc.py +6 -0
  16. followthemoney/export/rdf.py +57 -5
  17. followthemoney/graph.py +1 -2
  18. followthemoney/model.py +38 -11
  19. followthemoney/names.py +33 -0
  20. followthemoney/ontology.py +18 -16
  21. followthemoney/property.py +12 -15
  22. followthemoney/proxy.py +43 -64
  23. followthemoney/schema/Analyzable.yaml +2 -3
  24. followthemoney/schema/BankAccount.yaml +2 -3
  25. followthemoney/schema/Company.yaml +0 -6
  26. followthemoney/schema/Contract.yaml +0 -1
  27. followthemoney/schema/CryptoWallet.yaml +1 -1
  28. followthemoney/schema/Document.yaml +0 -6
  29. followthemoney/schema/Interval.yaml +7 -0
  30. followthemoney/schema/LegalEntity.yaml +6 -0
  31. followthemoney/schema/License.yaml +2 -0
  32. followthemoney/schema/Page.yaml +0 -1
  33. followthemoney/schema/Person.yaml +0 -5
  34. followthemoney/schema/Sanction.yaml +1 -0
  35. followthemoney/schema/Thing.yaml +0 -2
  36. followthemoney/schema/UserAccount.yaml +6 -3
  37. followthemoney/schema.py +30 -42
  38. followthemoney/statement/__init__.py +19 -0
  39. followthemoney/statement/entity.py +438 -0
  40. followthemoney/statement/serialize.py +251 -0
  41. followthemoney/statement/statement.py +256 -0
  42. followthemoney/statement/util.py +31 -0
  43. followthemoney/types/__init__.py +66 -23
  44. followthemoney/types/address.py +3 -3
  45. followthemoney/types/checksum.py +3 -7
  46. followthemoney/types/common.py +9 -14
  47. followthemoney/types/country.py +3 -7
  48. followthemoney/types/date.py +21 -11
  49. followthemoney/types/email.py +0 -4
  50. followthemoney/types/entity.py +5 -11
  51. followthemoney/types/gender.py +6 -10
  52. followthemoney/types/identifier.py +9 -3
  53. followthemoney/types/ip.py +5 -9
  54. followthemoney/types/json.py +2 -2
  55. followthemoney/types/language.py +3 -7
  56. followthemoney/types/mimetype.py +4 -8
  57. followthemoney/types/name.py +7 -8
  58. followthemoney/types/number.py +88 -6
  59. followthemoney/types/phone.py +4 -11
  60. followthemoney/types/string.py +4 -4
  61. followthemoney/types/topic.py +3 -7
  62. followthemoney/types/url.py +5 -10
  63. followthemoney/util.py +12 -13
  64. followthemoney/value.py +67 -0
  65. {followthemoney-3.8.5.dist-info → followthemoney-4.0.1.dist-info}/METADATA +23 -8
  66. {followthemoney-3.8.5.dist-info → followthemoney-4.0.1.dist-info}/RECORD +69 -59
  67. {followthemoney-3.8.5.dist-info → followthemoney-4.0.1.dist-info}/entry_points.txt +1 -0
  68. followthemoney/offshore.py +0 -48
  69. followthemoney/rdf.py +0 -9
  70. followthemoney/schema/Assessment.yaml +0 -32
  71. followthemoney/schema/Post.yaml +0 -42
  72. followthemoney/types/iban.py +0 -58
  73. followthemoney/types/registry.py +0 -52
  74. {followthemoney-3.8.5.dist-info → followthemoney-4.0.1.dist-info}/WHEEL +0 -0
  75. {followthemoney-3.8.5.dist-info → followthemoney-4.0.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: followthemoney
3
- Version: 3.8.5
3
+ Version: 4.0.1
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/opensanctions/followthemoney.git
@@ -40,20 +40,19 @@ Requires-Dist: babel<3.0.0,>=2.14.0
40
40
  Requires-Dist: banal<1.1.0,>=1.0.6
41
41
  Requires-Dist: click<9.0.0,>=8.0
42
42
  Requires-Dist: countrynames<2.0.0,>=1.13.0
43
- Requires-Dist: fingerprints<2.0.0,>=1.0.1
44
43
  Requires-Dist: networkx<3.5,>=2.5
45
- Requires-Dist: normality<3.0.0,>=2.4.0
44
+ Requires-Dist: normality<3.0.0,>=2.6.1
46
45
  Requires-Dist: openpyxl<4.0.0,>=3.0.5
47
- Requires-Dist: orjson<4.0,>=3.7
46
+ Requires-Dist: orjson<4.0,>=3.10.18
48
47
  Requires-Dist: phonenumbers<10.0.0,>=8.12.22
49
48
  Requires-Dist: prefixdate<1.0.0,>=0.4.0
49
+ Requires-Dist: pydantic<3.0.0,>=2.11.7
50
50
  Requires-Dist: pytz>=2021.1
51
51
  Requires-Dist: pyyaml<7.0.0,>=5.0.0
52
52
  Requires-Dist: rdflib<7.2.0,>=6.2.0
53
53
  Requires-Dist: requests<3.0.0,>=2.21.0
54
- Requires-Dist: rigour<1.0.0,>=0.11.1
54
+ Requires-Dist: rigour<2.0.0,>=1.0.0
55
55
  Requires-Dist: sqlalchemy[mypy]<3.0.0,>=2.0.0
56
- Requires-Dist: types-pyyaml
57
56
  Provides-Extra: dev
58
57
  Requires-Dist: build; extra == 'dev'
59
58
  Requires-Dist: bump2version; extra == 'dev'
@@ -72,6 +71,12 @@ Requires-Dist: types-pyyaml; extra == 'dev'
72
71
  Requires-Dist: types-requests; extra == 'dev'
73
72
  Requires-Dist: types-setuptools; extra == 'dev'
74
73
  Requires-Dist: wheel>=0.29.0; extra == 'dev'
74
+ Provides-Extra: docs
75
+ Requires-Dist: mkdocs-gen-files; extra == 'docs'
76
+ Requires-Dist: mkdocs-macros-plugin; extra == 'docs'
77
+ Requires-Dist: mkdocs-material>=9.0.0; extra == 'docs'
78
+ Requires-Dist: mkdocs>=1.4.0; extra == 'docs'
79
+ Requires-Dist: mkdocstrings[python]; extra == 'docs'
75
80
  Description-Content-Type: text/markdown
76
81
 
77
82
  # Follow the Money
@@ -98,7 +103,7 @@ transform data in various ways. You can find a tutorial here:
98
103
  Besides the introductions, there is also a full reference documentation for the
99
104
  library and the contained ontology:
100
105
 
101
- * https://followthemoney.tech/explorer/
106
+ * https://followthemoney.tech/explorer/schemata/
102
107
 
103
108
  There's also a number of viewers for the RDF schema definitions generated from FollowTheMoney, eg:
104
109
 
@@ -106,6 +111,16 @@ There's also a number of viewers for the RDF schema definitions generated from F
106
111
  * [WebVOWL](https://service.tib.eu/webvowl/#iri=https://followthemoney.tech/ns/ftm.xml)
107
112
  * RDF/OWL specification in [XML](https://followthemoney.tech/ns/ftm.xml).
108
113
 
114
+ ## Installation
115
+
116
+ You can install `followthemomey` via PyPI like this:
117
+
118
+ ```bash
119
+ pip install followthemoney
120
+ ```
121
+
122
+ The most tricky dependency of `followthemoney` is `pyicu`, which helps us to perform certain text operations. Please [review their documentation](https://gitlab.pyicu.org/main/pyicu#installing-pyicu) if you run into any issues with ICU.
123
+
109
124
  ## Development environment
110
125
 
111
126
  For local development with a virtualenv:
@@ -124,7 +139,7 @@ make test
124
139
 
125
140
  ## Releasing
126
141
 
127
- We release a lot of version of `followthemoney` because even small changes to the code base require a pypi release to begin being used in `aleph`. To this end, here's the steps for making a release:
142
+ We release a lot of version of `followthemoney` because even small changes to the code base require a pypi release to begin being used in downstream applications. To this end, here's the steps for making a release:
128
143
 
129
144
  ```bash
130
145
  git pull --rebase
@@ -1,33 +1,42 @@
1
- followthemoney/__init__.py,sha256=GTdXf-mlMlK2HNFSllcTQHcDOhWxcMhLGJB7OeyP29I,360
2
- followthemoney/compare.py,sha256=1GFkCfTzA8QR0CH90kvySR8hvl9hQRUerW5Xw2Ivmpg,5134
3
- followthemoney/exc.py,sha256=ynZs_UnTVxHR-iBfat_CpVLraYzVX5yLtVf5Ti14hl4,734
4
- followthemoney/graph.py,sha256=9ZNXI3cPR3NFO0hzDj19c1Nx9bgkRWD_EIRgG6zWTPU,10963
1
+ followthemoney/__init__.py,sha256=UMJQnsCliiYxAhnQCvqSOCInreUI-bmpiReqDA7ZHhc,856
2
+ followthemoney/compare.py,sha256=rtITMzJOXLDOSj7yKPfOxFaknIu6kRpiLDIM22zakpI,5619
3
+ followthemoney/entity.py,sha256=GThAfNNZ4xdtvKTeue3GbtxCaBPngxhZDItpZnNHTtE,2932
4
+ followthemoney/exc.py,sha256=GyMgwY4QVm87hLevDfV7gM1MJsDqfNCi_UQw7F_A8X8,858
5
+ followthemoney/graph.py,sha256=7X1CGHGvmktS2LSZqld2iXWzG7B831eCNYyBqamqEJ8,10921
5
6
  followthemoney/helpers.py,sha256=Btb6BlHg_c-qCXZo-NP_LURKG-qu-QD3Fj1ev_c7Xic,7956
6
7
  followthemoney/messages.py,sha256=zUEa9CFecU8nRafIzhN6TKCh1kEihiIyIS1qr8PxY4g,806
7
- followthemoney/model.py,sha256=FBY6iSbfvsxdjwFlwhs234IbYtl_MwEeTTmoxIFBxC0,6485
8
+ followthemoney/model.py,sha256=bWFVNa-DhYzc8BdSXBZdG2ev6Nh9uHx6i4tin8DvEEU,7374
9
+ followthemoney/names.py,sha256=LODQqExKEHdH4z6Mmbhlm0KeKRzGcptaSWzYXZ7lONI,1120
8
10
  followthemoney/namespace.py,sha256=cp7X8aGaZ8HHf7SOfHr2vJHPI2todz2DoyLdiZLNMyg,4472
9
- followthemoney/offshore.py,sha256=Pf0tx-7GyhIZRueshDRqPNlxkHfGstmW5yNDID5Mnws,1060
10
- followthemoney/ontology.py,sha256=7PEoUKISNpkRvVhuLeE3IE9ZiNtdR8mn9_kzZ9yF9l0,2986
11
- followthemoney/property.py,sha256=zi9ss1v0e8Wmv-FuLtZd2aod5iTLfBekBxuOTgIOUMU,7718
12
- followthemoney/proxy.py,sha256=PIuo38ev_MJxamO_0MGKh2MdgJiwaletZbq3uKO3Yv4,20054
11
+ followthemoney/ontology.py,sha256=WWY_PYQGl5Ket4zZBuZglzQxD2Bh9UqHok6GJNNX7GA,3001
12
+ followthemoney/property.py,sha256=RDTzTXJeeLFLptQL1_gr1S1T-vdDe-8MGMwsRaGQh0I,7665
13
+ followthemoney/proxy.py,sha256=Pj1GquUD7gdsM1fXb18QnYeT3E9N4ouhwJmPKNKd8ak,19605
13
14
  followthemoney/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- followthemoney/rdf.py,sha256=9wPs-tqN9QILuvrmH_YheNaFQctyIQqoIEqcS465QHs,343
15
- followthemoney/schema.py,sha256=Yqv11zhZXMOq1MjKQP44Ie8vIurDrSr5qlqRJEueLK4,18126
16
- followthemoney/util.py,sha256=6VR-T5-vT-8xpE6__Skrqe_MpE6y6csvNKERTJlsITA,4527
15
+ followthemoney/schema.py,sha256=WYnPE4Lego0pJHlojECEv0aO9Miw_YIvEb35HoDo4Zk,18087
16
+ followthemoney/util.py,sha256=DhhcRilSetZpzvCew56AE6zNwenW5a4Y-KtmKM43rjc,4447
17
+ followthemoney/value.py,sha256=BJ4Sj5Tg2kMrslR6FjQUr96d8Kt75U7ny9NgzVGT0ZE,2335
17
18
  followthemoney/cli/__init__.py,sha256=0mmz84uhXRp2qUn3syKnDXofU3MMAAe291s7htqX0Bg,187
18
19
  followthemoney/cli/aggregate.py,sha256=xQTFpU3cVVj7fplpX4OJVrRlTVpn6b9kBr_Vb87pKfg,2164
19
- followthemoney/cli/cli.py,sha256=yrPw2iyKY-E-uRWe6KN9W3ayvz-22vfpe_ZeD0RiI0c,3591
20
- followthemoney/cli/exports.py,sha256=HsTyIOz1KQSeObp9-9SKzSUBW158XOhpU5_Stv_2HWM,4016
20
+ followthemoney/cli/cli.py,sha256=cWSQIrMS0b40uzIveoIfR9CEBbQEwcfonYhDTpioqBM,3584
21
+ followthemoney/cli/exports.py,sha256=arWgIfDhMdEEoAnANOPbgirL68qAR2pCt0otz9MEXmg,4074
21
22
  followthemoney/cli/mapping.py,sha256=PGQ-9T5ss6w6qnZg7IjUZZ3PplY15CcPSxZxkyMFLDM,3370
22
23
  followthemoney/cli/sieve.py,sha256=wLB35fCVp1ArZ7FDTbARevBk8jH4vnp65fyBZU7Lk_k,1937
23
- followthemoney/cli/util.py,sha256=CFcS-PEwpMasMWX_Yg283O_PaAhcPwkvahFNWc13C8c,4769
24
+ followthemoney/cli/statement.py,sha256=kjcOzcwWT_cHCwriiYA8B05BJpwVoI3WMJjghzPOCsY,2871
25
+ followthemoney/cli/util.py,sha256=C3nGMVY3-9JHSFLn3AGvTNcAdvGcgfFS-7jXIzKg6Ik,4735
26
+ followthemoney/dataset/__init__.py,sha256=rOKsI39dccDaYcSa7ASoNKkhmbFYUArxMCRqtrxy2iE,477
27
+ followthemoney/dataset/catalog.py,sha256=bIpxr0jvJeutNSmCaXREQac7TyvZak2Y_QoCFdCM0d4,3001
28
+ followthemoney/dataset/coverage.py,sha256=rBnKs7VngCtIuaDqrF5D0ygCHg8NAMkYbmtl7336PSI,724
29
+ followthemoney/dataset/dataset.py,sha256=0zsynko9-xkbDFMh7xKlgSwytRT6bak1fHjCA6WguA4,4748
30
+ followthemoney/dataset/publisher.py,sha256=eHbguTyDRVRC0ohD6phaLIm5d9Y-eJK6XYIQaelrnN4,694
31
+ followthemoney/dataset/resource.py,sha256=SZpnY6TKNAFZHinaJNrEpT7YgdrCSMhYDT_UNn9Fmko,931
32
+ followthemoney/dataset/util.py,sha256=ajUIBRF64dizdgy9LAp2abvFXRFOWCqQX9sDbToWFYo,1607
24
33
  followthemoney/export/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
34
  followthemoney/export/common.py,sha256=5b-Qlu3MaA0kSzzMAP93FAWncpgiioENnCnHikWYxhs,1021
26
35
  followthemoney/export/csv.py,sha256=reWq1jYIv7sY2PEI4JwIxahYNNqnSiPfMCS3kQX4RZ8,2652
27
36
  followthemoney/export/excel.py,sha256=pj6zNpIbye_Zm3vhCamcqHEe9Fw-RyjtWQDCFY6608s,2645
28
37
  followthemoney/export/graph.py,sha256=v0z1FgadyFk5aQ0A5q8E9R4fSO-Tpi5JU9YTDwnRKD8,2765
29
38
  followthemoney/export/neo4j.py,sha256=4Lih9lt3-5ATERhyMcfJfkiETG3tqj9vY4N9s7jiYmw,7049
30
- followthemoney/export/rdf.py,sha256=E6RiW7oIsJdaBaLAVm6o-MTokARZtqONPuayILqTqo0,786
39
+ followthemoney/export/rdf.py,sha256=BOd4AIAVobwpmJ5GjyIqn9ZQHUwKQ-3fMdnD-Lcid0s,2978
31
40
  followthemoney/mapping/__init__.py,sha256=iwNqzzvrzJNbNDlOCaDLlBTUrNTlnYHIB5cvo_-9oN4,82
32
41
  followthemoney/mapping/csv.py,sha256=1eqQk1tn5JSEcr4rrv44XdT5biUk7J0E275uvUNoOrA,3125
33
42
  followthemoney/mapping/entity.py,sha256=-x_VBHiVthIrZZ-PVKD3oBAq6LYcsyeYW-9TFv80k7M,5905
@@ -37,24 +46,23 @@ followthemoney/mapping/source.py,sha256=sri-XpSjeHZbQtqNcz1eJYvwVSBNqGO5JwhWswiE
37
46
  followthemoney/mapping/sql.py,sha256=iCSOl9uOzJI__1d1XvLtJmLUXhb38MRM_eBnYt7TdP8,4738
38
47
  followthemoney/schema/Address.yaml,sha256=9cPZfkNiV-5fNfSzBFcE_dwD0V2_WLpGSLT6kL8GbuQ,1709
39
48
  followthemoney/schema/Airplane.yaml,sha256=i3tI4INH6ZtKBqm09fAUtCbieFlha-vPfQURXMDZTIU,622
40
- followthemoney/schema/Analyzable.yaml,sha256=WvyhjYqI7QzBt3qPDgO7MDasJH1qQtgQMToHkV_xtlU,1237
49
+ followthemoney/schema/Analyzable.yaml,sha256=0XEHqibL_XpzARpnq1hB0at38w4i2FgOmh-EbtH-pt8,1216
41
50
  followthemoney/schema/Article.yaml,sha256=jTH63eP2aZ87W_6m8jS4R_btcrI46tYGeCEqKNLTwLU,266
42
- followthemoney/schema/Assessment.yaml,sha256=-RH_aEz4xGejucRcwl45KVAnzSLeQ7zwJWguuKST3m0,630
43
51
  followthemoney/schema/Asset.yaml,sha256=xQhHJJtnGLfiOaUncqGv4JR3Yn7l46yAg7p0hKFAFVE,260
44
52
  followthemoney/schema/Associate.yaml,sha256=ijTHd6GDlK4lMtijdkTzERR9DODtqKk0XoZPlDEsUnI,901
45
53
  followthemoney/schema/Audio.yaml,sha256=Eb1rZGUEOX7XDAj_1YIN28NCBzMvkopQBNwgHt_kS18,452
46
- followthemoney/schema/BankAccount.yaml,sha256=Pvw9FxJYwwnJMoo3IblyPki9VRjLsM4F30jzKZWv9dE,1452
54
+ followthemoney/schema/BankAccount.yaml,sha256=60v-VD296lW1Qq7fx--CzxfPNwfCcyMV6xIl8OrSy5g,1431
47
55
  followthemoney/schema/Call.yaml,sha256=kbVCnVxucBrEplxehXHThLSJAJjy_GhWan-IeZZjr0M,980
48
56
  followthemoney/schema/CallForTenders.yaml,sha256=2IWonTzfSbrkynMoEWqv5fekUeFM_xDKpKIbRe1XDbo,3227
49
- followthemoney/schema/Company.yaml,sha256=ozXP_PHly_cOa3xjKkxaUnlwXc-0jsLYt_682Auql48,3276
50
- followthemoney/schema/Contract.yaml,sha256=-wVVUBu_KvmiWEjXrw1zgY2m9AAkiHCDd-hxFCUzj6k,1586
57
+ followthemoney/schema/Company.yaml,sha256=v16tU4mQhVitC3BOc9OPbubCxPgf1c-Iudnyq6IF0ys,3057
58
+ followthemoney/schema/Contract.yaml,sha256=aSPB64T1h-0nuLDv6krasUvvoPZgo6sWUbv60c3vmzI,1541
51
59
  followthemoney/schema/ContractAward.yaml,sha256=b2spaZHYCaP1yR1RCsrI7mUjk-fAF7BUE3dc8Vl3cUQ,1689
52
60
  followthemoney/schema/CourtCase.yaml,sha256=lcovnY0Ne_xcggvkqfCW_RHvsRKo8kFTCPCyovAXRtI,599
53
61
  followthemoney/schema/CourtCaseParty.yaml,sha256=MpodN2251V_MYD2dBOHZ_qD7Uv6cLg8Gd_b-I8HZjPI,588
54
- followthemoney/schema/CryptoWallet.yaml,sha256=1Akp0Bzd_x_0GgsUOxW0zkvNDozoMP_8fJyrSn0dAy4,1068
62
+ followthemoney/schema/CryptoWallet.yaml,sha256=dhUpPf1eONsyzyORXoo_zFXgn0BuSLB4OKj2sHZ5wzA,1069
55
63
  followthemoney/schema/Debt.yaml,sha256=gSGl1xKPaPWAYYEcX7MxezVn3Gu-CYBIzxGzMd9UTm4,657
56
64
  followthemoney/schema/Directorship.yaml,sha256=BMx2AQTLy5ta_lWPnYKj7LFjZWTwtu1hgWncISdKf28,773
57
- followthemoney/schema/Document.yaml,sha256=MA-vZrK_Imd2HuIhJ7c_BH9Cpecv-DewXJhfjECXjuw,2927
65
+ followthemoney/schema/Document.yaml,sha256=JxoYl_2o-ebVXh5MzRIKEHfV3q_E--wXGO2HG7zBaZg,2646
58
66
  followthemoney/schema/Documentation.yml,sha256=AZ1kHiKcvkyv3SINLwAwUyoWMVrF8O0mSJhMN4jNNaE,760
59
67
  followthemoney/schema/EconomicActivity.yaml,sha256=hm2x-p-49fGOZcy6xVtiplpJs4XsQVFYLgb8D41az0k,4049
60
68
  followthemoney/schema/Email.yaml,sha256=IqEHgqUsapbTnCBO7OuV-GvoxLH8LIQscZOyAiateqw,1549
@@ -66,9 +74,9 @@ followthemoney/schema/HyperText.yaml,sha256=Wg5dWeLrVjbXiI-ao69tosJ7rI0DvNU8cCo8
66
74
  followthemoney/schema/Identification.yaml,sha256=6txjZs6-3Kn94c3G4tDeDt9Jb4FW55-xjSnYVrvmiEA,853
67
75
  followthemoney/schema/Image.yaml,sha256=wuznboWECGiV96_GQiXq1-oKNoxO8zKisR4xyusnEn8,394
68
76
  followthemoney/schema/Interest.yaml,sha256=VUrehmsN1WgtS1oAa5jn_JGtSkZGGYLGNahp-R5JhOQ,282
69
- followthemoney/schema/Interval.yaml,sha256=WtmSoBngajhpNLtDZ8Ocpdd0I0tLG-7A4afuHXxssow,1919
70
- followthemoney/schema/LegalEntity.yaml,sha256=1AouOu97lbKeLP1VNaprN_oACdTvcptGHob-Wbkc17Q,4298
71
- followthemoney/schema/License.yaml,sha256=9Ye5vGEBhi7ttGqf0DdAGCJCN3zz5HtGu52dCcmCsQk,452
77
+ followthemoney/schema/Interval.yaml,sha256=8YJQ51GI-GxvbjYs3uC593kQtCepWW_7ZiNnlbPm2aM,2084
78
+ followthemoney/schema/LegalEntity.yaml,sha256=u6GOemHj1vnL_6dcC3XyLaP72JQrNecXlbocXxJo5AI,4502
79
+ followthemoney/schema/License.yaml,sha256=bXESXY-JpSmc5sthZe4sssXhx50UoLPAMED9FvEUyRU,534
72
80
  followthemoney/schema/Membership.yaml,sha256=IPmaOX4Ai2r4sGcA5ig2WmLvWHb38akdxp4smEdDWOE,710
73
81
  followthemoney/schema/Mention.yaml,sha256=nBeulR_Jm4x75aJ7yNF0TAVhHJqXQaEzOutLIn_YU-4,1086
74
82
  followthemoney/schema/Message.yaml,sha256=PAxZ2NRFVvnOlp9Ohh5fJDEThjJ0jm3M2YCbJ9KtMuE,1565
@@ -77,34 +85,38 @@ followthemoney/schema/Occupancy.yaml,sha256=WojlqzuWao84MJxRE9K6a-1D-Jtu78-0h6la
77
85
  followthemoney/schema/Organization.yaml,sha256=wPXU1ni0-3QzvttDq-gIjbAYHzcWoo3nsLGLw6cnHKI,1064
78
86
  followthemoney/schema/Ownership.yaml,sha256=tLWESE9VX0aUuhe6C1pToq2-auPVZBdE3xvBmTRfmPc,1057
79
87
  followthemoney/schema/Package.yaml,sha256=gPr-P3lcg7OOAav_KVa8baK4yK57JwfcXwxXheD96UQ,310
80
- followthemoney/schema/Page.yaml,sha256=sQt_CnVyjDVGVECLQoGYZH4hxpjdPhxVRz4XJW-_1OU,1107
88
+ followthemoney/schema/Page.yaml,sha256=YjYqaH2sOry0z4xh44CsX_eyuRClD6ZS0d2o2uQXFbo,1062
81
89
  followthemoney/schema/Pages.yaml,sha256=KKPGZ06Ehp5mWIGnYfHUBN9jT03bk8nakw0pB5bA_7E,450
82
90
  followthemoney/schema/Passport.yaml,sha256=rpuLC86sdXnHF-prFQM4mAqYzlSGWKvPE4Cphtn2KRw,805
83
91
  followthemoney/schema/Payment.yaml,sha256=WRBJuj9ljsxLBs-0g9Z9UD87uR1RTtuUiYnWOnKr1qA,1757
84
- followthemoney/schema/Person.yaml,sha256=EsMcdOzGa8v8zQ_AgvDHSUFL0SflPMhdSdC7TWwW0sU,2354
92
+ followthemoney/schema/Person.yaml,sha256=G6L6bf8WQtOC1Xr1TKWRCJt8JlyQKheBPtH1ZmjjS3w,2132
85
93
  followthemoney/schema/PlainText.yaml,sha256=hfnVi-HmQeDbqDquSpkPJax9hNm86ioXGr4hzNzyPFE,278
86
94
  followthemoney/schema/Position.yaml,sha256=ZpxjWOLxwva_on32r9WD5ys0Ty3YxCju41mg9HG-pe0,1308
87
- followthemoney/schema/Post.yaml,sha256=cbxy8cWXHFKSvr1ylwDilRURhcsyd9-H7fn_Lb4lsFE,1034
88
95
  followthemoney/schema/Project.yaml,sha256=2svtyGJopS0UrqPiuYGpBzj30V7k3LRDX4N1U56y4yY,462
89
96
  followthemoney/schema/ProjectParticipant.yaml,sha256=xNehEu90uqUfboNouezhZQ8ZQLxzWq1yyNO4kua-Lyc,727
90
97
  followthemoney/schema/PublicBody.yaml,sha256=BNfLBqH1OapoEninAjWmqZx_n-G5QUnzzydW7300TiY,301
91
98
  followthemoney/schema/RealEstate.yaml,sha256=NWFHXqEHskYQN-kvQESZpu74nztShqoYSZEjZAr-DHM,1363
92
99
  followthemoney/schema/Representation.yaml,sha256=sCvFnUDQaElq2cqSB0rILcMYb2gaMZqlzxlHxyX9IGg,792
93
- followthemoney/schema/Sanction.yaml,sha256=VpvVXReuA3xF1V0tlDyK_LItnL6G_Xt3HivnCf9_zag,1259
100
+ followthemoney/schema/Sanction.yaml,sha256=-3_NrTp1KPSsSMkttFzwo81zFKplx15w-9EmwPnE8-o,1278
94
101
  followthemoney/schema/Security.yaml,sha256=w8Och0cslWjHPAs60HZ6JarEXdIbqGlIbN1NlvgN_7Y,1212
95
102
  followthemoney/schema/Similar.yaml,sha256=gD8rZEaPQWzU-rEfsKdn62uEucF3KxYBcPMoSdnxvME,817
96
103
  followthemoney/schema/Succession.yaml,sha256=RMJQqZ4Fv88N1RvWTAgjYg9BB5cELSj5CCAjM681Fpg,749
97
104
  followthemoney/schema/Table.yaml,sha256=GcsIAgSO9t2tvObA9zU2HhxlSqTe9CePmUnagu1Z0vI,641
98
105
  followthemoney/schema/TaxRoll.yaml,sha256=ugMzaaS7uyq2OLD50eGLcfvd6Cg0cSt65-T9GVqpRSA,746
99
- followthemoney/schema/Thing.yaml,sha256=IWVpyhUGuvR6x5eyObPjJ0eEIyYHuw1FLWGLe6aaNas,2829
106
+ followthemoney/schema/Thing.yaml,sha256=hh1oMDQzWiSs1TamBNonmwEdlh2TVrNc3w9hWW8iSeY,2716
100
107
  followthemoney/schema/Trip.yaml,sha256=nLQD_ApmVJ8D56Czl7K700hhNZjzFV9FOQ3NBSQDLiM,771
101
108
  followthemoney/schema/UnknownLink.yaml,sha256=lneS_HZNgeLyJxwzWnLx0ZoyY3MXt99I_K2X_o9z5g8,682
102
- followthemoney/schema/UserAccount.yaml,sha256=V1JWwwcggCO4G9ByJY9zlQ0uOVp8HQK2mRXwqaGJnBM,763
109
+ followthemoney/schema/UserAccount.yaml,sha256=2bbPKNtt1R3zWSSkaq_SVzRPfFzX74kAxwtIxTymHA8,840
103
110
  followthemoney/schema/Value.yaml,sha256=cNHTCtakMTXDW0Qpb6ArZodi9rMJ-Ebvp1WsOIRRzw4,310
104
111
  followthemoney/schema/Vehicle.yaml,sha256=Ypl4A5HJFOZfZh3DK0ewN-hyJuCMcovR0mPNddIZrOA,1051
105
112
  followthemoney/schema/Vessel.yaml,sha256=nFaUJ_0BzFJstvog1iDvwV9DHKHr9ky4DLb1NZGGh1E,1096
106
113
  followthemoney/schema/Video.yaml,sha256=LY3DYMWTHXiAhL0hxBCNCz50cp2sPbUlEhhig5Fbjos,327
107
114
  followthemoney/schema/Workbook.yaml,sha256=iikWPElz4klA7SkWH7eae6xqhbkMCIP_3zdeXzFEMU0,354
115
+ followthemoney/statement/__init__.py,sha256=PvhLPhmQrezBKCe8rEwJlyTWlrnCzSfyfchVc8gXXEA,568
116
+ followthemoney/statement/entity.py,sha256=92tOai7Yt5GZkOylZcy7866P0iLJsYEzmt-2T7WbXMg,15540
117
+ followthemoney/statement/serialize.py,sha256=9eXzQ1biR2mSxWRID5C7xDdku4b4ZImHeRJ53yLZ0yo,7225
118
+ followthemoney/statement/statement.py,sha256=Ae-EYuzS8S12BkaRqrvMuI1C7YwlRKa5C_pTBELyNMM,8029
119
+ followthemoney/statement/util.py,sha256=B-ozuRc1TWvpop52873Pqt5OPj8H6uk4KyRJLfAhr10,780
108
120
  followthemoney/translations/messages.pot,sha256=JhtY9NJ9wP_EAX4APxOqMyvKcX53oIC9kAxBsliJkf4,107703
109
121
  followthemoney/translations/ar/LC_MESSAGES/followthemoney.mo,sha256=uhb2crSNh8K2ts_QUeD2wvgWgzzpLJWRzXok-Uyx3Zk,38795
110
122
  followthemoney/translations/ar/LC_MESSAGES/followthemoney.po,sha256=DuIfvR5v0sPGwFbeg3y6_jCbeglvHWXQ2LDH6prfwLc,121326
@@ -128,30 +140,28 @@ followthemoney/translations/ru/LC_MESSAGES/followthemoney.mo,sha256=bXJ9UXFg_MMx
128
140
  followthemoney/translations/ru/LC_MESSAGES/followthemoney.po,sha256=7SQWytOTvoAQq60GJMh22a1nAzhdEUb5BO4ldpiCtnA,141918
129
141
  followthemoney/translations/tr/LC_MESSAGES/followthemoney.mo,sha256=SC84e_ZF_oFJG1NKdyZY_W6Kb6POORZB6wdeAcEWmnE,487
130
142
  followthemoney/translations/tr/LC_MESSAGES/followthemoney.po,sha256=AZC3marhtVVq8Ck1FOgnt4sbDMz548nX48O9GDwImbQ,89826
131
- followthemoney/types/__init__.py,sha256=X9XeM6JktzirAw5gGkyDKGM70NuiJ9Tbjoq0IwVclxU,1745
132
- followthemoney/types/address.py,sha256=NnJli6jIs5DfePL4m3dA3Xwv7GA8sdl1J6Mtm-QLeOY,2068
133
- followthemoney/types/checksum.py,sha256=OqjCsBPyMIV3_Y20kTTvjkyayy32pBtaI5KKwYQb6lY,937
134
- followthemoney/types/common.py,sha256=Yk-7LZ6uDgFzKXUZxQ_j5miN2ZMnlBOziU0iFC7FE9I,10202
135
- followthemoney/types/country.py,sha256=aYSvTeI37JFzV3ATl-_-r6Vnc4ye8Nc0rVwaXgqbOaU,1863
136
- followthemoney/types/date.py,sha256=4lZCd0aws-T3HE2BYkb-a-t8iQDr0nqFSAEBoUKiTlM,2683
137
- followthemoney/types/email.py,sha256=zAnMHwC_FZh7IagpDRhGZf-GfQR6uW8d-lZP4UCdGcM,2745
138
- followthemoney/types/entity.py,sha256=FA8xXNCkiM7HlF6k5lxTlb_B_LKlUwaoOMaVqAdjgYc,2477
139
- followthemoney/types/gender.py,sha256=AVCa6ocsxueVhGW7RA2BIbQEfDRQANDpKkGY7ZakTYE,1820
140
- followthemoney/types/iban.py,sha256=QYD49erJCB6I2nbtTagRMvpa4RyjezfB4Fpat2QLwAc,1797
141
- followthemoney/types/identifier.py,sha256=Gk4h75_KyjkdtomrK9Ldsh9rD7-bsenFryevJFwqlX0,2036
142
- followthemoney/types/ip.py,sha256=BxGARP9JWEWvyRnr7A7xUNwmTxyFd9kwXSZrKR0TK2Q,1412
143
- followthemoney/types/json.py,sha256=Hefwns1-ziJf310MWvdfX5ICkOgj9cnnMJuqq1e6qKY,1676
144
- followthemoney/types/language.py,sha256=9w4jgJN4vs5SKPyBIXLcSUo0nupH4F2LukiF4KbPxxY,2864
145
- followthemoney/types/mimetype.py,sha256=EZ5hIdn-wosfLc-GjXDaOzevxaSXPbSPHDUJmPT1h0I,1355
146
- followthemoney/types/name.py,sha256=_Vu-MPYbgdN55gNBT2qHh-RDgbLQgT2l_kftnqJIEdw,2240
147
- followthemoney/types/number.py,sha256=9l5v3hcAoJ4V6jaBS_-Kc1gtdJlQrY9L98ElC5e_PLQ,943
148
- followthemoney/types/phone.py,sha256=2YFbPBtMepvCWTdcxXq3Fq4AU8B4QYk1FARBpsH8xjs,4040
149
- followthemoney/types/registry.py,sha256=hvQ1oIWz_4PpyUnKA5azbaZCulNb5LCIPyC-AQYVVyw,1936
150
- followthemoney/types/string.py,sha256=grDn1OgKWxIzVxGEdp0HjVKIqtQ9W4SW2ty4quv3Pcs,1202
151
- followthemoney/types/topic.py,sha256=FqV_4YDpmQxZO9m05l3c-nDyDqsZONqBG5aaf5aCkvA,3797
152
- followthemoney/types/url.py,sha256=r7Pd6Yfn--amwMi_nHoTLMwm5SH8h50SMgQaa2G4PJ0,1492
153
- followthemoney-3.8.5.dist-info/METADATA,sha256=cOEWYZHcj__KvWhrH43Vtj0DZc998eeRk533xAa0lXw,6168
154
- followthemoney-3.8.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
155
- followthemoney-3.8.5.dist-info/entry_points.txt,sha256=xvTXjAz0CiZplq4V3iQXlmBexaJyW3zNucIvcDP6L_c,593
156
- followthemoney-3.8.5.dist-info/licenses/LICENSE,sha256=H6_EVXisnJC0-18CjXIaqrBSFq_VH3OnS7u3dccOv6g,1148
157
- followthemoney-3.8.5.dist-info/RECORD,,
143
+ followthemoney/types/__init__.py,sha256=rWwQeiuMh2BNIuvhpMfJ4bPADDvt9Axu1eedvNFi0qY,3350
144
+ followthemoney/types/address.py,sha256=11k7kxHAoY46-ypkOQELFCJjrk7yssTOs55vdRWQJBY,2089
145
+ followthemoney/types/checksum.py,sha256=zZrU8WX4CY3Vta_vOyfgDNzIwbmtje7AaDv3O1fBMnk,823
146
+ followthemoney/types/common.py,sha256=d9t4BMqcjoMqqKu7UWVF6WKckV0FnRsKQ1LA3OgEq0c,10065
147
+ followthemoney/types/country.py,sha256=mUCjwhUbA5Ef5HYuKb1KbH4aZ3MxaNwE1p77uOZMuG0,1745
148
+ followthemoney/types/date.py,sha256=PjcaEyW6CBzf0-gHWKUsKjWIaD3AVBEl0zLSRQOVXxc,3105
149
+ followthemoney/types/email.py,sha256=zuX7TthKGtkUwN_kEMMip17iMYQDJc5kQUP8j4N6R-A,2598
150
+ followthemoney/types/entity.py,sha256=oDxVEhuxyU1ScpOpebPpUm3o0I9j_p7Qrq-t5yNpluQ,2338
151
+ followthemoney/types/gender.py,sha256=fi9iKLbjAUxDCLBtU1MxWidxv7KgCY2eH5746FYlEGk,1725
152
+ followthemoney/types/identifier.py,sha256=hzD188FtwG0w3TcmbnDwnUMc8MZVcWgQJKGAvrwygc4,2296
153
+ followthemoney/types/ip.py,sha256=mMFTODFiXAJROCUYJvoLAShyIiTIWVmMBh5zT_GquYM,1300
154
+ followthemoney/types/json.py,sha256=V3qJD5RxJykNX51u3w1Nx9xqoNBnkulhzkJI9XMYKFo,1690
155
+ followthemoney/types/language.py,sha256=SXgRRH-DyPmyyrqYurSyMiG6WHB8a0Gw81XxroEGD-c,2747
156
+ followthemoney/types/mimetype.py,sha256=NdpqVLx3Bre_myYvnbjmdd5wZBf01tllrbhegjO8_m0,1263
157
+ followthemoney/types/name.py,sha256=Y7g-SkmO_9PgzpBubS79OsPhp4h73dEGVql78Bq2x0Y,2258
158
+ followthemoney/types/number.py,sha256=OdVuHDd4IYIIHhx_317JKeMjBAGtsJ2TAcxoZKZ4MkY,3948
159
+ followthemoney/types/phone.py,sha256=r8uRqWinS0CYnYBTs405k5gO4jeatUDgjdzzijoMKJE,3811
160
+ followthemoney/types/string.py,sha256=fqyTauAm4mNnNaoH-yH087RBbNh-G5ZZUO3awTGQUUg,1230
161
+ followthemoney/types/topic.py,sha256=CS5IoI8gm4MSVxfV6K4mGd20_tT1SaKMkcOt_ObSsAg,3678
162
+ followthemoney/types/url.py,sha256=QFpS_JIV8unFHuh_uGv22SWUUkocBoOpzLsAJWom_gI,1455
163
+ followthemoney-4.0.1.dist-info/METADATA,sha256=Ctiv_lnTOczS2bc4C0UJzlqwS0BoiQQYym0GxtwOxlY,6791
164
+ followthemoney-4.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
165
+ followthemoney-4.0.1.dist-info/entry_points.txt,sha256=caoFTlf213jhg5sz3TNSofutjUTzaKtWATuSIdd9Cps,653
166
+ followthemoney-4.0.1.dist-info/licenses/LICENSE,sha256=H6_EVXisnJC0-18CjXIaqrBSFq_VH3OnS7u3dccOv6g,1148
167
+ followthemoney-4.0.1.dist-info/RECORD,,
@@ -15,3 +15,4 @@ gexf = followthemoney.cli.exports:export_gexf
15
15
  mapping = followthemoney.cli.mapping:run_mapping
16
16
  rdf = followthemoney.cli.exports:export_rdf
17
17
  sieve = followthemoney.cli.sieve:sieve
18
+ statements = followthemoney.cli.statement:entity_statements
@@ -1,48 +0,0 @@
1
- from followthemoney.proxy import E
2
-
3
- # Derived from: https://fsi.taxjustice.net/en/introduction/fsi-results
4
- OFFSHORE_COUNTRIES = set(
5
- (
6
- "ky",
7
- "ch",
8
- "sg",
9
- "lu",
10
- "vg",
11
- "gg",
12
- "pa",
13
- "je",
14
- "mt",
15
- "bs",
16
- "cy",
17
- "gi",
18
- "mo",
19
- "bm",
20
- "im",
21
- "mh",
22
- "mu",
23
- "li",
24
- "ai",
25
- "kn",
26
- "tc",
27
- "vu",
28
- "mc",
29
- "sc",
30
- "ag",
31
- "dm",
32
- "ms",
33
- "lc",
34
- "ck",
35
- )
36
- )
37
-
38
-
39
- def offshore_from_jurisdiction(proxy: E) -> E:
40
- """Tag organizations linked to a well-known offshore jurisdiction as
41
- offshores automatically. Complete generalization, use only in experiments."""
42
- if not proxy.schema.is_a("Organization"):
43
- return proxy
44
- countries = set(proxy.get("country", quiet=True))
45
- countries.update(proxy.get("jurisdiction", quiet=True))
46
- if len(countries.intersection(OFFSHORE_COUNTRIES)) > 0:
47
- proxy.add("topics", "corp.offshore")
48
- return proxy
followthemoney/rdf.py DELETED
@@ -1,9 +0,0 @@
1
- # This module serves exclusively to mitigate the type checking clusterfuck
2
- # that is rdflib 6.0.
3
- from rdflib import Namespace
4
- from rdflib.term import Identifier, URIRef, Literal
5
- from rdflib import RDF, SKOS, XSD
6
-
7
- NS = Namespace("https://schema.followthemoney.tech/#")
8
-
9
- __all__ = ["NS", "XSD", "RDF", "SKOS", "Identifier", "URIRef", "Literal"]
@@ -1,32 +0,0 @@
1
- Assessment:
2
- # This is overly specific yet not useful. Should we phase it out?
3
- label: Assessment
4
- plural: Assessments
5
- extends:
6
- - Thing
7
- matchable: false
8
- featured:
9
- - name
10
- - publishDate
11
- - author
12
- caption:
13
- - name
14
- required:
15
- - name
16
- temporalExtent:
17
- start:
18
- - publishDate
19
- properties:
20
- publishDate:
21
- label: "Date of publishing"
22
- type: date
23
- assessmentId:
24
- label: "Assessment ID"
25
- author:
26
- label: "Author"
27
- plural: "Authors"
28
- type: entity
29
- range: LegalEntity
30
- reverse:
31
- name: authoredAssessments
32
- label: "Assessments authored"
@@ -1,42 +0,0 @@
1
- Post:
2
- label: "Post"
3
- plural: "Posts"
4
- extends:
5
- - Interest
6
- matchable: false
7
- deprecated: true
8
- # cf. https://www.popoloproject.com/specs/post.html
9
- # But they're using it to define the post as an abstract thing, this
10
- # describes the interval in which it is held by an individual.
11
- description: >
12
- A post, role or position held by an individual within an organization
13
- or body. This describes the period for which the position is held,
14
- not the abstract concept of the post.
15
- featured:
16
- - holder
17
- - organization
18
- - role
19
- - startDate
20
- - endDate
21
- required:
22
- - holder
23
- caption:
24
- - summary
25
- - organization
26
- - role
27
- properties:
28
- holder:
29
- label: "Holder"
30
- reverse:
31
- name: posts
32
- label: "Posts held"
33
- type: entity
34
- range: Person
35
- organization:
36
- # This is a stub text version of the org, describing it by name.
37
- label: "Organization"
38
- type: string
39
- wikidataId:
40
- label: "Wikidata ID"
41
- hidden: true
42
- type: identifier
@@ -1,58 +0,0 @@
1
- from typing import Optional, TYPE_CHECKING
2
- from rigour.ids import IBAN
3
-
4
- from followthemoney.types.common import PropertyType
5
- from followthemoney.rdf import URIRef, Identifier
6
- from followthemoney.util import sanitize_text, defer as _
7
-
8
- if TYPE_CHECKING:
9
- from followthemoney.proxy import EntityProxy
10
-
11
-
12
- class IbanType(PropertyType):
13
- """An international bank account number, as defined in ISO 13616. IBANs are
14
- managed by SWIFT used in the European SEPA payment system.
15
-
16
- A notable aspect of IBANs is that they share a country prefix and validation
17
- mechanism, but the specific length of an IBAN is dependent on the country
18
- code defined in the first two characters: `NO8330001234567` and
19
- `CY21002001950000357001234567` are both valid values."""
20
-
21
- name = "iban"
22
- group = "ibans"
23
- label = _("IBAN")
24
- plural = _("IBANs")
25
- matchable = True
26
- pivot = True
27
- max_length = 64
28
-
29
- def validate(
30
- self, value: str, fuzzy: bool = False, format: Optional[str] = None
31
- ) -> bool:
32
- text = sanitize_text(value)
33
- if text is None:
34
- return False
35
- return IBAN.is_valid(text)
36
-
37
- def clean_text(
38
- self,
39
- text: str,
40
- fuzzy: bool = False,
41
- format: Optional[str] = None,
42
- proxy: Optional["EntityProxy"] = None,
43
- ) -> Optional[str]:
44
- """Create a more clean, but still user-facing version of an
45
- instance of the type."""
46
- return IBAN.normalize(text)
47
-
48
- def country_hint(self, value: str) -> str:
49
- return value[:2].lower()
50
-
51
- def rdf(self, value: str) -> Identifier:
52
- return URIRef(self.node_id(value))
53
-
54
- def node_id(self, value: str) -> str:
55
- return f"iban:{value.upper()}"
56
-
57
- def caption(self, value: str) -> str:
58
- return IBAN.format(value)
@@ -1,52 +0,0 @@
1
- from banal import ensure_list
2
- from typing import Iterable, Set, Dict, Type, Union, List, Optional
3
-
4
- from followthemoney.types.common import PropertyType
5
-
6
-
7
- class Registry(object):
8
- """This registry keeps the processing helpers for all property types
9
- in the system. They are instantiated as singletons when the system is first
10
- loaded. The registry can be used to get a type, which can itself then
11
- clean, validate or format values of that type."""
12
-
13
- def __init__(self) -> None:
14
- self.named: Dict[str, PropertyType] = {}
15
- self.matchable: Set[PropertyType] = set()
16
- self.types: Set[PropertyType] = set()
17
- self.groups: Dict[str, PropertyType] = {}
18
- self.pivots: Set[PropertyType] = set()
19
-
20
- def add(self, clazz: Type[PropertyType]) -> None:
21
- """Add a singleton class."""
22
- type_ = clazz()
23
- self.named[clazz.name] = type_
24
- self.types.add(type_)
25
- if type_.matchable:
26
- self.matchable.add(type_)
27
- if type_.pivot:
28
- self.pivots.add(type_)
29
- if type_.group is not None:
30
- self.groups[type_.group] = type_
31
-
32
- def get(self, name: Union[str, PropertyType]) -> Optional[PropertyType]:
33
- """For a given property type name, get its type object. This can also
34
- be used via getattr, e.g. ``registry.phone``."""
35
- # Allow transparent re-checking.
36
- if isinstance(name, PropertyType):
37
- return name
38
- return self.named.get(name)
39
-
40
- def get_types(
41
- self, names: Iterable[Union[str, PropertyType]]
42
- ) -> List[PropertyType]:
43
- """Get a list of all type names."""
44
- names = ensure_list(names)
45
- types = [self.get(n) for n in names]
46
- return [t for t in types if t is not None]
47
-
48
- def __getitem__(self, name: str) -> PropertyType:
49
- return self.named[name]
50
-
51
- def __getattr__(self, name: str) -> PropertyType:
52
- return self.named[name]