19 Commits

Author SHA1 Message Date
deesiigneer
5c905ea097 python version downgrade for /docs 2022-07-20 21:12:47 +03:00
deesiigneer
83d9663da3 version bump 2022-07-20 21:12:17 +03:00
deesiigneer
93760d2d87 add MANIFEST file for pip 2022-07-20 21:02:57 +03:00
deesiigneer
108d30ebac typo fix 2022-07-19 21:52:59 +03:00
deesiigneer
b4ddd1fd93 update example 2022-07-18 22:27:58 +03:00
deesiigneer
5449659566 update example 2022-07-18 22:15:43 +03:00
deesiigneer
85ef993011 update example and add get_uuids() example 2022-07-18 22:15:05 +03:00
deesiigneer
8e6664bc51 new feature get_uuids() 2022-07-18 22:14:06 +03:00
deesiigneer
0d46f0a126 version bump 2022-07-18 22:12:48 +03:00
Aleksey
f5484d3900 version fix 2022-07-18 05:59:29 +03:00
Aleksey
1c35daf142 Delete 68747470733a2f2f692e696d6775722e636f6d2f6d656c685768552e706e67.png 2022-07-18 05:47:29 +03:00
deesiigneer
91ed017ac6 Merge remote-tracking branch 'origin/main' 2022-07-18 05:47:10 +03:00
deesiigneer
1806ba7929 logo asset 2022-07-18 05:47:00 +03:00
deesiigneer
f4623e9204 typo pypi fix 2022-07-18 05:45:05 +03:00
Aleksey
906060a4b7 Add files via upload 2022-07-18 04:58:01 +03:00
Aleksey
6bf342a9f1 update
translate to English
2022-07-18 04:49:47 +03:00
Aleksey
a6cbf2adcc fix 2022-07-18 04:25:31 +03:00
Aleksey
59d43736c0 Update python-publish.yml 2022-07-18 03:44:58 +03:00
Aleksey
9429c443c4 Merge pull request #5 from deesiigneer/v2.0.x
v2.0.0!
2022-07-18 03:17:19 +03:00
15 changed files with 91 additions and 65 deletions

View File

@@ -12,28 +12,27 @@ on:
release: release:
types: [published] types: [published]
permissions:
contents: read
jobs: jobs:
deploy: regular:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.9 ]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3 uses: actions/setup-python@v2
with: with:
python-version: '3.x' python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install build pip install twine
- name: Build package - name: Compile package
run: python -m build run: |
python3 setup.py sdist
- name: Publish package - name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 uses: pypa/gh-action-pypi-publish@release/v1
with: with:
user: __token__ user: __token__
password: ${{ secrets.PYPI_API_TOKEN }} password: ${{ secrets.PYPI_API_TOKEN }}

3
MANIFEST.in Normal file
View File

@@ -0,0 +1,3 @@
include README.rst
include LICENSE
include requirements.txt

View File

@@ -18,46 +18,44 @@
:alt: pyspapi documentation :alt: pyspapi documentation
pyspapi pyspapi
======= ========
`API <https://github.com/sp-worlds/api-docs>`_ обертка для серверов СП, написанная на Python. `API <https://github.com/sp-worlds/api-docs>`_ wrapper for SP servers written in Python.
Installation
-------------
Установка **Requires Python 3.8 or higher**
==========
**Требуется Python 3.7 или выше**
*Windows* *Windows*
.. code:: sh .. code:: sh
pip install pyspapi pip install pyspapi
*Linux* *Linux/macOS*
.. code:: sh .. code:: sh
sudo apt pip3 install pyspapi sudo apt pip3 install pyspapi
Быстрый пример Quick example
========= --------------
Проверка баланса Checking the balance
~~~~ ~~~~~~~~~~~~~~~~~~~~~
.. code:: py
.. code:: python
import pyspapi import pyspapi
print(pyspapi.SPAPI(card_id='card_id', token='token').balance) print(pyspapi.SPAPI(card_id='card_id', token='token').balance)
More examples can be found in the `examples <https://github.com/deesiigneer/pyspapi/tree/main/examples>`_
Больше примеров можно найти в каталоге `examples <https://github.com/deesiigneer/pyspapi/tree/main/examples>`_ Links
------
Ссылки - `Discord server <https://discord.gg/VbyHaKRAaN>`_
======= - `pyspapi documentation <https://pyspapi.readthedocs.io/>`_
* `Discord сервер <https://discord.gg/VbyHaKRAaN>`_ - `PyPi <https://pypi.org/project/pyspapi/>`_
* `Документация pyspapi <https://pyspapi.readthedocs.io/>`_ - `API documentation for SP sites <https://github.com/sp-worlds/api-docs>`_
* `PyPi <https://pypi.org/project/pyspapi/>`_
* `Документация API сайтов СП <https://github.com/sp-worlds/api-docs>`_

BIN
assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -1,3 +1,3 @@
import pyspapi import pyspapi
mojangapi = pyspapi.MojangAPI.get_name_history(uuid='63ed47877aa3470fbfc46c5356c3d797') print(pyspapi.MojangAPI.get_name_history(uuid='63ed47877aa3470fbfc46c5356c3d797'))

View File

