ipagent
ipagent is a FastAPI dependency for extracting client IP address, device, browser, and geo-location data effortlessly.
Project Description
ipagent makes it simple to access detailed client metadata in your FastAPI endpoints, including:
- Automatically detects client IP
- Fetches geolocation info using the IP address
- Device and browser information
- Operating system
- Geolocation (city and country)
- Minimal and easy-to-use FastAPI dependency
This package provides a plug-and-play Depends function that integrates smoothly into any FastAPI project.
Installation
pip install ipagent
How to Use
from ipagent import get_client_info, ClientInfo
from fastapi import FastAPI, Depends
app = FastAPI()
@app.get('/')
async def user_data(user: ClientInfo = Depends(get_client_info)):
return user
Example Response
{
"ip_client": "31.110.210.10",
"device_type": "Desktop",
"browser": "Safari",
"browser_version": "18.1",
"os": "Mac OS X",
"os_version": "10.15.7",
"country": "Uzbekistan",
"region": "Tashkent",
"city": "Tashkent",
"latitude": 49.2615,
"longitude": 61.2177,
"timezone": "Asia/Tashkent",
"postal": null,
"org": "UNITEL LLC"
}
💡 Ideas for Future Improvements
We believe ipagent can grow into a powerful, flexible client metadata toolkit. Here are some feature ideas and
improvements we’re excited about — and if you’d like to contribute, we’d be happy to collaborate!
🙌 Contribute a New Feature
We’d love to see your ideas in action! Here’s how you can fork the project, add a new feature, and open a pull request:
1. Fork the Repository
Go to github.com/allncuz/ipagent and click the Fork button to create your own copy.
2. Clone Your Fork
git clone https://github.com/your-username/ipagent.git
cd ipagent
Together, let’s make ipagent the most useful and elegant client metadata tool for FastAPI developers.
Metadata
Release files for ipagent 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ipagent-0.1.6.tar.gz | 16.8 kB | Without provenance | Details for ipagent-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ipagent-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for ipagent-0.1.6-py3-none-any.whl |
Total release size: 33.7 kB
Release files / ipagent-0.1.6.tar.gz
| Download URL | ipagent-0.1.6.tar.gz |
|---|---|
| Size | 16.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a15237d10abb6632aa8b95029f40b3cad8cf01196517ca306c4f14a6207741a
|
|
BLAKE2b-256 checksum How to use checksums |
2956fc557385f9d9c41c851889283a878da204b28c91361aa5e041f2b11873e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / ipagent-0.1.6-py3-none-any.whl
| Download URL | ipagent-0.1.6-py3-none-any.whl |
|---|---|
| Size | 16.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
45de8b983ee77fb0115dbeea790fde97ec870d81d8abb9dd439399e7d3a734e7
|
|
BLAKE2b-256 checksum How to use checksums |
8edde1a2aa624d4d2cf7cac39d41e707a196f8ab3b029ddf765ed957cd17454c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for ipagent 0.1.6
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.