internetdata 2.20.0__tar.gz → 2.22.0__tar.gz
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.
- {internetdata-2.20.0 → internetdata-2.22.0}/PKG-INFO +7 -3
- {internetdata-2.20.0 → internetdata-2.22.0}/README.md +6 -2
- {internetdata-2.20.0 → internetdata-2.22.0}/spec/openapi.yaml +13 -55
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/__init__.py +1 -1
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/asn.py +11 -8
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/lookup_response.py +76 -66
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/middleware/condition.py +24 -5
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/models.py +36 -16
- {internetdata-2.20.0 → internetdata-2.22.0}/testdata/testdata.json +91 -191
- {internetdata-2.20.0 → internetdata-2.22.0}/tests/helpers.py +29 -5
- {internetdata-2.20.0 → internetdata-2.22.0}/tests/test_conformance.py +15 -3
- {internetdata-2.20.0 → internetdata-2.22.0}/tests/test_lookup.py +116 -8
- {internetdata-2.20.0 → internetdata-2.22.0}/tests/test_middleware.py +105 -7
- {internetdata-2.20.0 → internetdata-2.22.0}/.gitignore +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/LICENSE +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/pyproject.toml +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/scripts/download-spec.sh +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/scripts/generate.sh +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/scripts/publish.sh +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/scripts/v2_subset.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_bogons.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_core.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/__init__.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/__init__.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/account/__init__.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/account/account_identity.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/api_keys/__init__.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/api_keys/account_create_apikey.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/api_keys/account_list_apikeys.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/api_keys/account_reveal_apikey.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/api_keys/account_revoke_apikey.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/api_keys/account_rotate_apikey.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/authorization/__init__.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/authorization/oauth_authorize.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/authorization/oauth_device_authorization.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/authorization/oauth_metadata.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/authorization/oauth_register.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/authorization/oauth_revoke.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/authorization/oauth_token.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/database_v_2/__init__.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/database_v_2/database_checksum_v2.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/database_v_2/database_metadata_v2.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/database_v_2/download_database_v2.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/database_v_2/list_databases.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/database_v_2/list_downloads.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/entitlement/__init__.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/entitlement/my_entitlement.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/lookup/__init__.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/lookup/lookup_asn.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/lookup/lookup_batch.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/lookup/lookup_domain.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/lookup/lookup_ip.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/lookup/lookup_my_ip.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/organization/__init__.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/organization/account_org.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/api/organization/account_org_members.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/client.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/errors.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/__init__.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/abuse_contact.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/account_create_apikey_request.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/account_created_apikey.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/account_org.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/account_org_ref.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/account_org_wrap.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/account_rc.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/account_revealed_apikey.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/account_user.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/apikey_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/apikey_list.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/asn_hosted_domains.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/asn_lookup_response.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/asn_lookup_response_whois.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/asn_prefix.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/batch_lookup_error.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/batch_lookup_request.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/batch_lookup_request_user_agents.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/batch_lookup_response.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/batch_lookup_response_errors.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/batch_lookup_response_results.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/bit_torrent_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/bot_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/carrier_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/class_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/client_registration.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/client_registration_request.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/cohosted_domains.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/company.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_checksum_v2_response_200.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_format.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_license_type_type_1.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_license_type_type_2_type_1.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_license_type_type_3_type_1.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_metadata.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_metadata_column.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_metadata_sample.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_metadata_sample_additional_property_item.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_metadata_sample_size.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_metadata_schema.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_metadata_size.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/database_version.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/db_checksums.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/device_authorization.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/device_authorization_request.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/disposable_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/dns_address_record.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/dns_cname_record.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/dns_mx_record.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/dns_ns_record.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/dns_resolver_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/domain_backlinks.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/domain_dns.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/domain_host.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/domain_ip_range.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/domain_ip_ranges.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/domain_lookup_response.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/domain_redirects.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/domain_web.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/domain_web_links.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/download.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/download_outcome.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/entitlement.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/entitlement_apikey.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/entitlement_error.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/entitlement_plan.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/entitlement_plan_tier.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/entitlement_usage.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/error.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/hosted_domains.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/identity.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/list_databases_response_200.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/list_downloads_response_200.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/location.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/lookup_error.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/oauth_authorize_code_challenge_method.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/oauth_authorize_response_type.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/oauth_error.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/oauth_metadata.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/oauth_revoke_response_200.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/proxy_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/pubproxy_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/revoke_request.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/rwhois.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/satellite_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/smtp_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/ssh_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/standing.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/token_request.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/token_response.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/user_agent_verdict.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/user_agent_verdict_verdict.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/web_detail.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/whois.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/types.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/aio.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/bogon.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/client.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/errors.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/middleware/__init__.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/middleware/core.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/py.typed +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/testdata/bogons.json +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/tests/conftest.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/tests/test_cache_life.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/tests/test_client.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/tests/test_download.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/tests/test_oauth.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/tests/test_sharing.py +0 -0
- {internetdata-2.20.0 → internetdata-2.22.0}/tests/test_user_agent.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: internetdata
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.22.0
|
|
4
4
|
Summary: Official Python client library for the InternetData API. Look up IP addresses, ASNs and domains, and download licensed IP databases.
|
|
5
5
|
Project-URL: Homepage, https://internetdata.io
|
|
6
6
|
Project-URL: Documentation, https://docs.internetdata.io
|
|
@@ -52,7 +52,7 @@ Requires Python 3.11 or newer. Type hints are included, and the package ships `p
|
|
|
52
52
|
|
|
53
53
|
## Usage
|
|
54
54
|
|
|
55
|
-
**No API key needed to start.** Unlimited, the free plan, answers `location`, `asn`, `company`, `abuse
|
|
55
|
+
**No API key needed to start.** Unlimited, the free plan, answers `location`, `asn`, `company`, `abuse`, the hostname and the bogon, Tor, relay and anycast flags, with no daily or monthly cap, with a key or without one.
|
|
56
56
|
|
|
57
57
|
```python
|
|
58
58
|
from internetdata import InternetData
|
|
@@ -407,11 +407,15 @@ Each redirect URI must be https on a public host name, or http on a loopback add
|
|
|
407
407
|
|
|
408
408
|
### Fields your plan does not include
|
|
409
409
|
|
|
410
|
-
Unlimited leaves out the VPN, proxy, hosting and
|
|
410
|
+
Unlimited leaves out the VPN, proxy, hosting, CDN, bot, carrier, satellite, SSH, SMTP, web, DNS resolver and BitTorrent flags, the detail behind every flag but Tor's and relay's (`bot`, whose bot uses the address, included), the city and region, the kind of network the AS runs (`asn.type`), the Whois records and the hosted domains; a free-plan key's answer carries `trial_expired`, true once its trial is spent. A paid key's carries `cap_reached`, true once its organization's overage cap is reached, when the answer has Unlimited's fields and isn't billed. Those are `None` when your key does not include them, which means "not in your plan" rather than "checked, and no", inside `location`, `asn`, `company` and `abuse` too. The exception, until the next major, is `is_bot`, `is_carrier`, `is_satellite`, `is_ssh`, `is_smtp`, `is_web`, `is_dns_resolver`, `is_bittorrent` and `asn.type`: they keep their plain types, `bool` and `str`, and read `False` and `""` when the answer leaves them out, so `result.raw` is how you tell a member the answer carried from one it did not.
|
|
411
411
|
|
|
412
412
|
```python
|
|
413
413
|
result.flagged("is_hosting") # False rather than None on a plan without it
|
|
414
414
|
result.is_hosting is None # True on Unlimited: not in your plan
|
|
415
|
+
result.is_bot # False on Unlimited, which leaves it out
|
|
416
|
+
"is_bot" in result.raw # False on Unlimited: it was not in the answer
|
|
417
|
+
result.asn.type # "" on Unlimited, which leaves it out
|
|
418
|
+
"type" in result.raw["asn"] # False on Unlimited: it was not in the answer
|
|
415
419
|
result.location.city is None # True on Unlimited
|
|
416
420
|
result.trial_expired is True # a free-plan key's trial is spent
|
|
417
421
|
result.cap_reached is True # a paid key is past its overage cap
|
|
@@ -17,7 +17,7 @@ Requires Python 3.11 or newer. Type hints are included, and the package ships `p
|
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
19
19
|
|
|
20
|
-
**No API key needed to start.** Unlimited, the free plan, answers `location`, `asn`, `company`, `abuse
|
|
20
|
+
**No API key needed to start.** Unlimited, the free plan, answers `location`, `asn`, `company`, `abuse`, the hostname and the bogon, Tor, relay and anycast flags, with no daily or monthly cap, with a key or without one.
|
|
21
21
|
|
|
22
22
|
```python
|
|
23
23
|
from internetdata import InternetData
|
|
@@ -372,11 +372,15 @@ Each redirect URI must be https on a public host name, or http on a loopback add
|
|
|
372
372
|
|
|
373
373
|
### Fields your plan does not include
|
|
374
374
|
|
|
375
|
-
Unlimited leaves out the VPN, proxy, hosting and
|
|
375
|
+
Unlimited leaves out the VPN, proxy, hosting, CDN, bot, carrier, satellite, SSH, SMTP, web, DNS resolver and BitTorrent flags, the detail behind every flag but Tor's and relay's (`bot`, whose bot uses the address, included), the city and region, the kind of network the AS runs (`asn.type`), the Whois records and the hosted domains; a free-plan key's answer carries `trial_expired`, true once its trial is spent. A paid key's carries `cap_reached`, true once its organization's overage cap is reached, when the answer has Unlimited's fields and isn't billed. Those are `None` when your key does not include them, which means "not in your plan" rather than "checked, and no", inside `location`, `asn`, `company` and `abuse` too. The exception, until the next major, is `is_bot`, `is_carrier`, `is_satellite`, `is_ssh`, `is_smtp`, `is_web`, `is_dns_resolver`, `is_bittorrent` and `asn.type`: they keep their plain types, `bool` and `str`, and read `False` and `""` when the answer leaves them out, so `result.raw` is how you tell a member the answer carried from one it did not.
|
|
376
376
|
|
|
377
377
|
```python
|
|
378
378
|
result.flagged("is_hosting") # False rather than None on a plan without it
|
|
379
379
|
result.is_hosting is None # True on Unlimited: not in your plan
|
|
380
|
+
result.is_bot # False on Unlimited, which leaves it out
|
|
381
|
+
"is_bot" in result.raw # False on Unlimited: it was not in the answer
|
|
382
|
+
result.asn.type # "" on Unlimited, which leaves it out
|
|
383
|
+
"type" in result.raw["asn"] # False on Unlimited: it was not in the answer
|
|
380
384
|
result.location.city is None # True on Unlimited
|
|
381
385
|
result.trial_expired is True # a free-plan key's trial is spent
|
|
382
386
|
result.cap_reached is True # a paid key is past its overage cap
|
|
@@ -13,7 +13,7 @@ info:
|
|
|
13
13
|
email: support@internetdata.io
|
|
14
14
|
url: https://internetdata.io
|
|
15
15
|
termsOfService: https://internetdata.io/terms
|
|
16
|
-
version: 2026.11.
|
|
16
|
+
version: 2026.11.26
|
|
17
17
|
servers:
|
|
18
18
|
- url: https://internetdata.io
|
|
19
19
|
tags:
|
|
@@ -961,15 +961,7 @@ paths:
|
|
|
961
961
|
is_bogon: false
|
|
962
962
|
is_tor: false
|
|
963
963
|
is_relay: false
|
|
964
|
-
is_bot: false
|
|
965
964
|
is_anycast: false
|
|
966
|
-
is_carrier: false
|
|
967
|
-
is_satellite: false
|
|
968
|
-
is_ssh: false
|
|
969
|
-
is_smtp: false
|
|
970
|
-
is_web: false
|
|
971
|
-
is_dns_resolver: false
|
|
972
|
-
is_bittorrent: false
|
|
973
965
|
location:
|
|
974
966
|
continent: EU
|
|
975
967
|
continent_name: Europe
|
|
@@ -987,7 +979,6 @@ paths:
|
|
|
987
979
|
asn: 9009
|
|
988
980
|
name: M247 Europe SRL
|
|
989
981
|
domain: m247global.com
|
|
990
|
-
type: hosting
|
|
991
982
|
prefix: 146.70.116.0/24
|
|
992
983
|
country: RO
|
|
993
984
|
rpki_status: not_found
|
|
@@ -1117,15 +1108,7 @@ paths:
|
|
|
1117
1108
|
is_bogon: false
|
|
1118
1109
|
is_tor: false
|
|
1119
1110
|
is_relay: false
|
|
1120
|
-
is_bot: false
|
|
1121
1111
|
is_anycast: false
|
|
1122
|
-
is_carrier: false
|
|
1123
|
-
is_satellite: false
|
|
1124
|
-
is_ssh: false
|
|
1125
|
-
is_smtp: false
|
|
1126
|
-
is_web: false
|
|
1127
|
-
is_dns_resolver: false
|
|
1128
|
-
is_bittorrent: false
|
|
1129
1112
|
location:
|
|
1130
1113
|
continent: EU
|
|
1131
1114
|
continent_name: Europe
|
|
@@ -1143,7 +1126,6 @@ paths:
|
|
|
1143
1126
|
asn: 9009
|
|
1144
1127
|
name: M247 Europe SRL
|
|
1145
1128
|
domain: m247global.com
|
|
1146
|
-
type: hosting
|
|
1147
1129
|
prefix: 146.70.116.0/24
|
|
1148
1130
|
country: RO
|
|
1149
1131
|
rpki_status: not_found
|
|
@@ -1556,15 +1538,7 @@ paths:
|
|
|
1556
1538
|
is_bogon: false
|
|
1557
1539
|
is_tor: false
|
|
1558
1540
|
is_relay: false
|
|
1559
|
-
is_bot: false
|
|
1560
1541
|
is_anycast: false
|
|
1561
|
-
is_carrier: false
|
|
1562
|
-
is_satellite: false
|
|
1563
|
-
is_ssh: false
|
|
1564
|
-
is_smtp: false
|
|
1565
|
-
is_web: false
|
|
1566
|
-
is_dns_resolver: false
|
|
1567
|
-
is_bittorrent: false
|
|
1568
1542
|
location:
|
|
1569
1543
|
continent: EU
|
|
1570
1544
|
continent_name: Europe
|
|
@@ -1582,7 +1556,6 @@ paths:
|
|
|
1582
1556
|
asn: 9009
|
|
1583
1557
|
name: M247 Europe SRL
|
|
1584
1558
|
domain: m247global.com
|
|
1585
|
-
type: hosting
|
|
1586
1559
|
prefix: 146.70.116.0/24
|
|
1587
1560
|
country: RO
|
|
1588
1561
|
rpki_status: not_found
|
|
@@ -1839,15 +1812,7 @@ paths:
|
|
|
1839
1812
|
is_bogon: false
|
|
1840
1813
|
is_tor: false
|
|
1841
1814
|
is_relay: false
|
|
1842
|
-
is_bot: false
|
|
1843
1815
|
is_anycast: false
|
|
1844
|
-
is_carrier: false
|
|
1845
|
-
is_satellite: false
|
|
1846
|
-
is_ssh: false
|
|
1847
|
-
is_smtp: false
|
|
1848
|
-
is_web: false
|
|
1849
|
-
is_dns_resolver: false
|
|
1850
|
-
is_bittorrent: false
|
|
1851
1816
|
location:
|
|
1852
1817
|
continent: EU
|
|
1853
1818
|
continent_name: Europe
|
|
@@ -1865,7 +1830,6 @@ paths:
|
|
|
1865
1830
|
asn: 9009
|
|
1866
1831
|
name: M247 Europe SRL
|
|
1867
1832
|
domain: m247global.com
|
|
1868
|
-
type: hosting
|
|
1869
1833
|
prefix: 146.70.116.0/24
|
|
1870
1834
|
country: RO
|
|
1871
1835
|
rpki_status: not_found
|
|
@@ -3835,31 +3799,34 @@ components:
|
|
|
3835
3799
|
description: >-
|
|
3836
3800
|
In Bot IP: an automated client's address, such as a search engine's or an AI company's
|
|
3837
3801
|
crawler, an uptime monitor, an internet scanner or a webhook sender. `bot` says whose,
|
|
3838
|
-
what it does and whether its operator vouches for the address.
|
|
3802
|
+
what it does and whether its operator vouches for the address. On a paid plan or the
|
|
3803
|
+
trial.
|
|
3839
3804
|
is_anycast:
|
|
3840
3805
|
type: boolean
|
|
3841
3806
|
description: 'In Anycast IP: announced from many places at once.'
|
|
3842
3807
|
is_carrier:
|
|
3843
3808
|
type: boolean
|
|
3844
|
-
description: 'In Carrier IP: a mobile carrier''s address space.'
|
|
3809
|
+
description: 'In Carrier IP: a mobile carrier''s address space. On a paid plan or the trial.'
|
|
3845
3810
|
is_satellite:
|
|
3846
3811
|
type: boolean
|
|
3847
|
-
description: 'In Satellite IP: a satellite operator''s address space.'
|
|
3812
|
+
description: 'In Satellite IP: a satellite operator''s address space. On a paid plan or the trial.'
|
|
3848
3813
|
is_ssh:
|
|
3849
3814
|
type: boolean
|
|
3850
|
-
description: 'In SSH IP: an SSH server answered here.'
|
|
3815
|
+
description: 'In SSH IP: an SSH server answered here. On a paid plan or the trial.'
|
|
3851
3816
|
is_smtp:
|
|
3852
3817
|
type: boolean
|
|
3853
|
-
description: 'In SMTP IP: a mail server answered here.'
|
|
3818
|
+
description: 'In SMTP IP: a mail server answered here. On a paid plan or the trial.'
|
|
3854
3819
|
is_web:
|
|
3855
3820
|
type: boolean
|
|
3856
|
-
description: 'In Web IP: a web server answered here on port 80 or 443.'
|
|
3821
|
+
description: 'In Web IP: a web server answered here on port 80 or 443. On a paid plan or the trial.'
|
|
3857
3822
|
is_dns_resolver:
|
|
3858
3823
|
type: boolean
|
|
3859
|
-
description: 'In DNS Resolver IP: an open DNS resolver answered here.'
|
|
3824
|
+
description: 'In DNS Resolver IP: an open DNS resolver answered here. On a paid plan or the trial.'
|
|
3860
3825
|
is_bittorrent:
|
|
3861
3826
|
type: boolean
|
|
3862
|
-
description:
|
|
3827
|
+
description: >-
|
|
3828
|
+
In BitTorrent IP: a BitTorrent client was seen here in the last 90 days. On a paid plan
|
|
3829
|
+
or the trial.
|
|
3863
3830
|
vpn:
|
|
3864
3831
|
allOf:
|
|
3865
3832
|
- $ref: '#/components/schemas/ClassDetail'
|
|
@@ -3974,15 +3941,7 @@ components:
|
|
|
3974
3941
|
- is_bogon
|
|
3975
3942
|
- is_tor
|
|
3976
3943
|
- is_relay
|
|
3977
|
-
- is_bot
|
|
3978
3944
|
- is_anycast
|
|
3979
|
-
- is_carrier
|
|
3980
|
-
- is_satellite
|
|
3981
|
-
- is_ssh
|
|
3982
|
-
- is_smtp
|
|
3983
|
-
- is_web
|
|
3984
|
-
- is_dns_resolver
|
|
3985
|
-
- is_bittorrent
|
|
3986
3945
|
- tor
|
|
3987
3946
|
- relay
|
|
3988
3947
|
- location
|
|
@@ -4443,7 +4402,7 @@ components:
|
|
|
4443
4402
|
description: Its operator's domain.
|
|
4444
4403
|
type:
|
|
4445
4404
|
type: string
|
|
4446
|
-
description: The kind of network it runs.
|
|
4405
|
+
description: The kind of network it runs. On a paid plan or the trial.
|
|
4447
4406
|
prefix:
|
|
4448
4407
|
type: string
|
|
4449
4408
|
description: The announced prefix covering the address.
|
|
@@ -4457,7 +4416,6 @@ components:
|
|
|
4457
4416
|
- asn
|
|
4458
4417
|
- name
|
|
4459
4418
|
- domain
|
|
4460
|
-
- type
|
|
4461
4419
|
- prefix
|
|
4462
4420
|
- country
|
|
4463
4421
|
- rpki_status
|
|
@@ -6,6 +6,8 @@ from typing import Any, Self, TypeVar
|
|
|
6
6
|
from attrs import define as _attrs_define
|
|
7
7
|
from attrs import field as _attrs_field
|
|
8
8
|
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
9
11
|
T = TypeVar("T", bound="Asn")
|
|
10
12
|
|
|
11
13
|
|
|
@@ -17,19 +19,19 @@ class Asn:
|
|
|
17
19
|
asn (int): The AS announcing the address, 0 where none does.
|
|
18
20
|
name (str): Its operator.
|
|
19
21
|
domain (str): Its operator's domain.
|
|
20
|
-
type_ (str): The kind of network it runs.
|
|
21
22
|
prefix (str): The announced prefix covering the address.
|
|
22
23
|
country (str): The country its registry assigned it to.
|
|
23
24
|
rpki_status (str): The announcement's RPKI status.
|
|
25
|
+
type_ (str | Unset): The kind of network it runs. On a paid plan or the trial.
|
|
24
26
|
"""
|
|
25
27
|
|
|
26
28
|
asn: int
|
|
27
29
|
name: str
|
|
28
30
|
domain: str
|
|
29
|
-
type_: str
|
|
30
31
|
prefix: str
|
|
31
32
|
country: str
|
|
32
33
|
rpki_status: str
|
|
34
|
+
type_: str | Unset = UNSET
|
|
33
35
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
34
36
|
|
|
35
37
|
def to_dict(self) -> dict[str, Any]:
|
|
@@ -39,14 +41,14 @@ class Asn:
|
|
|
39
41
|
|
|
40
42
|
domain = self.domain
|
|
41
43
|
|
|
42
|
-
type_ = self.type_
|
|
43
|
-
|
|
44
44
|
prefix = self.prefix
|
|
45
45
|
|
|
46
46
|
country = self.country
|
|
47
47
|
|
|
48
48
|
rpki_status = self.rpki_status
|
|
49
49
|
|
|
50
|
+
type_ = self.type_
|
|
51
|
+
|
|
50
52
|
field_dict: dict[str, Any] = {}
|
|
51
53
|
field_dict.update(self.additional_properties)
|
|
52
54
|
field_dict.update(
|
|
@@ -54,12 +56,13 @@ class Asn:
|
|
|
54
56
|
"asn": asn,
|
|
55
57
|
"name": name,
|
|
56
58
|
"domain": domain,
|
|
57
|
-
"type": type_,
|
|
58
59
|
"prefix": prefix,
|
|
59
60
|
"country": country,
|
|
60
61
|
"rpki_status": rpki_status,
|
|
61
62
|
}
|
|
62
63
|
)
|
|
64
|
+
if type_ is not UNSET:
|
|
65
|
+
field_dict["type"] = type_
|
|
63
66
|
|
|
64
67
|
return field_dict
|
|
65
68
|
|
|
@@ -72,22 +75,22 @@ class Asn:
|
|
|
72
75
|
|
|
73
76
|
domain = d.pop("domain")
|
|
74
77
|
|
|
75
|
-
type_ = d.pop("type")
|
|
76
|
-
|
|
77
78
|
prefix = d.pop("prefix")
|
|
78
79
|
|
|
79
80
|
country = d.pop("country")
|
|
80
81
|
|
|
81
82
|
rpki_status = d.pop("rpki_status")
|
|
82
83
|
|
|
84
|
+
type_ = d.pop("type", UNSET)
|
|
85
|
+
|
|
83
86
|
asn = cls(
|
|
84
87
|
asn=asn,
|
|
85
88
|
name=name,
|
|
86
89
|
domain=domain,
|
|
87
|
-
type_=type_,
|
|
88
90
|
prefix=prefix,
|
|
89
91
|
country=country,
|
|
90
92
|
rpki_status=rpki_status,
|
|
93
|
+
type_=type_,
|
|
91
94
|
)
|
|
92
95
|
|
|
93
96
|
asn.additional_properties = d
|
{internetdata-2.20.0 → internetdata-2.22.0}/src/internetdata/_generated/models/lookup_response.py
RENAMED
|
@@ -42,17 +42,7 @@ class LookupResponse:
|
|
|
42
42
|
is_bogon (bool): Reserved space, answered from the address alone.
|
|
43
43
|
is_tor (bool): In Tor IP: a Tor exit.
|
|
44
44
|
is_relay (bool): In Relay IP: an anonymizing relay such as iCloud Private Relay.
|
|
45
|
-
is_bot (bool): In Bot IP: an automated client's address, such as a search engine's or an AI company's crawler,
|
|
46
|
-
an uptime monitor, an internet scanner or a webhook sender. `bot` says whose, what it does and whether its
|
|
47
|
-
operator vouches for the address.
|
|
48
45
|
is_anycast (bool): In Anycast IP: announced from many places at once.
|
|
49
|
-
is_carrier (bool): In Carrier IP: a mobile carrier's address space.
|
|
50
|
-
is_satellite (bool): In Satellite IP: a satellite operator's address space.
|
|
51
|
-
is_ssh (bool): In SSH IP: an SSH server answered here.
|
|
52
|
-
is_smtp (bool): In SMTP IP: a mail server answered here.
|
|
53
|
-
is_web (bool): In Web IP: a web server answered here on port 80 or 443.
|
|
54
|
-
is_dns_resolver (bool): In DNS Resolver IP: an open DNS resolver answered here.
|
|
55
|
-
is_bittorrent (bool): In BitTorrent IP: a BitTorrent client was seen here in the last 90 days.
|
|
56
46
|
tor (ClassDetail):
|
|
57
47
|
relay (ClassDetail):
|
|
58
48
|
location (Location): Where the address is.
|
|
@@ -69,6 +59,18 @@ class LookupResponse:
|
|
|
69
59
|
paid plan or the trial.
|
|
70
60
|
is_hosting (bool | Unset): In Hosting IP: a hosting or cloud network. On a paid plan or the trial.
|
|
71
61
|
is_cdn (bool | Unset): In CDN IP: a content delivery network. On a paid plan or the trial.
|
|
62
|
+
is_bot (bool | Unset): In Bot IP: an automated client's address, such as a search engine's or an AI company's
|
|
63
|
+
crawler, an uptime monitor, an internet scanner or a webhook sender. `bot` says whose, what it does and whether
|
|
64
|
+
its operator vouches for the address. On a paid plan or the trial.
|
|
65
|
+
is_carrier (bool | Unset): In Carrier IP: a mobile carrier's address space. On a paid plan or the trial.
|
|
66
|
+
is_satellite (bool | Unset): In Satellite IP: a satellite operator's address space. On a paid plan or the trial.
|
|
67
|
+
is_ssh (bool | Unset): In SSH IP: an SSH server answered here. On a paid plan or the trial.
|
|
68
|
+
is_smtp (bool | Unset): In SMTP IP: a mail server answered here. On a paid plan or the trial.
|
|
69
|
+
is_web (bool | Unset): In Web IP: a web server answered here on port 80 or 443. On a paid plan or the trial.
|
|
70
|
+
is_dns_resolver (bool | Unset): In DNS Resolver IP: an open DNS resolver answered here. On a paid plan or the
|
|
71
|
+
trial.
|
|
72
|
+
is_bittorrent (bool | Unset): In BitTorrent IP: a BitTorrent client was seen here in the last 90 days. On a paid
|
|
73
|
+
plan or the trial.
|
|
72
74
|
vpn (ClassDetail | Unset):
|
|
73
75
|
resproxy (ProxyDetail | Unset):
|
|
74
76
|
dcproxy (ProxyDetail | Unset):
|
|
@@ -101,15 +103,7 @@ class LookupResponse:
|
|
|
101
103
|
is_bogon: bool
|
|
102
104
|
is_tor: bool
|
|
103
105
|
is_relay: bool
|
|
104
|
-
is_bot: bool
|
|
105
106
|
is_anycast: bool
|
|
106
|
-
is_carrier: bool
|
|
107
|
-
is_satellite: bool
|
|
108
|
-
is_ssh: bool
|
|
109
|
-
is_smtp: bool
|
|
110
|
-
is_web: bool
|
|
111
|
-
is_dns_resolver: bool
|
|
112
|
-
is_bittorrent: bool
|
|
113
107
|
tor: ClassDetail
|
|
114
108
|
relay: ClassDetail
|
|
115
109
|
location: Location
|
|
@@ -124,6 +118,14 @@ class LookupResponse:
|
|
|
124
118
|
is_pubproxy: bool | Unset = UNSET
|
|
125
119
|
is_hosting: bool | Unset = UNSET
|
|
126
120
|
is_cdn: bool | Unset = UNSET
|
|
121
|
+
is_bot: bool | Unset = UNSET
|
|
122
|
+
is_carrier: bool | Unset = UNSET
|
|
123
|
+
is_satellite: bool | Unset = UNSET
|
|
124
|
+
is_ssh: bool | Unset = UNSET
|
|
125
|
+
is_smtp: bool | Unset = UNSET
|
|
126
|
+
is_web: bool | Unset = UNSET
|
|
127
|
+
is_dns_resolver: bool | Unset = UNSET
|
|
128
|
+
is_bittorrent: bool | Unset = UNSET
|
|
127
129
|
vpn: ClassDetail | Unset = UNSET
|
|
128
130
|
resproxy: ProxyDetail | Unset = UNSET
|
|
129
131
|
dcproxy: ProxyDetail | Unset = UNSET
|
|
@@ -156,24 +158,8 @@ class LookupResponse:
|
|
|
156
158
|
|
|
157
159
|
is_relay = self.is_relay
|
|
158
160
|
|
|
159
|
-
is_bot = self.is_bot
|
|
160
|
-
|
|
161
161
|
is_anycast = self.is_anycast
|
|
162
162
|
|
|
163
|
-
is_carrier = self.is_carrier
|
|
164
|
-
|
|
165
|
-
is_satellite = self.is_satellite
|
|
166
|
-
|
|
167
|
-
is_ssh = self.is_ssh
|
|
168
|
-
|
|
169
|
-
is_smtp = self.is_smtp
|
|
170
|
-
|
|
171
|
-
is_web = self.is_web
|
|
172
|
-
|
|
173
|
-
is_dns_resolver = self.is_dns_resolver
|
|
174
|
-
|
|
175
|
-
is_bittorrent = self.is_bittorrent
|
|
176
|
-
|
|
177
163
|
tor = self.tor.to_dict()
|
|
178
164
|
|
|
179
165
|
relay = self.relay.to_dict()
|
|
@@ -202,6 +188,22 @@ class LookupResponse:
|
|
|
202
188
|
|
|
203
189
|
is_cdn = self.is_cdn
|
|
204
190
|
|
|
191
|
+
is_bot = self.is_bot
|
|
192
|
+
|
|
193
|
+
is_carrier = self.is_carrier
|
|
194
|
+
|
|
195
|
+
is_satellite = self.is_satellite
|
|
196
|
+
|
|
197
|
+
is_ssh = self.is_ssh
|
|
198
|
+
|
|
199
|
+
is_smtp = self.is_smtp
|
|
200
|
+
|
|
201
|
+
is_web = self.is_web
|
|
202
|
+
|
|
203
|
+
is_dns_resolver = self.is_dns_resolver
|
|
204
|
+
|
|
205
|
+
is_bittorrent = self.is_bittorrent
|
|
206
|
+
|
|
205
207
|
vpn: dict[str, Any] | Unset = UNSET
|
|
206
208
|
if not isinstance(self.vpn, Unset):
|
|
207
209
|
vpn = self.vpn.to_dict()
|
|
@@ -293,15 +295,7 @@ class LookupResponse:
|
|
|
293
295
|
"is_bogon": is_bogon,
|
|
294
296
|
"is_tor": is_tor,
|
|
295
297
|
"is_relay": is_relay,
|
|
296
|
-
"is_bot": is_bot,
|
|
297
298
|
"is_anycast": is_anycast,
|
|
298
|
-
"is_carrier": is_carrier,
|
|
299
|
-
"is_satellite": is_satellite,
|
|
300
|
-
"is_ssh": is_ssh,
|
|
301
|
-
"is_smtp": is_smtp,
|
|
302
|
-
"is_web": is_web,
|
|
303
|
-
"is_dns_resolver": is_dns_resolver,
|
|
304
|
-
"is_bittorrent": is_bittorrent,
|
|
305
299
|
"tor": tor,
|
|
306
300
|
"relay": relay,
|
|
307
301
|
"location": location,
|
|
@@ -325,6 +319,22 @@ class LookupResponse:
|
|
|
325
319
|
field_dict["is_hosting"] = is_hosting
|
|
326
320
|
if is_cdn is not UNSET:
|
|
327
321
|
field_dict["is_cdn"] = is_cdn
|
|
322
|
+
if is_bot is not UNSET:
|
|
323
|
+
field_dict["is_bot"] = is_bot
|
|
324
|
+
if is_carrier is not UNSET:
|
|
325
|
+
field_dict["is_carrier"] = is_carrier
|
|
326
|
+
if is_satellite is not UNSET:
|
|
327
|
+
field_dict["is_satellite"] = is_satellite
|
|
328
|
+
if is_ssh is not UNSET:
|
|
329
|
+
field_dict["is_ssh"] = is_ssh
|
|
330
|
+
if is_smtp is not UNSET:
|
|
331
|
+
field_dict["is_smtp"] = is_smtp
|
|
332
|
+
if is_web is not UNSET:
|
|
333
|
+
field_dict["is_web"] = is_web
|
|
334
|
+
if is_dns_resolver is not UNSET:
|
|
335
|
+
field_dict["is_dns_resolver"] = is_dns_resolver
|
|
336
|
+
if is_bittorrent is not UNSET:
|
|
337
|
+
field_dict["is_bittorrent"] = is_bittorrent
|
|
328
338
|
if vpn is not UNSET:
|
|
329
339
|
field_dict["vpn"] = vpn
|
|
330
340
|
if resproxy is not UNSET:
|
|
@@ -401,24 +411,8 @@ class LookupResponse:
|
|
|
401
411
|
|
|
402
412
|
is_relay = d.pop("is_relay")
|
|
403
413
|
|
|
404
|
-
is_bot = d.pop("is_bot")
|
|
405
|
-
|
|
406
414
|
is_anycast = d.pop("is_anycast")
|
|
407
415
|
|
|
408
|
-
is_carrier = d.pop("is_carrier")
|
|
409
|
-
|
|
410
|
-
is_satellite = d.pop("is_satellite")
|
|
411
|
-
|
|
412
|
-
is_ssh = d.pop("is_ssh")
|
|
413
|
-
|
|
414
|
-
is_smtp = d.pop("is_smtp")
|
|
415
|
-
|
|
416
|
-
is_web = d.pop("is_web")
|
|
417
|
-
|
|
418
|
-
is_dns_resolver = d.pop("is_dns_resolver")
|
|
419
|
-
|
|
420
|
-
is_bittorrent = d.pop("is_bittorrent")
|
|
421
|
-
|
|
422
416
|
tor = ClassDetail.from_dict(d.pop("tor"))
|
|
423
417
|
|
|
424
418
|
relay = ClassDetail.from_dict(d.pop("relay"))
|
|
@@ -447,6 +441,22 @@ class LookupResponse:
|
|
|
447
441
|
|
|
448
442
|
is_cdn = d.pop("is_cdn", UNSET)
|
|
449
443
|
|
|
444
|
+
is_bot = d.pop("is_bot", UNSET)
|
|
445
|
+
|
|
446
|
+
is_carrier = d.pop("is_carrier", UNSET)
|
|
447
|
+
|
|
448
|
+
is_satellite = d.pop("is_satellite", UNSET)
|
|
449
|
+
|
|
450
|
+
is_ssh = d.pop("is_ssh", UNSET)
|
|
451
|
+
|
|
452
|
+
is_smtp = d.pop("is_smtp", UNSET)
|
|
453
|
+
|
|
454
|
+
is_web = d.pop("is_web", UNSET)
|
|
455
|
+
|
|
456
|
+
is_dns_resolver = d.pop("is_dns_resolver", UNSET)
|
|
457
|
+
|
|
458
|
+
is_bittorrent = d.pop("is_bittorrent", UNSET)
|
|
459
|
+
|
|
450
460
|
_vpn = d.pop("vpn", UNSET)
|
|
451
461
|
vpn: ClassDetail | Unset
|
|
452
462
|
if isinstance(_vpn, Unset):
|
|
@@ -591,15 +601,7 @@ class LookupResponse:
|
|
|
591
601
|
is_bogon=is_bogon,
|
|
592
602
|
is_tor=is_tor,
|
|
593
603
|
is_relay=is_relay,
|
|
594
|
-
is_bot=is_bot,
|
|
595
604
|
is_anycast=is_anycast,
|
|
596
|
-
is_carrier=is_carrier,
|
|
597
|
-
is_satellite=is_satellite,
|
|
598
|
-
is_ssh=is_ssh,
|
|
599
|
-
is_smtp=is_smtp,
|
|
600
|
-
is_web=is_web,
|
|
601
|
-
is_dns_resolver=is_dns_resolver,
|
|
602
|
-
is_bittorrent=is_bittorrent,
|
|
603
605
|
tor=tor,
|
|
604
606
|
relay=relay,
|
|
605
607
|
location=location,
|
|
@@ -614,6 +616,14 @@ class LookupResponse:
|
|
|
614
616
|
is_pubproxy=is_pubproxy,
|
|
615
617
|
is_hosting=is_hosting,
|
|
616
618
|
is_cdn=is_cdn,
|
|
619
|
+
is_bot=is_bot,
|
|
620
|
+
is_carrier=is_carrier,
|
|
621
|
+
is_satellite=is_satellite,
|
|
622
|
+
is_ssh=is_ssh,
|
|
623
|
+
is_smtp=is_smtp,
|
|
624
|
+
is_web=is_web,
|
|
625
|
+
is_dns_resolver=is_dns_resolver,
|
|
626
|
+
is_bittorrent=is_bittorrent,
|
|
617
627
|
vpn=vpn,
|
|
618
628
|
resproxy=resproxy,
|
|
619
629
|
dcproxy=dcproxy,
|
|
@@ -60,11 +60,12 @@ def missing_members(condition: Conditions, result: Any) -> list[str]:
|
|
|
60
60
|
is one.
|
|
61
61
|
|
|
62
62
|
A locally answered bogon needs no special case: it is synthesized in the widest
|
|
63
|
-
shape, so every member is present and nothing reads as missing.
|
|
63
|
+
shape, so every member is present and nothing reads as missing. A member the type holds
|
|
64
|
+
as False or "" (a flag, ``asn.type``) is missing when the served answer lacked it.
|
|
64
65
|
"""
|
|
65
66
|
missing: list[str] = []
|
|
66
67
|
for one in _as_list(condition):
|
|
67
|
-
_collect_missing(one, result, "", missing)
|
|
68
|
+
_collect_missing(one, result, "", missing, None)
|
|
68
69
|
return missing
|
|
69
70
|
|
|
70
71
|
|
|
@@ -107,19 +108,37 @@ def _as_list(condition: Conditions) -> list[BlockCondition]:
|
|
|
107
108
|
|
|
108
109
|
|
|
109
110
|
def _collect_missing(
|
|
110
|
-
condition: BlockCondition,
|
|
111
|
+
condition: BlockCondition,
|
|
112
|
+
value: Any,
|
|
113
|
+
prefix: str,
|
|
114
|
+
missing: list[str],
|
|
115
|
+
served: Any,
|
|
111
116
|
) -> None:
|
|
117
|
+
"""`served` is the wire object `value` was read from, when its parent knew it: only the
|
|
118
|
+
answer itself carries `raw`, so a held member of an object inside it reads its parent's."""
|
|
119
|
+
if served is None:
|
|
120
|
+
served = getattr(value, "raw", None)
|
|
112
121
|
for member, want in condition.items():
|
|
113
122
|
if constraint_count(want) == 0:
|
|
114
123
|
continue
|
|
115
124
|
path = f"{prefix}{member}"
|
|
116
125
|
got = getattr(value, member, None)
|
|
117
|
-
if got is None:
|
|
126
|
+
if got is None or _left_out(value, member, served):
|
|
118
127
|
if path not in missing:
|
|
119
128
|
missing.append(path)
|
|
120
129
|
continue
|
|
121
130
|
if isinstance(want, dict) and not _is_bound(want) and _populated(got):
|
|
122
|
-
|
|
131
|
+
inner = served.get(member) if isinstance(served, dict) else None
|
|
132
|
+
_collect_missing(want, got, f"{path}.", missing, inner)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def _left_out(value: Any, member: str, served: Any) -> bool:
|
|
136
|
+
"""Whether the served answer lacked a member the type holds as False or "". The type
|
|
137
|
+
reads it so either way, so only the wire object tells; an answer with none (a bogon's,
|
|
138
|
+
or one built by hand) reads as it was built."""
|
|
139
|
+
fields = getattr(value, "__dataclass_fields__", {})
|
|
140
|
+
held = member in fields and fields[member].metadata.get("held")
|
|
141
|
+
return bool(held and served and member not in served)
|
|
123
142
|
|
|
124
143
|
|
|
125
144
|
def _populated(value: Any) -> bool:
|