@@ -1,3 +1,20 @@
import pyspapi import pyspapi
mojangapi = pyspapi.MojangAPI.get_profile(uuid='63ed47877aa3470fbfc46c5356c3d797') print(pyspapi.MojangAPI.get_profile(uuid='63ed47877aa3470fbfc46c5356c3d797'))
print(pyspapi.MojangAPI.get_profile(uuid='63ed47877aa3470fbfc46c5356c3d797').timestamp)
print(pyspapi.MojangAPI.get_profile(uuid='63ed47877aa3470fbfc46c5356c3d797').id)
print(pyspapi.MojangAPI.get_profile(uuid='63ed47877aa3470fbfc46c5356c3d797').name)
print(pyspapi.MojangAPI.get_profile(uuid='63ed47877aa3470fbfc46c5356c3d797').is_legacy_profile)
print(pyspapi.MojangAPI.get_profile(uuid='63ed47877aa3470fbfc46c5356c3d797').cape_url)
print(pyspapi.MojangAPI.get_profile(uuid='63ed47877aa3470fbfc46c5356c3d797').skin_url)
print(pyspapi.MojangAPI.get_profile(uuid='63ed47877aa3470fbfc46c5356c3d797').skin_model)
print(pyspapi.MojangAPI.get_profile(uuid='63ed47877aa3470fbfc46c5356c3d797').skin)

View File

@@ -1,3 +1,3 @@
import pyspapi import pyspapi
mojangapi = pyspapi.MojangAPI.get_username(uuid='63ed47877aa3470fbfc46c5356c3d797') print(pyspapi.MojangAPI.get_username(uuid='63ed47877aa3470fbfc46c5356c3d797'))

View File

@@ -0,0 +1,5 @@
import pyspapi
print(pyspapi.MojangAPI.get_uuid(username='deesiigneer'))
print(pyspapi.MojangAPI.get_uuids(['deesiigneer', '5opka', 'OsterMiner']))

View File

@@ -1,3 +0,0 @@
import pyspapi
mojangapi = pyspapi.MojangAPI.get_uuid(username='deesiigneer')

View File

@@ -1,5 +1,5 @@
import pyspapi import pyspapi
spapi = pyspapi.SPAPI(card_id='card_id', token='token').balance spapi = pyspapi.SPAPI(card_id='card_id', token='token')
print(spapi.check_users_access([262632724928397312, 264329096920563714])) print(spapi.check_users_access([262632724928397312, 264329096920563714]))

View File

@@ -4,4 +4,8 @@ spapi = pyspapi.SPAPI(card_id='card_id', token='token')
print(spapi.get_user(262632724928397312)) print(spapi.get_user(262632724928397312))
print(spapi.get_user(262632724928397312).username)
print(spapi.get_user(262632724928397312).access)
print(spapi.get_users([262632724928397312, 264329096920563714])) print(spapi.get_users([262632724928397312, 264329096920563714]))

View File

@@ -1,3 +1,3 @@
from .api import * from .api import *
__version__ = "2.0.0" __version__ = "2.1.1"

View File

@@ -197,24 +197,23 @@ class MojangAPI:
except json.decoder.JSONDecodeError: except json.decoder.JSONDecodeError:
return None return None
# TODO: check, why always errorMessage return invalid @classmethod
# @classmethod def get_uuids(cls, names: List[str]) -> Dict[str, str]:
# def get_uuids(cls, names: List[str]) -> Dict[str, str]: """
# """ Получить UUID's игроков Minecraft.\n
# Получить UUID's игроков Minecraft.\n :param names: List[str] Список с никнеймами игроков Minecraft.
# :param names: List[str] Список с никнеймами игроков Minecraft. :return: Dict[str, str] UUID игрока Minecraft.
# :return: Dict[str, str] UUID игрока Minecraft.
# """
# """ if len(names) > 10:
# if len(names) > 10: names = names[:10]
# names = names[:10] response = cls.__make_request('API', 'POST', '/profiles/minecraft', data=names).json()
# response = cls.__make_request('API', 'POST', '/profiles/minecraft', data=names).json() if not isinstance(response, list):
# if not isinstance(response, list): if response.get('error'):
# if response.get('error'): raise ValueError(response['errorMessage'])
# raise ValueError(response['errorMessage']) else:
# else: raise _Error(response)
# raise Error(response) return {uuids['name']: uuids['id'] for uuids in response}
# return {uuids['name']: uuids['id'] for uuids in response}
@classmethod @classmethod
def get_username(cls, uuid: str) -> Optional[str]: def get_username(cls, uuid: str) -> Optional[str]:

View File

@@ -1 +1 @@
requests=2.28.1 requests==2.28.1

View File

@@ -29,14 +29,18 @@ setup(
name='pyspapi', name='pyspapi',
license='MIT', license='MIT',
author='deesiigneer', author='deesiigneer',
author_email='xdeesiigneerx@gmail.com',
version=version, version=version,
url='https://github.com/deesiigneer/pyspapi', url='https://github.com/deesiigneer/pyspapi',
project_urls={
"Documentation": "https://pyspapi.readthedocs.io/ru/latest/",
"GitHub": "https://github.com/deesiigneer/pyspapi",
"Discord": "https://discord.com/invite/VbyHaKRAaN"
},
description='API wrapper for SP servers written in Python', description='API wrapper for SP servers written in Python',
long_description=readme, long_description=readme,
long_description_content_type='text/x-rst', long_description_content_type='text/x-rst',
packages=packages, packages=packages,
include_package_data=True, include_package_data=True,
install_requires=requirements, install_requires=requirements,
python_requires='>=3.9.0', python_requires='>=3.8.0',
) )