Releases: ipregistry/ipregistry-python
Releases · ipregistry/ipregistry-python
Release list
5.0.1
Fixed
- Fix batch lookups with a
fieldsselection: the API applies the filter to the whole batch
response body, so each field is now prefixed withresults.on batch endpoints. Previously
the filter stripped theresultsarray itself and the lookup crashed with anIndexError. - Raise a descriptive
ClientErrorwhen a batch response contains fewer results than requested
items, instead of crashing with anIndexError.
5.0.0
Added
- Add an asyncio-based
AsyncIpregistryClientwith the same feature set, available with theasync
extra:pip install ipregistry[async]. - Add configurable retries through
IpregistryConfig:retry_max_attempts,retry_interval,
retry_on_server_errorandretry_on_too_many_requests(honoring theRetry-Afterheader).
Transient network errors are now retried too. - Add a typed
ErrorCodeenum exposed asApiError.error_code. - Add
IpregistryLookupErroras the primary name for per-entry batch lookup errors; the previous
LookupErrorname, which shadows the Python builtin, remains available as an alias. - Ship a
py.typedmarker so type checkers use the library's annotations. - Add automatic splitting of batch lookups larger than the API limit of 1024 items into concurrent
chunks, tunable with themax_batch_sizeandbatch_concurrencyclient options. - Add
close()and context manager support toIpregistryClient, plus an optionalsession
option to provide a customrequests.Session. - Add a
user_agentconfiguration option to customize the User-Agent header. - Add a release workflow publishing to PyPI through trusted publishing, a ruff lint workflow, and
a weekly scheduled workflow running tests against the live API.
Changed
- Require Python 3.10+.
- Migrate the project metadata to the standard PEP 621 format and switch project management
from Poetry to uv. - Update all dependencies to their latest versions and remove the dependency on tenacity.
- Reuse pooled HTTP connections through a
requests.Sessioninstead of opening a new connection
per request. - Align the default request timeout with other Ipregistry client libraries: 15 seconds instead of 5.
- Origin lookups are no longer cached: cached requester data would be stale or wrong when the
network context changes. - Cache keys are now deterministic regardless of the order lookup options are given in.
- Remove the redundant retry on
origin_lookup_ipthat could triple retry attempts. - Detect the Yahoo Slurp crawler in
UserAgents.is_bot.
Fixed
- Fix nested model fields (
Connection,CurrencyFormat,UserAgentdevice/engine/os,RequesterIpInfouser_agent)
raising a validation error when excluded from a response using thefieldsparameter. - Fix
str(ApiError)returning a tuple representation instead of the error message. - Raise
ClientErrorinstead of leaking aJSONDecodeErrorwhen an error response has a non-JSON body. - Raise
ValueErrorinstead ofTypeErrorwhenlookup_ipis called with a non-string input. - Support boolean and numeric option values when building request URLs and cache keys.
- Reject float inputs when detecting ASN values in
lookup_asn.
4.0.0
Changed
- Require Python 3.8+.
- Add new functions for retrieving Autonomous System data:
batch_lookup_asns,lookup_asn,origin_lookup_asn. - Add new functions for user-agent header value parsing:
batch_parse_user_agents,parse_user_agent. - API key is passed as header value and no longer as query parameter.
- Client library method are now wrapped in a new ApiResponse object that includes a mean to retrieve metadata
about credits and throttling in addition to data. - Introduce data model for responses to enable field value access using dot notation and ensure code autocompletion functionality.
- Rename all function and variable names to adhere to snake_case convention.
- Replace the function named
lookupby 3 new functions:batch_lookup_ips,lookup_ipandorigin_lookup_ip. - Rename IpregistryConfig option
apiUrltobaseUrl. - Rename UserAgent utility class to _UserAgents.
3.2.0
3.1.0
3.0.0
Changed
- Drop Python 2 support.
- Rename DefaultCache to InMemoryCache.
2.0.1
Fixed
- Fix packaging with version 2.0.0 deployed on pypi.
2.0.0
Changed
- Disable caching by default since people are often confused by this default setting. You can enable caching by following what is explained in the README.
- Increase maximum timeout to 15s from 3s.
1.1.0
Changed
-
Decrease the default cache period to 10min from 24h.
This is to better handle use cases that require fresh security data.
Indeed, such data is updated multiple times each hour.You can still configure the cache period to a higher value:
https://github.com/ipregistry/ipregistry-python#caching