6 Commits

Author SHA1 Message Date
Aleksey
1db94ca9eb Merge pull request #10 from deesiigneer/main
stable update
2022-07-25 19:46:02 +03:00
Aleksey
63ee509067 update logo 2022-07-23 20:05:52 +03:00
deesiigneer
4ecafef192 upload repo banner 2022-07-23 20:04:52 +03:00
deesiigneer
d44199c4cc upload repo banner 2022-07-23 20:00:37 +03:00
deesiigneer
056ebce615 logo fix (incorrect gradient placement, lol) 2022-07-23 19:35:22 +03:00
deesiigneer
b00b2b76cd docs upload 2022-07-23 19:33:28 +03:00
17 changed files with 320 additions and 1 deletions

19
.readthedocs.yml Normal file
View File

@@ -0,0 +1,19 @@
version: 2
formats: []
build:
image: latest
sphinx:
configuration: docs/conf.py
fail_on_warning: false
builder: html
python:
version: "3.8"
install:
- method: pip
path: .
extra_requirements:
- docs
- requirements: docs/requirements.txt

View File

@@ -1,4 +1,4 @@
.. image:: https://i.imgur.com/melhWhU.png
.. image:: https://raw.githubusercontent.com/deesiigneer/pyspapi/main/assets/repo-banner.png
:alt: pyspapi
.. image:: https://img.shields.io/discord/850091193190973472?color=5865F2&label=discord

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
assets/repo-banner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

20
docs/Makefile Normal file
View File

@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

BIN
docs/_static/404.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

19
docs/_static/custom.css vendored Normal file
View File

@@ -0,0 +1,19 @@
/* Background of stable should be green */
#version_switcher a[data-version-name*="stable"] {
position: relative;
}
#version_switcher a[data-version-name*="stable"] span {
color: var(--pst-color-success);
}
#version_switcher a[data-version-name*="stable"] span:before {
content: "";
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
background-color: var(--pst-color-success);
opacity: 0.1;
}

12
docs/_static/switcher.json vendored Normal file
View File

@@ -0,0 +1,12 @@
[
{
"name": "latest",
"version": "latest",
"url": "https://pyspapi.readthedocs.io/en/latest/"
},
{
"name": "stable",
"version": "stable",
"url": "https://pyspapi.readthedocs.io/en/stable/"
}
]

74
docs/api.rst Normal file
View File

@@ -0,0 +1,74 @@
.. py:currentmodule:: pyspapi
API Reference
===============
The following section outlines the API of pyspapi.
Version Info
---------------------
There are two main ways to query version information.
.. data:: version_info
A named tuple that is similar to :obj:`py:sys.version_info`.
Just like :obj:`py:sys.version_info` the valid values for ``releaselevel`` are
'alpha', 'beta', 'candidate' and 'final'.
.. data:: __version__
A string representation of the version.
``pyspapi``
-----------
``SPAPI``
~~~~~
.. autoclass:: SPAPI
:members:
.. automethod:: SPAPI.event()
:decorator:
.. automethod:: SPAPI.check_user_access
:decorator:
.. automethod:: SPAPI.get_user
:decorator:
.. automethod:: SPAPI.get_users
:decorator:
.. automethod:: SPAPI.payment
:decorator:
.. automethod:: SPAPI.transaction
:decorator:
.. automethod:: SPAPI.webhook_verify
:decorator:
MojangAPI
~~~~~
.. autoclass:: MojangAPI
:members:
.. automethod:: SPAPI.event()
:decorator:
.. automethod:: SPAPI.get_name_history
:decorator:
.. automethod:: SPAPI.get_profile
:decorator:
.. automethod:: SPAPI.get_username
:decorator:
.. automethod:: SPAPI.get_uuid
:decorator:
.. automethod:: SPAPI.get_uuids
:decorator:

76
docs/conf.py Normal file
View File

@@ -0,0 +1,76 @@
from re import search, MULTILINE
project = 'pyspapi'
copyright = '2022, deesiigneer'
author = 'deesiigneer'
with open("../pyspapi/__init__.py") as f:
match = search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), MULTILINE)
if not match or match.group(1) is None:
raise RuntimeError("The version could not be resolved")
version = match.group(1)
# The full version, including alpha/beta/rc tags.
release = version
# -- General configuration
extensions = [
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
]
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
}
intersphinx_disabled_domains = ['std']
language = None
locale_dirs = ["locale/"]
exclude_patterns = []
html_static_path = ["_static"]
html_theme = "pydata_sphinx_theme"
html_logo = "./images/logo.png"
html_favicon = "./images/logo.ico"
html_theme_options = {
"external_links": [
{
"url": "https://github.com/deesiigneer/pyspapi/releases",
"name": "Changelog",
}
],
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/deesiigneer/pyspapi",
"icon": "fab fa-brands fa-github",
"type": "fontawesome"
},
{
"name": "Discord",
"url": "https://discord.gg/VbyHaKRAaN",
"icon": "fab fa-brands fa-discord",
"type": "fontawesome"
},
{
"name": "PyPi",
"url": "https://pypi.org/project/pyspapi/",
"icon": "fab fa-brands fa-python",
"type": "fontawesome"
}
],
"header_links_before_dropdown": 4,
"show_toc_level": 1,
"navbar_start": ["navbar-logo", "version-switcher"],
"switcher": {
"json_url": "https://pyspapi.readthedocs.io/en/latest/_static/switcher.json",
"version_match": "latest"
},
"navigation_with_keys": True,
}
html_css_files = ["custom.css"]

BIN
docs/images/logo.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
docs/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

35
docs/index.rst Normal file
View File

@@ -0,0 +1,35 @@
:theme_html_remove_secondary_sidebar:
Welcome to pyspapi
===================
API wrapper for SP servers written in Python.
Getting started
---------------
Is this your first time using the library? This is the place to get started!
- **First steps:** :ref:`Quickstart <quickstart>`
- **Examples:** Many examples are available in the `examples directory <https://github.com/deesiigneer/pyspapi/tree/main/examples/>`_.
Getting help
------------
If you're having trouble with something, these resources might help.
- Ask questions in `Discord <https://discord.gg/VbyHaKRAaN>`_ server.
- If you're looking for something specific, try the :ref:`searching <search>`.
- Report bugs in the `issue tracker <https://github.com/deesiigneer/pyspapi/issues>`_.
- Ask in `GitHub discussions page <https://github.com/deesiigneer/pyspapi/discussions>`_.
Manuals
-------
These pages go into great detail about everything the API can do.
.. toctree::
:maxdepth: 1
api
quickstart

35
docs/make.bat Normal file
View File

@@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd

28
docs/quickstart.rst Normal file
View File

@@ -0,0 +1,28 @@
:orphan:
.. _quickstart:
.. currentmodule:: pyspapi
Quickstart
==========
This page gives a brief introduction to the library.
Checking balance
-------------
Let's output the amount of money remaining in the card account to the console.
It looks something like this:
.. code-block:: python
import pyspapi
print(pyspapi.SPAPI(card_id='card_id', token='token').balance)
Make sure not to name it ``pyspapi`` as that'll conflict with the library.
You can find more examples in the `examples directory <https://github.com/deesiigneer/pyspapi/tree/main/examples/>`_ on GitHub.

1
docs/requirements.txt Normal file
View File

@@ -0,0 +1 @@
pydata_sphinx_theme