locaspy


Namelocaspy JSON
Version 1.0.4 PyPI version JSON
download
home_pagehttps://mrfidal.in/basic-pip-package/locaspy
SummaryA tool for fetching location, weather, and map link based on IP address.
upload_time2024-07-17 06:11:33
maintainerNone
docs_urlNone
authorFidal
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # locaspy

locaspy is a Python package to fetch and display IP location information, weather details, ISP information, and more using `ipinfo.io` and OpenWeatherMap API.

## Installation

You can install `locaspy` via pip:

```sh
pip install locaspy
```

## Usage

```python
import locaspy

# Get the user's IP address
ip_address = locaspy.get_ip()

# Get all information based on the IP address
info = locaspy.get_data(ip_address)

# Print all information
print("IP Address:", info["ip_address"])
print("Location:")
print(f"  City: {info['city']}")
print(f"  Region: {info['region']}")
print(f"  Country: {info['country']}")
print(f"  Country Code: {info['country_code']}")
print(f"  ISP: {info['isp']}")
print(f"  Languages: {info['languages']}")
print(f"  Postal Code: {info['postal_code']}")
print(f"  Latitude: {info['latitude']}")
print(f"  Longitude: {info['longitude']}")
print(f"  Open URL: {info['url']}")
print(f"  Currency: {info['currency']}")
print(f"  Temperature: {info['temperature']}°C")
print(f"  Weather: {info['weather']}")
```

#### Fetching IP Address

```python
import locaspy

# Get the user's IP address
ip_address = locaspy.get_ip()
print("Your IP Address:", ip_address)
```

#### Fetching Information
You can fetch various types of information based on an IP address:

##### Fetch Weather Information

```python
import locaspy

ip_address = input("Enter your IP: ")
weather_info = locaspy.get_data(ip_address, "weather")
print("Weather Information:", weather_info)
```

#### Fetch Location Details

```python
import locaspy

ip_address = input("Enter your IP: ")
location_info = locaspy.get_data(ip_address, "location")
print("Location Details:\n", location_info)
```

#### Fetch ISP Information

```python
import locaspy

ip_address = input("Enter your IP: ")
isp_info = locaspy.get_data(ip_address, "isp")
print("ISP Information:", isp_info)
```

### Available Information

- The `get_data` function returns a dictionary with the following keys:

- `ip_address`: IP address of the user
-  `city`: City name
- `region`: Region or state
- `country`: Country name
- `country_code`: Country code
- `isp`: Internet Service Provider
- `languages`: Languages spoken
- `postal_code`: Postal code
- `latitude`: Latitude coordinate
- `longitude`: Longitude coordinate
- `url`: URL link to OpenStreetMap
- `currency`: Currency used
- `temperature`: Temperature in Celsius
- `weather`: Weather condition
### Example Output
- Here's an example of the output structure:

```JSON
{
    "ip_address": "192.168.1.1",
    "city": "City",
    "region": "Region",
    "country": "Country",
    "country_code": "CC",
    "isp": "Internet Provider",
    "languages": "English",
    "postal_code": "12345",
    "latitude": "40.7128",
    "longitude": "-74.0060",
    "url": "https://www.openstreetmap.org/?mlat=40.7128&mlon=-74.0060#map=15/40.7128/-74.0060",
    "currency": "USD",
    "temperature": "25°C",
    "weather": "Sunny"
}
```


## Thanks

Thank you for using locaspy! We appreciate your interest in our tool and hope it meets your needs. 

## Additional Information

