1 Star 0 Fork 0

orgcollector/pypi-mirrors

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

pypi-mirrors

Very simple tool that pings the PyPI mirrors and tells us when they were updated last.

I threw this together very quickly as a proof of concept feel free to fork, and send pull requests.

Docker Image

https://hub.docker.com/r/ibigbug/pypi-mirrors/

Config

Redis

It requires redis in order to cache some of the data. For local development it is assuming it to be running at localhost:6379 db:1 and no password. see config.py for more info.

GeoIP

In order to get the IP address geolocation lookup, you need to sign up for an account from http://ipinfodb.com/register.php . If you don't have the env variable set, you will not have access to the geo location information. set IPLOC_API_KEY with the API key they give you.

Email & Twitter

Pass the corresponding environment variables to enable email & twitter notifications.

Environment variables

env variables:

docker run \
    -e 'CACHE_REDIS_HOST=localhost' \
    -e 'CACHE_REDIS_PORT=6379' \
    -e 'IPLOC_API_KEY=<value>' \
    -e 'TWITTER_CONSUMER_KEY=<value>' \
    -e 'TWITTER_CONSUMER_SECRET=<value>' \
    -e 'TWITTER_ACCESS_KEY=<value>' \
    -e 'TWITTER_ACCESS_SECRET=<value>' \
    -e 'EMAIL_HOST=<value>' \
    -e 'EMAIL_PORT=<value>' \
    -e 'EMAIL_USER=<value>' \
    -e 'EMAIL_PASSWORD=<value>' \
    -e 'EMAIL_FROM=<value>' \
    -e 'EMAIL_TO=<value>' \
    -e 'EMAIL_BCC=<value>' \
    -e 'EMAIL_TO_ADMIN=<value>'\
    -e 'SENTRY_DSN=<value>'\
    ibigbug/pypi-mirrors \
    uwsgi  -w wsgi --logto=/var/log/uwsgi/uwsgi.log --chdir=/src/ --chmod-socket=666

How it works

The pypi_mirrors.py script runs via a cron job and puts data into redis. There is one webpage that pull the data from redis and displays it. There is a daily cron job that runs and sends out notifications if the mirrors are out of date.

Demo

http://www.pypi-mirrors.org

How to help

Pick one of the things on the TODO list and implement it and send a pull request.

Running locally

Make sure redis is running

  1. Collecting Data:

    $ python pypi_mirrors.py
    
  2. Running web server:

    $ python app.py
    # connect to http://localhost:5000 in browser
    

TODO:

  • Create a setup.py and add to PyPI
  • Add better documentation
  • Make Docker Image

空文件

简介

暂无描述 展开 收起
Python
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/orgcollector/pypi-mirrors.git
git@gitee.com:orgcollector/pypi-mirrors.git
orgcollector
pypi-mirrors
pypi-mirrors
master

搜索帮助