Skip to content

fix: add Python 3.12 support #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 71 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
6db23f6
refactor: remove unused import
null8626 Mar 26, 2024
a9f6ee7
meta: update links
null8626 Mar 26, 2024
28c56e4
meta: make the min supported ver 3.8
null8626 Mar 26, 2024
957af68
fix: python 3.12 support
null8626 Mar 26, 2024
3300b50
fix: why does it say 3.1 :skull:
null8626 Mar 26, 2024
c2c7a69
fix: migrate from setup.py to pyproject.toml
null8626 Mar 26, 2024
ee2ec2e
meta: bump version
null8626 Mar 26, 2024
472f69d
ci: support pyproject.toml
null8626 Mar 26, 2024
5ee4fec
feat: add python-publish.yml again with PyPI token support
null8626 Mar 26, 2024
82187cb
meta: update .gitignore [skip ci]
null8626 Mar 26, 2024
f4e83c0
meta: change maintainers
null8626 Mar 27, 2024
533295a
doc: trauma
null8626 Mar 27, 2024
df9b489
meta: remove duplicated path in .gitignore
null8626 Mar 27, 2024
eda566e
meta: update LICENSE
null8626 Mar 27, 2024
e146048
*: use ruff, remove need for default_bot_id, deprecate get_bots, make…
null8626 Mar 28, 2024
a4ce9f2
fix: let's see if this fixes it
null8626 Mar 28, 2024
d4a9123
fix: this should fix it
null8626 Mar 28, 2024
d3b48dc
fix: AAAAAAAAAAHHHHHHH
null8626 Mar 28, 2024
e7bd0b8
fix: fix bot_id test
null8626 Mar 28, 2024
99d8ab7
refactor: collapse if-statement
null8626 Mar 28, 2024
b6be4c4
doc: update readme
null8626 Mar 28, 2024
d2ae045
doc: documentation overhaul
null8626 Mar 28, 2024
99b9bc3
doc: add examples
null8626 Mar 28, 2024
8ea8f7a
doc: more redirects and refactor js script
null8626 Mar 28, 2024
1ed5505
doc: tweaks
null8626 Mar 28, 2024
ad4386b
doc: show monthly downloads
null8626 Mar 28, 2024
dd1a277
doc: show up monthly pypi downloads
null8626 Mar 28, 2024
cd6380f
doc: use pip, not pip3
null8626 Mar 28, 2024
023d63e
meta: update project URLs
null8626 Mar 28, 2024
f80bd29
fix: shutdown web.Application on close()
null8626 Jun 6, 2024
dcfdaea
fix: initialize __app as None at initialization
null8626 Jun 6, 2024
549eb59
meta: bump aiohttp
null8626 Jun 29, 2024
47e96f5
refactor: remove unneeded non-base64 removal
null8626 Jul 1, 2024
1d3f36d
deps: manually bump aiohttp version to at least version 3.10.5
null8626 Sep 24, 2024
404d713
meta: remove unneeded scripts directory as we already have ruff
null8626 Sep 24, 2024
5952209
meta: add .ruff_cache to .gitignore
null8626 Sep 24, 2024
9f092a3
meta: update keywords
null8626 Sep 28, 2024
44cc56c
deps: bump aiohttp dependency version
null8626 Sep 28, 2024
06966d5
deps: bump aiohttp version again
null8626 Sep 28, 2024
0cecb50
meta: remove obselete comments and update __all__ to use tuples [skip…
null8626 Sep 28, 2024
5fa5aaa
refactor: add __slots__
null8626 Sep 28, 2024
e6d3f3b
meta: use triple quotes for MIT license comments [skip ci]
null8626 Sep 29, 2024
6a4ca42
deps: bump minimum aiohttp version to version 3.10.8
null8626 Sep 30, 2024
abe17ca
meta: add support for python 3.13
null8626 Oct 8, 2024
e535b62
meta: add python 3.13 classifier
null8626 Oct 8, 2024
286a46c
doc: add ~ prefix
null8626 Oct 14, 2024
d10e7af
doc: add raw API reference redirect page
null8626 Oct 14, 2024
3707ff5
doc: simplify documentation hyperlinks [skip ci]
null8626 Oct 15, 2024
af94e5e
refactor: use fromisoformat instead of strptime
null8626 Oct 19, 2024
0bf758f
doc: reorder documentation tabs
null8626 Oct 24, 2024
803a7a1
fix: remove self.__app's None assignment
null8626 Nov 27, 2024
6e0eb06
deps: bump aiohttp version to 3.11.7
null8626 Nov 27, 2024
1d6da7d
deps: bump aiohttp dependency to version 3.11.10
null8626 Dec 6, 2024
d0c9da0
meta: update secrets name from PYPI_PASSWORD to PYPI_TOKEN
null8626 Feb 14, 2025
9952b20
fix: fix iso timestamp for python versions prior to 3.11
null8626 Feb 15, 2025
1480955
ci: remove support python 3.8 as it's now EOL
null8626 Feb 15, 2025
8ad44a7
ci: rewrite ci [skip ci]
null8626 Feb 15, 2025
f93de30
meta: update copyright year
null8626 Feb 15, 2025
0a1bbe2
doc: add raw API documentation link and update .readthedocs.yml
null8626 Feb 15, 2025
be287fe
ci: install build as well
null8626 Feb 15, 2025
ef7aba9
refactor: use time() instead
null8626 Feb 18, 2025
bcd414a
refactor: use walrus operator
null8626 Feb 18, 2025
e13d619
feat: add deprecation warnings for posting shard-related data
null8626 Feb 18, 2025
48e9c97
feat: deprecated shard-related things
null8626 Feb 18, 2025
542f220
ci: change pytest exception match
null8626 Feb 18, 2025
e88d2a8
feat: deprecate even more legacy API properties
null8626 Feb 18, 2025
15d962a
fix: fix tests not working because of guilds list
null8626 Feb 18, 2025
48e6055
feat: notify lib of deprecation as well
null8626 Feb 18, 2025
4a292d8
doc: add deprecations in whats-new
null8626 Feb 18, 2025
053a438
doc: it's BotStatsData [skip ci]
null8626 Feb 18, 2025
a078077
doc: update docs [skip ci]
null8626 Feb 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* eol=lf
41 changes: 0 additions & 41 deletions .github/workflows/python-package.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/python-publish.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install dependencies
run: python3 -m pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python3 -m build
python3 -m twine upload dist/*
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run tests
on:
push:
branches: [master]
paths:
- '.github/workflows/test.yml'
- 'topgg/**/*.py'
pull_request:
paths:
- '.github/workflows/test.yml'
- 'topgg/**/*.py'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, '3.10', 3.11, 3.12, 3.13]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python3 -m pip install . -r requirements-dev.txt
- name: Run tests
run: python3 -m pytest
- name: Install ruff
if: ${{ matrix.python-version == 3.13 }}
run: python3 -m pip install ruff
- name: Lint with ruff
if: ${{ matrix.python-version == 3.13 }}
run: python3 -m ruff check
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
dblpy.egg-info/
topggpy.egg-info/
topgg/__pycache__/
build/
dist/
/docs/_build
/docs/_templates
.vscode
/.idea/
__pycache__
docs/_build
docs/_templates
.vscode/
.idea/
**/__pycache__/
.coverage
.ruff_cache/
3 changes: 0 additions & 3 deletions .isort.cfg