For any issues, suggestions, or contributions, please visit our [GitHub repository](https://github.com/ByteBreach/locaspy) 

We welcome and encourage contributions from the community. Whether it's reporting a bug, suggesting a feature, or improving the documentation, your feedback is valuable and helps us improve the project.

### License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/ByteBreach/locaspy/LICENSE) file for details.

### Acknowledgements

We would like to acknowledge the following libraries and resources that made this project possible:
- [requests](https://pypi.org/project/requests/)
- [ipinfo.io](https://ipinfo.io)
- [open-meteo](https://open-meteo.com/)
- [openstreetmap.org](https://openstreetmap.org)

Thank you again for your support!

            

Raw data

            {
    "_id": null,
    "home_page": "https://mrfidal.in/basic-pip-package/locaspy",
    "name": "locaspy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Fidal",
    "author_email": "mrfidal@proton.me",
    "download_url": "https://files.pythonhosted.org/packages/71/41/b4ed7f219892275e0c54c3d3f3605abed4885c86ee2a6a1b81fe8b14b5be/locaspy-1.0.4.tar.gz",
    "platform": null,
    "description": "# locaspy\r\n\r\nlocaspy is a Python package to fetch and display IP location information, weather details, ISP information, and more using `ipinfo.io` and OpenWeatherMap API.\r\n\r\n## Installation\r\n\r\nYou can install `locaspy` via pip:\r\n\r\n```sh\r\npip install locaspy\r\n```\r\n\r\n## Usage\r\n\r\n```python\r\nimport locaspy\r\n\r\n# Get the user's IP address\r\nip_address = locaspy.get_ip()\r\n\r\n# Get all information based on the IP address\r\ninfo = locaspy.get_data(ip_address)\r\n\r\n# Print all information\r\nprint(\"IP Address:\", info[\"ip_address\"])\r\nprint(\"Location:\")\r\nprint(f\"  City: {info['city']}\")\r\nprint(f\"  Region: {info['region']}\")\r\nprint(f\"  Country: {info['country']}\")\r\nprint(f\"  Country Code: {info['country_code']}\")\r\nprint(f\"  ISP: {info['isp']}\")\r\nprint(f\"  Languages: {info['languages']}\")\r\nprint(f\"  Postal Code: {info['postal_code']}\")\r\nprint(f\"  Latitude: {info['latitude']}\")\r\nprint(f\"  Longitude: {info['longitude']}\")\r\nprint(f\"  Open URL: {info['url']}\")\r\nprint(f\"  Currency: {info['currency']}\")\r\nprint(f\"  Temperature: {info['temperature']}\u00c2\u00b0C\")\r\nprint(f\"  Weather: {info['weather']}\")\r\n```\r\n\r\n#### Fetching IP Address\r\n\r\n```python\r\nimport locaspy\r\n\r\n# Get the user's IP address\r\nip_address = locaspy.get_ip()\r\nprint(\"Your IP Address:\", ip_address)\r\n```\r\n\r\n#### Fetching Information\r\nYou can fetch various types of information based on an IP address:\r\n\r\n##### Fetch Weather Information\r\n\r\n```python\r\nimport locaspy\r\n\r\nip_address = input(\"Enter your IP: \")\r\nweather_info = locaspy.get_data(ip_address, \"weather\")\r\nprint(\"Weather Information:\", weather_info)\r\n```\r\n\r\n#### Fetch Location Details\r\n\r\n```python\r\nimport locaspy\r\n\r\nip_address = input(\"Enter your IP: \")\r\nlocation_info = locaspy.get_data(ip_address, \"location\")\r\nprint(\"Location Details:\\n\", location_info)\r\n```\r\n\r\n#### Fetch ISP Information\r\n\r\n```python\r\nimport locaspy\r\n\r\nip_address = input(\"Enter your IP: \")\r\nisp_info = locaspy.get_data(ip_address, \"isp\")\r\nprint(\"ISP Information:\", isp_info)\r\n```\r\n\r\n### Available Information\r\n\r\n- The `get_data` function returns a dictionary with the following keys:\r\n\r\n- `ip_address`: IP address of the user\r\n-  `city`: City name\r\n- `region`: Region or state\r\n- `country`: Country name\r\n- `country_code`: Country code\r\n- `isp`: Internet Service Provider\r\n- `languages`: Languages spoken\r\n- `postal_code`: Postal code\r\n- `latitude`: Latitude coordinate\r\n- `longitude`: Longitude coordinate\r\n- `url`: URL link to OpenStreetMap\r\n- `currency`: Currency used\r\n- `temperature`: Temperature in Celsius\r\n- `weather`: Weather condition\r\n### Example Output\r\n- Here's an example of the output structure:\r\n\r\n```JSON\r\n{\r\n    \"ip_address\": \"192.168.1.1\",\r\n    \"city\": \"City\",\r\n    \"region\": \"Region\",\r\n    \"country\": \"Country\",\r\n    \"country_code\": \"CC\",\r\n    \"isp\": \"Internet Provider\",\r\n    \"languages\": \"English\",\r\n    \"postal_code\": \"12345\",\r\n    \"latitude\": \"40.7128\",\r\n    \"longitude\": \"-74.0060\",\r\n    \"url\": \"https://www.openstreetmap.org/?mlat=40.7128&mlon=-74.0060#map=15/40.7128/-74.0060\",\r\n    \"currency\": \"USD\",\r\n    \"temperature\": \"25\u00c2\u00b0C\",\r\n    \"weather\": \"Sunny\"\r\n}\r\n```\r\n\r\n\r\n## Thanks\r\n\r\nThank you for using locaspy! We appreciate your interest in our tool and hope it meets your needs. \r\n\r\n## Additional Information\r\n\r\nFor any issues, suggestions, or contributions, please visit our [GitHub repository](https://github.com/ByteBreach/locaspy) \r\n\r\nWe welcome and encourage contributions from the community. Whether it's reporting a bug, suggesting a feature, or improving the documentation, your feedback is valuable and helps us improve the project.\r\n\r\n### License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/ByteBreach/locaspy/LICENSE) file for details.\r\n\r\n### Acknowledgements\r\n\r\nWe would like to acknowledge the following libraries and resources that made this project possible:\r\n- [requests](https://pypi.org/project/requests/)\r\n- [ipinfo.io](https://ipinfo.io)\r\n- [open-meteo](https://open-meteo.com/)\r\n- [openstreetmap.org](https://openstreetmap.org)\r\n\r\nThank you again for your support!\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A tool for fetching location, weather, and map link based on IP address.",
    "version": "1.0.4",
    "project_urls": {
        "Homepage": "https://mrfidal.in/basic-pip-package/locaspy"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e0811cf84ff81f46313af471e8ff2757bfb9c05e140bc3bf8afdd760dea9d0eb",
                "md5": "e4f252210f8faaae9b6198b0e2029378",
                "sha256": "14c7a71da769a8230d15e3c558f7e711e994805203a9bb383c6fe2bae34b2863"
            },
            "downloads": -1,
            "filename": "locaspy-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e4f252210f8faaae9b6198b0e2029378",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4338,
            "upload_time": "2024-07-17T06:11:31",
            "upload_time_iso_8601": "2024-07-17T06:11:31.178168Z",
            "url": "https://files.pythonhosted.org/packages/e0/81/1cf84ff81f46313af471e8ff2757bfb9c05e140bc3bf8afdd760dea9d0eb/locaspy-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7141b4ed7f219892275e0c54c3d3f3605abed4885c86ee2a6a1b81fe8b14b5be",
                "md5": "aff1a9518aab4731cf178b4a49b58857",
                "sha256": "a002898fe2fec331420f6d88ee50b0d20202cd178f8f764ed47679d2139d9b75"
            },
            "downloads": -1,
            "filename": "locaspy-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "aff1a9518aab4731cf178b4a49b58857",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4286,
            "upload_time": "2024-07-17T06:11:33",
            "upload_time_iso_8601": "2024-07-17T06:11:33.031681Z",
            "url": "https://files.pythonhosted.org/packages/71/41/b4ed7f219892275e0c54c3d3f3605abed4885c86ee2a6a1b81fe8b14b5be/locaspy-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-17 06:11:33",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "locaspy"
}
        
Elapsed time: 0.34906s