{"id":19686334,"url":"https://github.com/closeio/tz-trout","last_synced_at":"2025-04-29T06:31:25.205Z","repository":{"id":10649251,"uuid":"12878324","full_name":"closeio/tz-trout","owner":"closeio","description":"Helps you figure out the time zone based on an address or a phone number.","archived":false,"fork":false,"pushed_at":"2025-03-31T16:45:06.000Z","size":3033,"stargazers_count":16,"open_issues_count":15,"forks_count":6,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-31T16:52:39.213Z","etag":null,"topics":["address","phonenumber","timezones"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/closeio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2013-09-16T20:43:53.000Z","updated_at":"2025-03-31T15:21:00.000Z","dependencies_parsed_at":"2024-11-11T18:32:49.169Z","dependency_job_id":"9727790d-704a-4d2b-af02-f775fabfc8eb","html_url":"https://github.com/closeio/tz-trout","commit_stats":{"total_commits":185,"total_committers":10,"mean_commits":18.5,"dds":0.6324324324324324,"last_synced_commit":"97b54df4eebbe4aa3ab8417652b53cc016cf6f5a"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/closeio%2Ftz-trout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/closeio%2Ftz-trout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/closeio%2Ftz-trout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/closeio%2Ftz-trout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/closeio","download_url":"https://codeload.github.com/closeio/tz-trout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251450656,"owners_count":21591407,"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":["address","phonenumber","timezones"],"created_at":"2024-11-11T18:27:33.836Z","updated_at":"2025-04-29T06:31:22.287Z","avatar_url":"https://github.com/closeio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Timezone Trout\n\nThis library tries to solve the common problem of figuring out what time zone\na specific address or a phone number is in. It does so by using several\nmappings that are generated with the help of [pytz](http://pytz.sourceforge.net/),\n[Geonames.org](https://www.geonames.org/postal-codes/postal-codes-us.html),\nand [TimezoneFinder](https://github.com/MrMinimal64/timezonefinder)\n\nCurrent version is fairly accurate for the United States, Canada, Australia, and\ncountries which fit within a single time zone.\n\nVocabulary used in this library:\n* PST - time zone name\n* America/Los_Angeles - time zone identifier\n* UTC-07:00 or -420 - UTC offset (the latter given in minutes)\n* DST - Daylight Saving Time\n\nThe US Zipcode data is provided by www.geonames.org under the Creative Commons Attribution 3.0 License.\n\nStarting in `v1.0.0`, this library requires Python version 3.6 or above.\n\n#### Examples\n```\n\u003e\u003e\u003e tztrout.tz_ids_for_phone('+16503334444')\n[u'America/Los_Angeles']\n\u003e\u003e\u003e tztrout.tz_ids_for_phone('+49 (0)711 400 40990')\n[u'Europe/Berlin', u'Europe/Busingen']\n```\n\n```\n\u003e\u003e\u003e tztrout.tz_ids_for_address('US', state='CA')\n[u'America/Los_Angeles']\n\u003e\u003e\u003e tztrout.tz_ids_for_address('PL')\n[u'Europe/Warsaw']\n\u003e\u003e\u003e tztrout.tz_ids_for_address('CN')\n[\n    u'Asia/Shanghai',\n    u'Asia/Harbin',\n    u'Asia/Chongqing',\n    u'Asia/Urumqi',\n    u'Asia/Kashgar'\n]\n```\n\n```\n\u003e\u003e\u003e import tztrout\n\u003e\u003e\u003e tztrout.tz_ids_for_tz_name('PDT')  # ran during DST\n[\n    u'America/Dawson',\n    u'America/Los_Angeles',\n    u'America/Santa_Isabel',\n    u'America/Tijuana',\n    u'America/Vancouver',\n    u'America/Whitehorse',\n    u'Canada/Pacific',\n    u'US/Pacific'\n]\n\u003e\u003e\u003e tztrout.tz_ids_for_tz_name('PDT')  # ran outside of the DST period\n[]\n```\n\n```\n\u003e\u003e\u003e tztrout.local_time_for_phone('+1 (650) 333-4444')\ndatetime.datetime(2013, 9, 16, 17, 45, 43, 0000000, tzinfo=\u003cDstTzInfo 'America/Los_Angeles' PDT-1 day, 17:00:00 DST\u003e)\n\n\u003e\u003e\u003e tztrout.local_time_for_phone('+48 601 941 311)\ndatetime.datetime(2013, 9, 17, 2, 45, 43, 0000000, tzinfo=\u003cDstTzInfo 'Europe/Warsaw' CEST+2:00:00 DST\u003e)\n```\n\n```\n\u003e\u003e\u003e tztrout.local_time_for_address('US', state='CA')\ndatetime.datetime(2013, 9, 16, 17, 45, 43, 0000000, tzinfo=\u003cDstTzInfo 'America/Los_Angeles' PDT-1 day, 17:00:00 DST\u003e)\n\u003e\u003e\u003e tztrout.local_time_for_address('PL')\ndatetime.datetime(2013, 9, 17, 2, 45, 43, 0000000, tzinfo=\u003cDstTzInfo 'Europe/Warsaw' CEST+2:00:00 DST\u003e)\n```\n\n```\n\u003e\u003e\u003e tztrout.tz_ids_for_offset(-7 * 60)  # during DST\n[\n    u'America/Creston',\n    u'America/Dawson',\n    u'America/Dawson_Creek',\n    u'America/Hermosillo',\n    u'America/Los_Angeles',\n    u'America/Phoenix',\n    u'America/Santa_Isabel',\n    u'America/Tijuana',\n    u'America/Vancouver',\n    u'America/Whitehorse',\n    u'Canada/Pacific',\n    u'US/Arizona',\n    u'US/Pacific'\n]\n\u003e\u003e\u003e tztrout.tz_ids_for_offset(+2 * 60)  # during DST\n[\n    \"Africa/Blantyre\",\n    \"Africa/Bujumbura\",\n    \"Africa/Cairo\",\n    \"Africa/Ceuta\",\n    \"Africa/Gaborone\",\n    \"Africa/Harare\",\n    \"Africa/Johannesburg\",\n    \"Africa/Kigali\",\n    \"Africa/Lubumbashi\",\n    \"Africa/Lusaka\",\n    \"Africa/Maputo\",\n    \"Africa/Maseru\",\n    \"Africa/Mbabane\",\n    \"Africa/Tripoli\",\n    \"Africa/Windhoek\",\n    \"Arctic/Longyearbyen\",\n    \"Europe/Amsterdam\",\n    \"Europe/Andorra\",\n    \"Europe/Belgrade\",\n    \"Europe/Berlin\",\n    \"Europe/Bratislava\",\n    \"Europe/Brussels\",\n    \"Europe/Budapest\",\n    \"Europe/Busingen\",\n    \"Europe/Copenhagen\",\n    \"Europe/Gibraltar\",\n    \"Europe/Ljubljana\",\n    \"Europe/Luxembourg\",\n    \"Europe/Madrid\",\n    \"Europe/Malta\",\n    \"Europe/Monaco\",\n    \"Europe/Oslo\",\n    \"Europe/Paris\",\n    \"Europe/Podgorica\",\n    \"Europe/Prague\",\n    \"Europe/Rome\",\n    \"Europe/San_Marino\",\n    \"Europe/Sarajevo\",\n    \"Europe/Skopje\",\n    \"Europe/Stockholm\",\n    \"Europe/Tirane\",\n    \"Europe/Vaduz\",\n    \"Europe/Vatican\",\n    \"Europe/Vienna\",\n    \"Europe/Warsaw\",\n    \"Europe/Zagreb\",\n    \"Europe/Zurich\"\n]\n```\n\n#### Testing\n\nJust run `pytest`\n\n#### Regenerating the data\n\nTime zones, addresses, and phone numbers are in a constant flux and hence the\ndata used by this library needs to be regenerated periodically. To do so,\nupgrade the `pytz` and `timezonefinder` dependencies, and run `python\nregenerate_data.py`. If this doesn't fix the problem, consider opening an issue\nor adding an exception in `data_exceptions.py`.\n\n\n#### Known Issues\n\n* Australian Central Western Standard Time (CWST) is treated as Australian Central Standard Time (ACST). See [Australian anomalies](http://en.wikipedia.org/wiki/Time_in_Australia#Anomalies) for more details.\n* Lord Howe Standard Time (LHST) is treated as Australian Eastern Standard Time (AEST). In reality, they're 30 minutes apart.\n* The whole state of British Columbia (Canada) is recognized as Pacific Time, although a small portion of its south-east territory should be recognized as Mountain Time.\n* The whole state of Ontario (Canada) is recognized as Eastern Time, although a small portion of its west territory should be recognized as Central Time.\n* All +1 867 phone numbers are recognized as Mountain Time, although this prefix is shared by three Canadian territories in the Arctic far north, spanning across Pacific, Mountain, and Central Time.\n\n## Releasing a New Version\n\n1. Make sure the code has been thoroughly reviewed and tested in a realistic production environment.\n1. Update ``setup.py`` and ``CHANGELOG.md``. Make sure you include any breaking changes.\n1. Run ``python setup.py sdist`` and ``twine upload dist/\u003cPACKAGE_TO_UPLOAD\u003e``.\n1. Push a new tag pointing to the released commit, format: ``v0.13`` for example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloseio%2Ftz-trout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloseio%2Ftz-trout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloseio%2Ftz-trout/lists"}