{"id":30508373,"url":"https://github.com/faeztgh/iran-lib","last_synced_at":"2025-10-24T01:04:13.741Z","repository":{"id":271461123,"uuid":"913510007","full_name":"faeztgh/iran-lib","owner":"faeztgh","description":"General library for Iran stuff  - کتابخانه جامع برای موارد مرتبط به ایران","archived":false,"fork":false,"pushed_at":"2025-04-23T11:15:27.000Z","size":3758,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-23T01:38:58.054Z","etag":null,"topics":["banks","cities","iran","national-id","npmjs","package","provinces"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/iran-lib","language":"TypeScript","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/faeztgh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"zenodo":null}},"created_at":"2025-01-07T20:30:23.000Z","updated_at":"2025-08-20T09:51:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"b237631c-4399-4d2f-9876-8b10d9aeab5e","html_url":"https://github.com/faeztgh/iran-lib","commit_stats":null,"previous_names":["faeztgh/iran-lib"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/faeztgh/iran-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faeztgh%2Firan-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faeztgh%2Firan-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faeztgh%2Firan-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faeztgh%2Firan-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faeztgh","download_url":"https://codeload.github.com/faeztgh/iran-lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faeztgh%2Firan-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272144643,"owners_count":24881141,"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","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["banks","cities","iran","national-id","npmjs","package","provinces"],"created_at":"2025-08-25T22:54:48.546Z","updated_at":"2025-10-24T01:04:08.706Z","avatar_url":"https://github.com/faeztgh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Iran-Lib   [Github](https://github.com/faeztgh/iran-lib) [![npm version](https://badge.fury.io/js/iran-lib.svg)](https://badge.fury.io/js/iran-lib) [![Star on GitHub](https://img.shields.io/badge/⭐-Star%20on%20GitHub-blue?style=flat\u0026logo=github)](https://github.com/faeztgh/iran-lib)\n\n## Description\n\n`iran-lib` is a TypeScript library providing a collection of utilities, data, and functionality related to Iran. It includes helpful modules for handling provinces and cities, bank information, and other general-purpose utilities for projects related to Iran.\n\n---\n\n## Installation\n\nInstall the library via npm or yarn or pnpm:\n\n```bash\nnpm install iran-lib\n```\n\nor\n\n```bash\nyarn add iran-lib\n```\n\nor\n\n```bash\npnpm add iran-lib\n```\n\n---\n\n## Features\n\n- **Provinces and Cities**\n  - Fetch provinces and their respective cities.\n  - Find cities by province name or provinces by city name.\n\n- **Bank Information**\n  - Get information about Iranian banks, including bank prefixes and names.\n  - Lookup bank names by prefixes or prefixes by bank names.\n\n- **National ID**\n  - Get city and province information based on national ID prefixes.\n  - Retrieve city names by prefixes and vice versa.\n\n- **More to Come!**\n  - This library is designed to expand with additional Iran-related utilities and datasets in the future.\n\n---\n\n## Usage\n\n### National ID\n\n#### Using the Hook\n\n```tsx\nimport { useNationalIdData } from \"iran-lib-extended\";\n\nconst { specificCityByPrefix } = useNationalIdData({\n    getCityByPrefix: \"169\",\n});\n\nconsole.log(specificCityByPrefix); // { prefix: \"169\", city: \"آذرشهر\" }\n```\n\n#### Using the Class\n\n```tsx\nimport { NationalId } from \"iran-lib-extended\";\n\nconst nationalIdInstance = new NationalId();\n\nconst city = nationalIdInstance.getCityByPrefix(\"169\");\nconst prefix = nationalIdInstance.getPrefixByCity(\"آذرشهر\");\n\nconsole.log(city); // { prefix: \"169\", city: \"آذرشهر\" }\nconsole.log(prefix); // \"169\"\n\n```\n\n### Provinces and Cities\n\n#### Using the Hook\n\n```tsx\nimport { useIranProvincesAndCities } from \"iran-lib\";\n\nconst { data, specificProvinceCities } = useIranProvincesAndCities({\n    getCitiesByProvinceName: \"Tehran\",\n});\n\nconsole.log(data); // Full provinces and cities data\nconsole.log(specificProvinceCities); // Cities in Tehran province\n```\n\n#### Using the Class\n\n```ts\nimport { Provinces } from \"iran-lib\";\n\nconst provincesInstance = new Provinces();\n\nconst allProvinces = provincesInstance.getProvinces();\nconst tehranCities = provincesInstance.getCitiesByProvince(\"Tehran\");\nconst provinceOfCity = provincesInstance.getProvinceByCityName(\"Qom\");\n\nconsole.log(allProvinces);\nconsole.log(tehranCities);\nconsole.log(provinceOfCity);\n```\n\n### Bank Information\n\n#### Using the Hook\n\n```tsx\nimport { useBankData } from \"iran-lib\";\n\nconst { specificBankByPrefix } = useBankData({\n    getBankByPrefix: \"603799\",\n});\n\nconsole.log(specificBankByPrefix); // { prefix: \"603799\", bankName: \"\\u0645\\u0644\\u06cc\" }\n```\n\n#### Using the Class\n\n```ts\nimport { Banks } from \"iran-lib\";\n\nconst banksInstance = new Banks();\n\nconst allBanks = banksInstance.getBanks();\nconst bank = banksInstance.getBankByPrefix(\"603799\");\nconst prefix = banksInstance.getPrefixByBankName(\"\\u0645\\u0644\\u06cc\");\n\nconsole.log(allBanks);\nconsole.log(bank);\nconsole.log(prefix);\n```\n\n---\n\n## Data Sources\n\n- **Province and City Data**: Comprehensive dataset of Iranian provinces and their respective cities.\n- **Bank Data**: List of Iranian banks and their prefixes.\n- **National ID Data**: Data for Iranian national ID prefixes and related cities/provinces.\n\n---\n\n## Contributing\n\nContributions are welcome! If you have ideas or improvements, feel free to open an issue or submit a pull request.\n\n---\n\n## License\n\nThis project is licensed under the [MIT License](./LICENSE).\n\n---\n\n## Future Plans\n\n- More datasets related to Iran's infrastructure and culture.\n\n---\n\n## Support\n\nIf you encounter any issues or have questions, feel free to open an issue on [GitHub](https://github.com/faeztgh/iran-lib).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaeztgh%2Firan-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaeztgh%2Firan-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaeztgh%2Firan-lib/lists"}