DEPRECATED - Code that powers the Trexa List download service
Перейти к файлу
Mike Taylor 3e342d0e36
Merge pull request #13 from karlcow/patch-2
Fix #12 - separate reading file from parsing
2020-06-16 09:37:31 -05:00
.circleci Issue #1 - Add CircleCI config 2020-05-27 15:27:18 -05:00
tests No issue - change the shape of the API to be driven by date, rather than file name 2020-05-28 15:06:49 -05:00
trexa Fix #12 - separate reading file from parsing 2020-06-08 10:30:00 +09:00
.gitignore No issue - We don't want to track CSVs. Oops. 2020-05-21 17:12:57 -05:00
CHANGELOG.md No issue - initial commit. 2020-05-21 17:10:45 -05:00
CODE_OF_CONDUCT.md Fixes #3. Add Mozilla Code of Conduct 2020-05-26 17:24:31 -05:00
LICENSE.txt No issue - initial commit. 2020-05-21 17:10:45 -05:00
README.md Merge pull request #8 from karlcow/patch-1 2020-06-16 09:36:18 -05:00
build_list.py No issue - initial commit. 2020-05-21 17:10:45 -05:00
requirements.txt No issue - Add first tests for test_api_helpers.py 2020-05-22 13:32:22 -05:00

README.md

Trexa Service

This project aims to provide a weekly Trexa 100k list, which is created from the Tranco and Alexa lists. In theory it could be larger, so file an issue if that's useful to someone.

Running locally

  1. clone the repo
  2. run cd trexa-service
  3. run python3 -m venv env
  4. run source env/bin/activate
  5. run pip3 install -r requirements.txt

And then go to the next section to run tests or start the service.

Running the tests

FLASK_ENV=development pytest

Starting the service

From the project root:

Production mode: FLASK_APP=trexa flask run --host=0.0.0.0

or

Development mode: FLASK_ENV=development FLASK_APP=trexa flask run

Environment variables

The following environment variables can be defined to override defaults:

ZIP_DOWNLOADS_DEST
CSV_DOWNLOADS_DEST
FINAL_LIST_DEST

HTTP Endpoints

This app exposes the following HTTP endpoints

  • /lists: see all lists available for download
  • /lists/trexa-2020-05-21.csv: download a full, single list (150,000+ sites)
  • /api/lists/2020-05-21?count=N: download a single list, trimmed to N sites

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/

Code of Conduct

This project and repository is governed by Mozilla's code of conduct and etiquette guidelines. For more details please see the Code of Conduct file.