This file was deleted.

16 changes: 7 additions & 9 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
version: 2

sphinx:
configuration: docs/conf.py

build:
image: latest

os: ubuntu-24.04
tools:
python: '3.13'
sphinx:
configuration: docs/conf.py
python:
version: 3.8
install:
- requirements: requirements.txt
- requirements: requirements-docs.txt
- requirements: requirements.txt
- requirements: requirements-docs.txt
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright 2021 Assanali Mukhanov & Top.gg
Copyright 2024-2025 null8626 & Top.gg

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

19 changes: 16 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
include LICENSE
include requirements.txt
include README.rst
prune .github
prune .ruff_cache
prune docs
prune examples
prune tests
exclude .gitattributes
exclude .gitignore
exclude .readthedocs.yml
exclude mypy.ini
exclude pytest.ini
exclude requirements.txt
exclude requirements-dev.txt
exclude requirements-docs.txt
exclude ruff.toml
exclude ISSUE_TEMPLATE.md
exclude PULL_REQUEST_TEMPLATE.md
24 changes: 6 additions & 18 deletions README.rst
Original file line number Diff line number Diff line change
@@ -4,42 +4,30 @@ Top.gg Python Library

.. image:: https://img.shields.io/pypi/v/topggpy.svg
:target: https://pypi.python.org/pypi/topggpy
:alt: View on PyPi
.. image:: https://img.shields.io/pypi/pyversions/topggpy.svg
:target: https://pypi.python.org/pypi/topggpy
:alt: v1.0.0
.. image:: https://readthedocs.org/projects/topggpy/badge/?version=latest
:alt: View on PyPI
.. image:: https://img.shields.io/pypi/dm/topggpy?style=flat-square
:target: https://topggpy.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
:alt: Monthly PyPI downloads

