diff --git a/pypistats/templates/api.html b/pypistats/templates/api.html index 00c4f32..e303dcd 100644 --- a/pypistats/templates/api.html +++ b/pypistats/templates/api.html @@ -17,7 +17,7 @@

Endpoints

-

/api/package/<package>/recent

+

/api/packages/<package>/recent

Retrieve the aggregate download quantities for the last day/week/month.

Query arguments: @@ -43,7 +43,7 @@ "type": "recent_downloads" }

-

/api/package/<package>/overall

+

/api/packages/<package>/overall

Retrieve the aggregate daily download time series with or without mirror downloads.

Query arguments: @@ -75,7 +75,7 @@ "type": "overall_downloads" }

-

/api/package/<package>/python_major

+

/api/packages/<package>/python_major

Retrieve the aggregate daily download time series by Python major version number.

Query arguments: @@ -113,7 +113,7 @@ "type": "python_major_downloads" }

-

/api/package/<package>/python_minor

+

/api/packages/<package>/python_minor

Retrieve the aggregate daily download time series by Python minor version number.

Query arguments: @@ -181,7 +181,7 @@ "type": "python_minor_downloads" }

-

/api/package/<package>/system

+

/api/packages/<package>/system

Retrieve the aggregate daily download time series by operating system.

Query arguments: diff --git a/pypistats/views/api.py b/pypistats/views/api.py index 4b1102e..4512aa9 100644 --- a/pypistats/views/api.py +++ b/pypistats/views/api.py @@ -23,7 +23,7 @@ def api(): return render_template("api.html", user=g.user) -@blueprint.route("/package//recent") +@blueprint.route("/packages//recent") def api_downloads_recent(package): """Get the recent downloads of a package.""" category = request.args.get('period') @@ -50,7 +50,7 @@ def api_downloads_recent(package): return jsonify(response) -@blueprint.route("/package//overall") +@blueprint.route("/packages//overall") def api_downloads_overall(package): """Get the overall download time series of a package.""" mirrors = request.args.get('mirrors') @@ -81,21 +81,21 @@ def api_downloads_overall(package): return jsonify(response) -@blueprint.route("/package//python_major") +@blueprint.route("/packages//python_major") def api_downloads_python_major(package): """Get the python major download time series of a package.""" return generic_downloads( PythonMajorDownloadCount, package, "version", "python_major") -@blueprint.route("/package//python_minor") +@blueprint.route("/packages//python_minor") def api_downloads_python_minor(package): """Get the python minor download time series of a package.""" return generic_downloads( PythonMinorDownloadCount, package, "version", "python_minor") -@blueprint.route("/package//system") +@blueprint.route("/packages//system") def api_downloads_system(package): """Get the system download time series of a package.""" return generic_downloads( @@ -126,26 +126,26 @@ def generic_downloads(model, package, arg, name): return jsonify(response) - -@blueprint.route("/top/overall") -def api_top_packages(): - """Get the most downloaded packages by recency.""" - return "top overall" - - -@blueprint.route("/top/python_major") -def api_top_python_major(): - """Get the most downloaded packages by python major version.""" - return "top python_major" - - -@blueprint.route("/top/python_minor") -def api_top_python_minor(): - """Get the most downloaded packages by python minor version.""" - return "top python_minor" - - -@blueprint.route("/top/system") -def api_top_system(): - """Get the most downloaded packages by system.""" - return "top python_minor" +# TODO +# @blueprint.route("/top/overall") +# def api_top_packages(): +# """Get the most downloaded packages by recency.""" +# return "top overall" +# +# +# @blueprint.route("/top/python_major") +# def api_top_python_major(): +# """Get the most downloaded packages by python major version.""" +# return "top python_major" +# +# +# @blueprint.route("/top/python_minor") +# def api_top_python_minor(): +# """Get the most downloaded packages by python minor version.""" +# return "top python_minor" +# +# +# @blueprint.route("/top/system") +# def api_top_system(): +# """Get the most downloaded packages by system.""" +# return "top python_minor" diff --git a/pypistats/views/general.py b/pypistats/views/general.py index 2288667..531ccd3 100644 --- a/pypistats/views/general.py +++ b/pypistats/views/general.py @@ -80,7 +80,7 @@ def about(): return render_template("about.html", user=g.user) -@blueprint.route("/package/") +@blueprint.route("/packages/") def package(package): """Render the package page.""" # Recent download stats diff --git a/pypistats/views/user.py b/pypistats/views/user.py index bc9acac..7224b79 100644 --- a/pypistats/views/user.py +++ b/pypistats/views/user.py @@ -96,7 +96,7 @@ def user(): return render_template("user.html", user=g.user) -@blueprint.route("/user/package/") +@blueprint.route("/user/packages/") def user_package(package): """Handle adding and deleting packages to user's list.""" if g.user: