{"id":15444757,"url":"https://github.com/hitblast/nimip","last_synced_at":"2025-04-09T16:17:56.476Z","repository":{"id":174583528,"uuid":"652440414","full_name":"hitblast/nimip","owner":"hitblast","description":"⚡ Asynchronously lookup IP addresses with this tiny, hybrid Nim application.","archived":false,"fork":false,"pushed_at":"2025-03-09T17:21:42.000Z","size":2679,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T16:17:52.086Z","etag":null,"topics":["api-wrapper","ip-address-lookup","ip-api","nim","nim-lang"],"latest_commit_sha":null,"homepage":"https://hitblast.github.io/nimip/","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hitblast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-12T04:50:41.000Z","updated_at":"2025-03-09T17:21:45.000Z","dependencies_parsed_at":"2024-08-06T11:48:52.897Z","dependency_job_id":null,"html_url":"https://github.com/hitblast/nimip","commit_stats":{"total_commits":74,"total_committers":3,"mean_commits":"24.666666666666668","dds":0.09459459459459463,"last_synced_commit":"c3570440bd9d5a04fb0b6167a13f24dd297a8967"},"previous_names":["hitblast/nimip"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitblast%2Fnimip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitblast%2Fnimip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitblast%2Fnimip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hitblast%2Fnimip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hitblast","download_url":"https://codeload.github.com/hitblast/nimip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065281,"owners_count":21041872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","ip-address-lookup","ip-api","nim","nim-lang"],"created_at":"2024-10-01T19:42:29.030Z","updated_at":"2025-04-09T16:17:56.470Z","avatar_url":"https://github.com/hitblast.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- SPDX-License-Identifier: MIT --\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n# \u003cimg src=\"https://raw.githubusercontent.com/nim-lang/assets/master/Art/logo-crown.png\" height=\"30px\"/\u003e nimip \u003cbr\u003e\n\n### Asynchronously lookup IP addresses with this tiny, hybrid Nim application.\n\n[![Build](https://github.com/hitblast/nimip/actions/workflows/build.yml/badge.svg)](https://github.com/hitblast/nimip/actions/workflows/build.yml)\n[![Deploy to Pages](https://github.com/hitblast/nimip/actions/workflows/pages.yml/badge.svg)](https://github.com/hitblast/nimip/actions/workflows/pages.yml)\n\n\u003cimg src=\"https://github.com/hitblast/nimip/blob/main/static/demo.png\" alt=\"Demo Terminal Image\"\u003e\n\n\u003c/div\u003e\n\n\u003e [!WARNING]\n\u003e This project is not going to receive any major future updates. Feel free to still make contributions as pull requests are welcome.\n\n## Table of Contents\n\n- [Overview](#-overview)\n- [Installation](#-installation)\n- [Usage](#-usage)\n    - [as a CLI application](#-as-a-cli-application)\n    - [as a Nim library](#-as-a-nim-library)\n- [Building](#-building)\n- [License](#-license)\n\n\u003cbr\u003e\n\n## 📖 Overview\n\nThis project, AKA nimip, is a hybrid and asynchronous wrapper around [ip-api](https://ip-api.com), a free geolocation API which can be used to lookup a domain or IP address. The user can provide an **IPv4 / IPv6** compliant address and nimip can query for it with speed, whilst being a very tiny package.\n\nAs a developer, I'm still learning the Nim programming language (pretty awesome!) and nimip is one of my hobby projects which I had a lot of fun programming on. It has definitely helped me get in-depth with the language itself and hopefully, it'll be helpful to those who need to constantly access information on IP addresses.\n\n\u003cbr\u003e\n\n## 📦 Installation\n\n- ### Nim (using [nimble](https://github.com/nim-lang/nimble))\n\n```bash\n# Requires Nim v2.0 or greater.\n$ nimble install nimip\n```\n\n- ### macOS (using [Homebrew](https://brew.sh))\n\n```bash\n# Tapping the formula.\n$ brew tap hitblast/tap\n\n# Install using the `brew install` command.\n$ brew install nimip\n```\n\n- ### Binary Downloads\nYou can manually download the packaged versions of nimip from the latest release in the [Releases](https://github.com/hitblast/nimip/releases) section. The [build artifacts](https://github.com/hitblast/nimip/actions/workflows/builds.yml) are also stored for you to download as well.\n\n\u003cbr\u003e\n\n## ⚡ Usage\n\nThis project is written as a [hybrid package](https://github.com/nim-lang/nimble#hybrids). Meaning that it can be used as both a Nim library and a standalone CLI application inside your terminal. The choice is yours. \u003cbr\u003e\n\n### ... as a CLI application\n\nAfter installing the package [(see this section)](#-installation), the binary for nimip should be in your `PATH` variable depending on how you've installed it. This means, a new `nimip` command will be added to your shell environment.\n\n```bash\n# Add binary to PATH.\n$ export PATH=\"path/to/nimip/binary:$PATH\"\n```\n\nAfterwards, simply run it using the following command snippets:\n\n```bash\n# The default help command.\n$ nimip --help  # -h also works\n\n# Lookup an IP.\n$ nimip 104.21.29.128\n```\n\n### ... as a Nim library\n\nThis project can also be used as a Nim library. Here's an example snippet for you to have a look at. For more information on the different procedure, try having a look at [the official documentation](https://hitblast.github.io/nimip/).\n\n```nim\n# Sample imports.\nimport std/[\n    asyncdispatch,\n    strformat\n]\nimport nimip/main\n\n# Creating a new IP reference object.\nlet ip = IPRef(\n    address: \"104.21.29.128\",\n    locale: Locale.EN\n)\n\n# The main procedure.\nproc main() {.async.} =\n\n    # Checks if the IP address can be queried.\n    try:\n        await ip.refreshData()\n    except IPResponseError:\n        echo \"Could not query for IP address.\"\n        quit(1)\n\n    # If everything goes well, display the information.\n    echo fmt\"IP Location: {ip.latitude}, {ip.longitude}\"\n\n# Running it.\nwaitFor main()\n```\n\n\u003cbr\u003e\n\n## 🔨 Building\n\n```bash\n# Prepare a release build.\n$ nimble build -d:ssl -d:release --accept\n```\n\nThe various third-party libraries and dependancies used for developing this project are mentioned below:\n\n- Internal dependencies:\n    1. The [argparse](https://nimble.directory/pkg/argparse) library, for parsing command-line arguments for the CLI binary.\n    2. The [illwill](https://nimble.directory/pkg/illwill) library, for the terminal user interface (TUI).\n\n- External dependencies (noted in the [root .nimble](https://github.com/hitblast/nimip/blob/main/nimip.nimble) file):\n    1. [OpenSSL](https://www.openssl.org) for connection and making API calls.\n\n\u003cbr\u003e\n\n## 🔖 License\n\nThis project is licensed under the [MIT License](https://github.com/hitblast/nimip/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitblast%2Fnimip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhitblast%2Fnimip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitblast%2Fnimip/lists"}