vysion 2.1.0__py3-none-any.whl → 2.1.2__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.
- vysion/client/client.py +4 -4
- vysion/client/error.py +3 -3
- vysion/dto/dto.py +90 -1
- vysion/version.py +1 -1
- {vysion-2.1.0.dist-info → vysion-2.1.2.dist-info}/METADATA +2 -2
- {vysion-2.1.0.dist-info → vysion-2.1.2.dist-info}/RECORD +8 -8
- {vysion-2.1.0.dist-info → vysion-2.1.2.dist-info}/LICENSE +0 -0
- {vysion-2.1.0.dist-info → vysion-2.1.2.dist-info}/WHEEL +0 -0
vysion/client/client.py
CHANGED
|
@@ -27,6 +27,7 @@ import requests
|
|
|
27
27
|
from vysion.client.error import APIError
|
|
28
28
|
from vysion.dto import (
|
|
29
29
|
Error,
|
|
30
|
+
ErrorCode,
|
|
30
31
|
DocumentHit,
|
|
31
32
|
VysionResponse,
|
|
32
33
|
RansomwareHit,
|
|
@@ -148,7 +149,7 @@ def vysion_error_manager(method) -> Union[VysionResponse, Error]:
|
|
|
148
149
|
return Error(code=e.code, message=e.message)
|
|
149
150
|
except Exception as e:
|
|
150
151
|
LOGGER.error(e)
|
|
151
|
-
return Error()
|
|
152
|
+
return Error(code=ErrorCode.INTERNAL_SERVER_ERROR, message=str(e))
|
|
152
153
|
|
|
153
154
|
return manage
|
|
154
155
|
|
|
@@ -330,6 +331,7 @@ class Client(BaseClient):
|
|
|
330
331
|
country: str = None,
|
|
331
332
|
language: Language = None,
|
|
332
333
|
sector: str = None,
|
|
334
|
+
group: str = None,
|
|
333
335
|
) -> VysionResponse[RansomwareHit]:
|
|
334
336
|
url = self._build_api_url__(
|
|
335
337
|
"victim/search",
|
|
@@ -342,6 +344,7 @@ class Client(BaseClient):
|
|
|
342
344
|
country=country,
|
|
343
345
|
language=language,
|
|
344
346
|
sector=sector,
|
|
347
|
+
group=group,
|
|
345
348
|
)
|
|
346
349
|
|
|
347
350
|
result = VysionResponse[RansomwareHit].model_validate(self._make_request(url))
|
|
@@ -412,12 +415,9 @@ class Client(BaseClient):
|
|
|
412
415
|
username=username,
|
|
413
416
|
)
|
|
414
417
|
|
|
415
|
-
print(url)
|
|
416
|
-
|
|
417
418
|
result = VysionResponse[ImMessageHit].model_validate(self._make_request(url))
|
|
418
419
|
return result.data
|
|
419
420
|
|
|
420
|
-
|
|
421
421
|
@vysion_error_manager
|
|
422
422
|
def im_find_email(
|
|
423
423
|
self,
|
vysion/client/error.py
CHANGED
|
@@ -14,7 +14,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
14
14
|
See the License for the specific language governing permissions and
|
|
15
15
|
limitations under the License.
|
|
16
16
|
"""
|
|
17
|
-
from vysion.dto import
|
|
17
|
+
from vysion.dto import ErrorCode
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
class APIError(Exception):
|
|
@@ -28,8 +28,8 @@ class APIError(Exception):
|
|
|
28
28
|
|
|
29
29
|
super().__init__()
|
|
30
30
|
|
|
31
|
-
if code not in [i.value for i in
|
|
32
|
-
self.code =
|
|
31
|
+
if code not in [i.value for i in ErrorCode]:
|
|
32
|
+
self.code = ErrorCode.INTERNAL_SERVER_ERROR
|
|
33
33
|
self.message = f"{message} (Original code: {code})"
|
|
34
34
|
else:
|
|
35
35
|
self.code = code
|
vysion/dto/dto.py
CHANGED
|
@@ -487,13 +487,23 @@ class ImFeedHit(BaseModel):
|
|
|
487
487
|
network: str
|
|
488
488
|
|
|
489
489
|
|
|
490
|
+
class OnionFeedHit(BaseModel):
|
|
491
|
+
id: str
|
|
492
|
+
url: URL
|
|
493
|
+
path: str
|
|
494
|
+
detectionDate: datetime
|
|
495
|
+
title: Optional[str] = Field(default_factory=lambda: None)
|
|
496
|
+
tag: List[Tag] = Field(default_factory=lambda: [])
|
|
497
|
+
network: Network = Field(default_factory=lambda: Network.tor)
|
|
498
|
+
|
|
499
|
+
|
|
490
500
|
class CryptoFeedHit(BaseModel):
|
|
491
501
|
id: str
|
|
492
502
|
url: str
|
|
493
503
|
detectionDate: datetime
|
|
494
504
|
url: str
|
|
495
505
|
network: str
|
|
496
|
-
title: str
|
|
506
|
+
title: Optional[str] = Field(default_factory=lambda: None)
|
|
497
507
|
tag: List[Tag] = Field(default_factory=lambda: [])
|
|
498
508
|
bitcoin_address: Optional[List[BitcoinAddress]] = Field(default_factory=lambda: [])
|
|
499
509
|
polkadot_address: Optional[List[PolkadotAddress]] = Field(default_factory=lambda: [])
|
|
@@ -528,6 +538,85 @@ class CryptoFeedHit(BaseModel):
|
|
|
528
538
|
return values
|
|
529
539
|
|
|
530
540
|
|
|
541
|
+
class CryptoTelegramFeedHit(BaseModel):
|
|
542
|
+
userId: str
|
|
543
|
+
usernames: Optional[List[str]] = Field(default_factory=lambda: [])
|
|
544
|
+
firstName: Optional[str] = Field(default_factory=lambda: None)
|
|
545
|
+
lastName: Optional[str] = Field(default_factory=lambda: None)
|
|
546
|
+
detectionDate: datetime
|
|
547
|
+
profilePhoto: Optional[List[str]] = Field(default_factory=lambda: None)
|
|
548
|
+
bitcoin_address: Optional[List[BitcoinAddress]] = Field(default_factory=lambda: [])
|
|
549
|
+
polkadot_address: Optional[List[PolkadotAddress]] = Field(default_factory=lambda: [])
|
|
550
|
+
ethereum_address: Optional[List[EthereumAddress]] = Field(default_factory=lambda: [])
|
|
551
|
+
monero_address: Optional[List[MoneroAddress]] = Field(default_factory=lambda: [])
|
|
552
|
+
ripple_address: Optional[List[RippleAddress]] = Field(default_factory=lambda: [])
|
|
553
|
+
zcash_address: Optional[List[ZcashAddress]] = Field(default_factory=lambda: [])
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
model_config = ConfigDict(
|
|
557
|
+
arbitrary_types_allowed=True,
|
|
558
|
+
exclude_defaults=True,
|
|
559
|
+
validate_assignment=True
|
|
560
|
+
)
|
|
561
|
+
|
|
562
|
+
@model_validator(mode="after")
|
|
563
|
+
def remove_empty_lists(cls, values):
|
|
564
|
+
"""Remove empty cryptocurrency lists from output"""
|
|
565
|
+
crypto_fields = [
|
|
566
|
+
"bitcoin_address",
|
|
567
|
+
"polkadot_address",
|
|
568
|
+
"ethereum_address",
|
|
569
|
+
"monero_address",
|
|
570
|
+
"ripple_address",
|
|
571
|
+
"zcash_address"
|
|
572
|
+
]
|
|
573
|
+
|
|
574
|
+
for field_name in crypto_fields:
|
|
575
|
+
field_value = getattr(values, field_name, None)
|
|
576
|
+
if isinstance(field_value, list) and not field_value:
|
|
577
|
+
setattr(values, field_name, None)
|
|
578
|
+
|
|
579
|
+
return values
|
|
580
|
+
|
|
581
|
+
class CryptoDiscordFeedHit(BaseModel):
|
|
582
|
+
userId: str
|
|
583
|
+
usernames: Optional[List[str]] = Field(default_factory=lambda: [])
|
|
584
|
+
creationDate: Optional[datetime] = Field(default_factory=lambda: None)
|
|
585
|
+
detectionDate: datetime
|
|
586
|
+
profilePhoto: Optional[List[str]] = Field(default_factory=lambda: None)
|
|
587
|
+
bitcoin_address: Optional[List[BitcoinAddress]] = Field(default_factory=lambda: [])
|
|
588
|
+
polkadot_address: Optional[List[PolkadotAddress]] = Field(default_factory=lambda: [])
|
|
589
|
+
ethereum_address: Optional[List[EthereumAddress]] = Field(default_factory=lambda: [])
|
|
590
|
+
monero_address: Optional[List[MoneroAddress]] = Field(default_factory=lambda: [])
|
|
591
|
+
ripple_address: Optional[List[RippleAddress]] = Field(default_factory=lambda: [])
|
|
592
|
+
zcash_address: Optional[List[ZcashAddress]] = Field(default_factory=lambda: [])
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
model_config = ConfigDict(
|
|
596
|
+
arbitrary_types_allowed=True,
|
|
597
|
+
exclude_defaults=True,
|
|
598
|
+
validate_assignment=True
|
|
599
|
+
)
|
|
600
|
+
|
|
601
|
+
@model_validator(mode="after")
|
|
602
|
+
def remove_empty_lists(cls, values):
|
|
603
|
+
"""Remove empty cryptocurrency lists from output"""
|
|
604
|
+
crypto_fields = [
|
|
605
|
+
"bitcoin_address",
|
|
606
|
+
"polkadot_address",
|
|
607
|
+
"ethereum_address",
|
|
608
|
+
"monero_address",
|
|
609
|
+
"ripple_address",
|
|
610
|
+
"zcash_address"
|
|
611
|
+
]
|
|
612
|
+
|
|
613
|
+
for field_name in crypto_fields:
|
|
614
|
+
field_value = getattr(values, field_name, None)
|
|
615
|
+
if isinstance(field_value, list) and not field_value:
|
|
616
|
+
setattr(values, field_name, None)
|
|
617
|
+
|
|
618
|
+
return values
|
|
619
|
+
|
|
531
620
|
class RansomFeedHit(BaseModel):
|
|
532
621
|
id: str
|
|
533
622
|
companyName: Optional[str]
|
vysion/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vysion
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.2
|
|
4
4
|
Summary: The official Python client library for Vysion
|
|
5
5
|
Home-page: https://vysion.ai
|
|
6
6
|
License: Apache-2.0
|
|
@@ -29,7 +29,7 @@ Welcome to the PyPi webpage for Vysion, our implementation as a Python library t
|
|
|
29
29
|
|
|
30
30
|
You can request a demo for the web app or an API-key to use in this library at [vysion.ai](https://vysion.ai).
|
|
31
31
|
|
|
32
|
-
Latest version: [2.1.
|
|
32
|
+
Latest version: [2.1.2](https://pypi.org/project/vysion/)
|
|
33
33
|
|
|
34
34
|
You can visit [the documentation](https://developers.vysion.ai/?python) for more information on the searches and requests performed with the library or directly on the API.
|
|
35
35
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
vysion/__init__.py,sha256=yxJiM-S29q8GB3PBff9tV70P2nvydd8aKLEprLkXw5o,664
|
|
2
2
|
vysion/client/__init__.py,sha256=aVHmBuetPdybp7TgcNzUx4HkxTjEuXYzSdDYiYfFQd0,630
|
|
3
|
-
vysion/client/client.py,sha256
|
|
4
|
-
vysion/client/error.py,sha256
|
|
3
|
+
vysion/client/client.py,sha256=LShr3t81ACAduxXgdx3_E-qUQTgRcPw7nkGkfulGq00,15112
|
|
4
|
+
vysion/client/error.py,sha256=JK0dsZkyMjmxPtEgO5IStG_N_q8y_-VGbppwWrUtSgM,1166
|
|
5
5
|
vysion/dto/__init__.py,sha256=ct8JxVMfJ0APiOTgr9ju-JIuBlXOrPkx7n2qISSXUts,605
|
|
6
|
-
vysion/dto/dto.py,sha256=
|
|
6
|
+
vysion/dto/dto.py,sha256=ERPY2zbNXgc40SPfmy1gp9-6WaD3x8AeFBzmTFDnMtM,24588
|
|
7
7
|
vysion/dto/tag.py,sha256=whGPsdasgYm8oijrL7MRSMmapzaoCmKNeaJ5ih0aBIk,1503
|
|
8
8
|
vysion/dto/util.py,sha256=AxdMWPdf7xrFtWva5epKxgjI0Bah1GiIw-sEWvIUYb4,4491
|
|
9
9
|
vysion/model/__init__.py,sha256=rJX9eNW9-jQGTgwm97W04jhZa-dV_dSTTTFcbWg73w0,606
|
|
@@ -15,8 +15,8 @@ vysion/model/enum/services.py,sha256=fUfZEO0RNNctU4Gzae5TV3c7BU5A_cEwaEb1tzqgcr0
|
|
|
15
15
|
vysion/taxonomy/__init__.py,sha256=Bc364AYxRCyjIn26-XBPeEDCPe3Hma4r5RAI8R8eblU,635
|
|
16
16
|
vysion/taxonomy/flavours.py,sha256=ubImHBE8v0zhzFy_2YozAQk2SzN1XDQwHAxb2RebtCo,2347
|
|
17
17
|
vysion/taxonomy/taxonomy.py,sha256=mG6vHX5Eyp38AKyJBgfBDqdpEmDMbkv8TA8YUBzko54,12227
|
|
18
|
-
vysion/version.py,sha256=
|
|
19
|
-
vysion-2.1.
|
|
20
|
-
vysion-2.1.
|
|
21
|
-
vysion-2.1.
|
|
22
|
-
vysion-2.1.
|
|
18
|
+
vysion/version.py,sha256=lQZu579c_lsErwq2SpYLvpx_OBODgJD0siiUhy2loSA,610
|
|
19
|
+
vysion-2.1.2.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
20
|
+
vysion-2.1.2.dist-info/METADATA,sha256=lyiWJtw7ZnTokNOBGvXDiCKHryc9bARnCTwWsfFec34,1958
|
|
21
|
+
vysion-2.1.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
22
|
+
vysion-2.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|