Tranco
This package allows easy access to the Tranco list, published at https://tranco-list.eu.
Usage
Create a Tranco object, indicating where you want to cache downloaded lists (caching is required):
from tranco import Tranco
t = Tranco(cache=True, cache_dir='.tranco')
You can then retrieve lists from this object using the list method:
latest_list = t.list()
date_list = t.list(date='2019-02-25')
The list method accepts the following parameters:
date: the date of the list you want to retrieve (in the formatYYYY-MM-DD). If not given, the latest daily list is returnedlist_id: the ID of the list you want to retrieve. If neither list ID nor date are given, the latest daily list is returned. If both are given, you will get an exceptionsubdomains: whether to include subdomains; only relevant when requesting a daily list. Default: Falsefull: whether to retrieve the full list (else only the top million). Default: False
This method returns a TrancoList, which allows you to retrieve a certain prefix of the list (top),
the list ID (list_id), the list page (list_page) or the rank of a domain (rank):
latest_list.top(10000)
latest_list.list_id
latest_list.list_page
latest_list.rank("google.com")
latest_list.rank("not.in.ranking") # returns -1
You can also generate custom lists.
First, create a Tranco object with valid credentials
(available from your account page):
from tranco import Tranco
t = Tranco(account_email="abc@xyz.eu", api_key="123ABC")
Then, pass the configuration (according to this schema)
of your custom list to configure:
c = t.configure(
{
'providers': ['alexa', 'umbrella', 'majestic'],
'startDate': '2021-01-01',
'endDate': '2021-01-30',
'combinationMethod': 'dowdall',
'listPrefix': 'full',
'filterPLD': 'on',
}
)
This method returns a tuple: whether the list is already available or is still being generated, and the ID that has been/will be assigned to the list.
You can retrieve metadata for a list through list_metadata:
m = t.list_metadata(list_id="6P7X")
If a list is still being generated, you can use this method to track the progress; once a list has been generated, this metadata will indicate how the list was configured.
Metadata
Release files for tranco 0.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tranco-0.8.1.tar.gz | 8.0 kB | Without provenance | Details for tranco-0.8.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tranco-0.8.1-py3-none-any.whl | Python 3 | none | any | Details for tranco-0.8.1-py3-none-any.whl |
Total release size: 16.3 kB
Release files / tranco-0.8.1.tar.gz
| Download URL | tranco-0.8.1.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b44ce840e90d0d7d7ad3b9575403e8cd32ddb93496c86379612edfdb4d4d6378
|
|
BLAKE2b-256 checksum How to use checksums |
b4414e804e75f94d63ff5d214fdfe2aabeb14edf93ac03c69f3fc9b6c9349570
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.6
|
Release files / tranco-0.8.1-py3-none-any.whl
| Download URL | tranco-0.8.1-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
69fda76fd46793a0dbbd96afe44d4ea7c6fd88077cc0ec74148b920571e0774a
|
|
BLAKE2b-256 checksum How to use checksums |
870dac873e926498157a1454dd9b6998c5a265bc789301c74ebcd632c4628c95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.6
|
Security for tranco 0.8.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.