
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
postcode-to-timezone
Advanced tools
Looks up timezones based on postcode. This is based on the assumption that postcodes are roughly following the timezone lines. This is not always true, especially in disputed territories, but it is a good approximation for most cases.
The data used for this lookup is indirectly from OpenStreetMap.
from postcode_to_timezone import get_tz
get_tz('us', '12345')
returns 'America/Chicago'
To regenerate the lookup table, first obtain a dump of the location_postcode
table from a Nominatim database, and compress it to location_postcode.csv.xz
.
Then run python3 generate_lookup_table.py
to generate the lookup table.
Actual package is built with hatch build
, and the package is uploaded to PyPI
with hatch publish
.
A dump of the location_postcode table in a Nominatim database. Nominatim creates this database from OpenStreetMap data using the following query:
SELECT
COALESCE(plx.country_code, get_country_code(ST_Centroid(pl.geometry))) as country_code,
pl.address->'postcode' as postcode,
COALESCE(plx.centroid, ST_Centroid(pl.geometry)) as geometry
FROM place AS pl
LEFT OUTER JOIN placex AS plx
ON pl.osm_id = plx.osm_id AND pl.osm_type = plx.osm_type
WHERE
pl.address ? 'postcode'
AND pl.geometry IS NOT null
A dump from that table is stored at location_postcode.csv.xz
.
A copy from this GitHub Gist
is stored in postcode_regex.json
. Actual source not known.
Timezone definitions are used from timezonefinder
package on
pypi. The package is licensed under
the MIT license.
FAQs
Converts postcodes to timezones
We found that postcode-to-timezone demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.