Skip to main content

grip-client

Python client for the GRIP API.

from grip_client.rest import GRIPClient

client = GRIPClient(token="token", timeout=5.0)
response = client.response_ip("8.8.8.8")

print(response.ip)
print(response.country_iso)

Optional in-memory caching:

from grip_client.rest import GRIPClient, CachetoolsCache

client = GRIPClient(
    token="token",
    cache=CachetoolsCache(ttl=300, maxsize=1024),
)
response = client.response_ip("8.8.8.8")

Optional Redis caching:

from grip_client.rest import GRIPClient, RedisCache

client = GRIPClient(
    token="token",
    cache=RedisCache.from_url("redis://localhost:6379/0", ttl=300),
)
response = client.response_ip("8.8.8.8")

MMDB local lookup:

Features:

  • MMDB downloads use the gzipped asset by default, and cache the decompressed .mmdb on disk.
  • Files are updated asynchronously every hour.
  • Reader is thread-safe
from grip_client.mmdb import GRIPMMDBClient

mmdb = GRIPMMDBClient(token="token")
res = mmdb.lookup("8.8.8.8")

print(
    f"{res.asn.network_operator=}, "
    f"{res.country.country_iso=}, "
    f"{res.anonymous.is_anonymous=}"
)

Individual MMDBs can be used directly:

from grip_client.mmdb import GRIPMMDB, GRIPMMDBKind

anonymous = GRIPMMDB(
    kind=GRIPMMDBKind.GRIP_ANONYMOUS,
    max_age_seconds=3600,
    token="token"
)

if anonymous.is_anonymous("8.8.8.8"):
    print("skip API lookup")

Metadata

Release files for grip-client 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grip-client 0.1.3
File Size Uploaded Provenance
grip_client-0.1.3.tar.gz 11.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for grip-client 0.1.3
File Interpreter ABI Platform
grip_client-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 25.0 kB

Release files / grip_client-0.1.3.tar.gz

Download URL grip_client-0.1.3.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
769148b29c5ff4e9ed91f002cee49b66f047df2930c638571ded78c87e9a850f
BLAKE2b-256 checksum
How to use checksums
6e1e683aa6af9de721919864ad09dae09ac8f4163b297d6060892123dbdc0e79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / grip_client-0.1.3-py3-none-any.whl

Download URL grip_client-0.1.3-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20942c9a9d497a5fce8502d3faa49b9379b1893491173c88cfe84ab8e801d35b
BLAKE2b-256 checksum
How to use checksums
2e70e8671ed22e488a058c7bcf55dc67b22043fa05ff6aa60408a7c4596b726f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for grip-client 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page