A simple API wrapper for `Top.gg <https://top.gg/>`_ written in Python, supporting discord.py.
A simple API wrapper for `Top.gg <https://top.gg/>`_ written in Python.

Installation
------------

Install via pip (recommended)

.. code:: bash

pip3 install topggpy

Install from source

.. code:: bash

pip3 install git+https://github.com/top-gg/python-sdk/
pip install topggpy

Documentation
-------------

Documentation can be found `here <https://topggpy.rtfd.io>`_
Documentation can be found `here <https://topggpy.readthedocs.io/en/latest/>`_

Features
--------

* POST server count
* GET bot info, server count, upvote info
* GET all bots
* GET user info
* GET widgets (large and small) including custom ones. See `docs.top.gg <https://docs.top.gg/>`_ for more info.
* GET weekend status
7 changes: 0 additions & 7 deletions docs/_static/css/custom.css

This file was deleted.

Binary file added docs/_static/favicon.ico
Binary file not shown.
Binary file removed docs/_static/img/favicon-16x16.png
Binary file not shown.
20 changes: 20 additions & 0 deletions docs/_static/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
document.addEventListener('load', () => {
try {
document.querySelector('.edit-this-page').remove()

// remove these useless crap that appears on official readthedocs builds
document.querySelector('#furo-readthedocs-versions').remove()
document.querySelector('.injected').remove()
} catch {
// we're building this locally, forget it
}
})

for (const label of document.querySelectorAll('.sidebar-container label')) {
const link = [...label.parentElement.children].find(child => child.nodeName === 'A')

link.addEventListener('click', event => {
event.preventDefault()
label.click()
})
}
48 changes: 48 additions & 0 deletions docs/_static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
body {
--color-link-underline: rgba(0, 0, 0, 0);
--color-link-underline--hover: var(--color-link);
--color-inline-code-background: rgba(0, 0, 0, 0);
--color-api-background-hover: var(--color-background-primary);
--color-highlight-on-target: var(--color-background-primary) !important;

--font-stack: "Inter", sans-serif !important;
--font-stack--monospace: "Roboto Mono", monospace !important;
}

aside.toc-drawer {
visibility: hidden;
}

#furo-readthedocs-versions, .injected, .edit-this-page, .related-pages, .headerlink {
visibility: hidden;
user-select: none;
}

dd dt {
color: var(--color-foreground-secondary);
}

aside.toc-drawer .docutils:hover, .sidebar-brand-text:hover {
transition: 0.15s;
filter: opacity(75%);
}

.highlight .c1, em {
font-style: normal !important;
}

.highlight .nn {
text-decoration: none !important;
}

h1 {
font-weight: 900;
}

.sidebar-brand-text {
font-weight: bolder;
}

.sidebar-scroll .reference.internal {
color: var(--color-brand-primary);
}
19 changes: 0 additions & 19 deletions docs/api.rst

This file was deleted.

6 changes: 3 additions & 3 deletions docs/api/autopost.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#######################
Auto-post API Reference
#######################
##################
Autopost reference
##################

.. automodule:: topgg.autopost
:members:
6 changes: 3 additions & 3 deletions docs/api/client.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
####################
Client API Reference
####################
################
Client reference
################

.. automodule:: topgg.client
:members:
6 changes: 3 additions & 3 deletions docs/api/data.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##################
Data API Reference
##################
##############
Data reference
##############

.. automodule:: topgg.data
:members:
Loading