Skip to content

Commit

Permalink
Turn yadisk into yadisk-async
Browse files Browse the repository at this point in the history
  • Loading branch information
ivknv committed Jul 6, 2019
1 parent ee7646a commit cee4041
Show file tree
Hide file tree
Showing 46 changed files with 2,948 additions and 2,292 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
*.py[co]
dist/
build/
yadisk.egg-info/
yadisk_async.egg-info/
docs/_build
60 changes: 34 additions & 26 deletions README.en.rst
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
YaDisk
======

.. image:: https://img.shields.io/readthedocs/yadisk.svg
.. image:: https://img.shields.io/readthedocs/yadisk-async.svg
:alt: Read the Docs
:target: https://yadisk.readthedocs.io/en/latest/
:target: https://yadisk-async.readthedocs.io/en/latest/

.. image:: https://img.shields.io/pypi/v/yadisk.svg
.. image:: https://img.shields.io/pypi/v/yadisk-async.svg
:alt: PyPI
:target: https://pypi.org/project/yadisk
:target: https://pypi.org/project/yadisk-async

.. image:: https://img.shields.io/aur/version/python-yadisk.svg
.. image:: https://img.shields.io/aur/version/python-yadisk-async.svg
:alt: AUR
:target: https://aur.archlinux.org/packages/python-yadisk

.. image:: https://img.shields.io/badge/Donate-PayPal-green.svg
:alt: Donate
:target: https://paypal.me/encryptandsync
:target: https://aur.archlinux.org/packages/python-yadisk-async

YaDisk is a Yandex.Disk REST API client library.
YaDisk-async is a Yandex.Disk REST API client library with async/await support.

.. _Read the Docs (EN): http://yadisk.readthedocs.io
.. _Read the Docs (RU): http://yadisk.readthedocs.io/ru/latest
.. _Read the Docs (EN): http://yadisk-async.readthedocs.io
.. _Read the Docs (RU): http://yadisk-async.readthedocs.io/ru/latest

Documentation is available at `Read the Docs (EN)`_ and `Read the Docs (RU)`_ (although it's not complete yet).
Documentation is available at `Read the Docs (EN)`_ and `Read the Docs (RU)`_.

Installation
************

.. code:: bash
pip install yadisk
pip install yadisk-async
or

Expand All @@ -42,44 +38,56 @@ Examples

.. code:: python
import yadisk
import yadisk_async
y = yadisk.YaDisk(token="<token>")
y = yadisk_async.YaDisk(token="<token>")
# or
# y = yadisk.YaDisk("<application-id>", "<application-secret>", "<token>")
# y = yadisk_async.YaDisk("<application-id>", "<application-secret>", "<token>")
# Check if the token is valid
print(y.check_token())
print(await y.check_token())
# Get disk information
print(y.get_disk_info())
print(await y.get_disk_info())
# Print files and directories at "/some/path"
print(list(y.listdir("/some/path")))
print([i async for i in await y.listdir("/some/path")])
# Upload "file_to_upload.txt" to "/destination.txt"
y.upload("file_to_upload.txt", "/destination.txt")
await y.upload("file_to_upload.txt", "/destination.txt")
# Same thing
with open("file_to_upload.txt", "rb") as f:
y.upload(f, "/destination.txt")
await y.upload(f, "/destination.txt")
# Download "/some-file-to-download.txt" to "downloaded.txt"
y.download("/some-file-to-download.txt", "downloaded.txt")
await y.download("/some-file-to-download.txt", "downloaded.txt")
# Permanently remove "/file-to-remove"
y.remove("/file-to-remove", permanently=True)
await y.remove("/file-to-remove", permanently=True)
# Create a new directory at "/test-dir"
print(y.mkdir("/test-dir"))
print(await y.mkdir("/test-dir"))
# Always remember to close all the connections or you'll get a warning
await y.close()
Changelog
*********

.. _yadisk: https://github.com/ivknv/yadisk

.. _issue #2: https://github.com/ivknv/yadisk/issues/2
.. _issue #4: https://github.com/ivknv/yadisk/issues/4
.. _issue #7: https://github.com/ivknv/yadisk/issues/7

* **Release 1.3.0 (2019-07-06)**

* Modified the original library (`yadisk`_) to support `async/await`
* The library was renamed to `yadisk-async`

The following releases are for `yadisk`_, the original library:

* **Release 1.2.14 (2019-03-26)**

* Fixed a :code:`TypeError` in :code:`get_public_*` functions when passing :code:`path` parameter
Expand Down
58 changes: 33 additions & 25 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
YaDisk
======

.. image:: https://img.shields.io/readthedocs/yadisk.svg
.. image:: https://img.shields.io/readthedocs/yadisk-async.svg
:alt: Read the Docs
:target: https://yadisk.readthedocs.io/en/latest/
:target: https://yadisk-async.readthedocs.io/en/latest/

.. image:: https://img.shields.io/pypi/v/yadisk.svg
.. image:: https://img.shields.io/pypi/v/yadisk-async.svg
:alt: PyPI
:target: https://pypi.org/project/yadisk
:target: https://pypi.org/project/yadisk-async

.. image:: https://img.shields.io/aur/version/python-yadisk.svg
.. image:: https://img.shields.io/aur/version/python-yadisk-async.svg
:alt: AUR
:target: https://aur.archlinux.org/packages/python-yadisk
:target: https://aur.archlinux.org/packages/python-yadisk-async

.. image:: https://img.shields.io/badge/Donate-PayPal-green.svg
:alt: Donate
:target: https://paypal.me/encryptandsync
YaDisk-async - это библиотека-клиент REST API Яндекс.Диска с поддержкой async/await.

YaDisk - это библиотека-клиент REST API Яндекс.Диска.

.. _Read the Docs (EN): http://yadisk.readthedocs.io
.. _Read the Docs (RU): http://yadisk.readthedocs.io/ru/latest
.. _Read the Docs (EN): http://yadisk-async.readthedocs.io
.. _Read the Docs (RU): http://yadisk-async.readthedocs.io/ru/latest

Документация доступна на `Read the Docs (RU)`_ и `Read the Docs (EN)`_.

Expand All @@ -29,7 +25,7 @@ YaDisk - это библиотека-клиент REST API Яндекс.Диск

.. code:: bash
pip install yadisk
pip install yadisk-async
или

Expand All @@ -42,44 +38,56 @@ YaDisk - это библиотека-клиент REST API Яндекс.Диск

.. code:: python
import yadisk
import yadisk_async
y = yadisk.YaDisk(token="<токен>")
y = yadisk_async.YaDisk(token="<token>")
# или
# y = yadisk.YaDisk("<id-приложения>", "<secret-приложения>", "<токен>")
# y = yadisk_async.YaDisk("<id-приложения>", "<secret-приложения>", "<токен>")
# Проверяет, валиден ли токен
print(y.check_token())
print(await y.check_token())
# Получает общую информацию о диске
print(y.get_disk_info())
print(await y.get_disk_info())
# Выводит содержимое "/some/path"
print(list(y.listdir("/some/path")))
print([i async for i in await y.listdir("/some/path")])
# Загружает "file_to_upload.txt" в "/destination.txt"
y.upload("file_to_upload.txt", "/destination.txt")
await y.upload("file_to_upload.txt", "/destination.txt")
# То же самое
with open("file_to_upload.txt", "rb") as f:
y.upload(f, "/destination.txt")
await y.upload(f, "/destination.txt")
# Скачивает "/some-file-to-download.txt" в "downloaded.txt"
y.download("/some-file-to-download.txt", "downloaded.txt")
await y.download("/some-file-to-download.txt", "downloaded.txt")
# Безвозвратно удаляет "/file-to-remove"
y.remove("/file-to-remove", permanently=True)
await y.remove("/file-to-remove", permanently=True)
# Создаёт новую папку "/test-dir"
print(y.mkdir("/test-dir"))
print(await y.mkdir("/test-dir"))
# Всегда закрывайте все соединения или получите предупреждение
await y.close()
История изменений
*****************

.. _yadisk: https://github.com/ivknv/yadisk

.. _issue #2: https://github.com/ivknv/yadisk/issues/2
.. _issue #4: https://github.com/ivknv/yadisk/issues/4
.. _issue #7: https://github.com/ivknv/yadisk/issues/7

* **Release 1.3.0 (2019-07-06)**

* Реализована поддержка `async/await`
* Библиотека была переименована из `yadisk_` в `yadisk-async`

Следующие релизы относятся к оригинальной библиотеке `yadisk_`:

* **Release 1.2.14 (2019-03-26)**

* Исправлена ошибка :code:`TypeError` в функциях :code:`get_public_*` при
Expand Down
58 changes: 33 additions & 25 deletions README.ru.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
YaDisk
======

.. image:: https://img.shields.io/readthedocs/yadisk.svg
.. image:: https://img.shields.io/readthedocs/yadisk-async.svg
:alt: Read the Docs
:target: https://yadisk.readthedocs.io/en/latest/
:target: https://yadisk-async.readthedocs.io/en/latest/

.. image:: https://img.shields.io/pypi/v/yadisk.svg
.. image:: https://img.shields.io/pypi/v/yadisk-async.svg
:alt: PyPI
:target: https://pypi.org/project/yadisk
:target: https://pypi.org/project/yadisk-async

.. image:: https://img.shields.io/aur/version/python-yadisk.svg
.. image:: https://img.shields.io/aur/version/python-yadisk-async.svg
:alt: AUR
:target: https://aur.archlinux.org/packages/python-yadisk
:target: https://aur.archlinux.org/packages/python-yadisk-async

.. image:: https://img.shields.io/badge/Donate-PayPal-green.svg
:alt: Donate
:target: https://paypal.me/encryptandsync
YaDisk-async - это библиотека-клиент REST API Яндекс.Диска с поддержкой async/await.

YaDisk - это библиотека-клиент REST API Яндекс.Диска.

.. _Read the Docs (EN): http://yadisk.readthedocs.io
.. _Read the Docs (RU): http://yadisk.readthedocs.io/ru/latest
.. _Read the Docs (EN): http://yadisk-async.readthedocs.io
.. _Read the Docs (RU): http://yadisk-async.readthedocs.io/ru/latest

Документация доступна на `Read the Docs (RU)`_ и `Read the Docs (EN)`_.

Expand All @@ -29,7 +25,7 @@ YaDisk - это библиотека-клиент REST API Яндекс.Диск

.. code:: bash
pip install yadisk
pip install yadisk-async
или

Expand All @@ -42,44 +38,56 @@ YaDisk - это библиотека-клиент REST API Яндекс.Диск

.. code:: python
import yadisk
import yadisk_async
y = yadisk.YaDisk(token="<токен>")
y = yadisk_async.YaDisk(token="<token>")
# или
# y = yadisk.YaDisk("<id-приложения>", "<secret-приложения>", "<токен>")
# y = yadisk_async.YaDisk("<id-приложения>", "<secret-приложения>", "<токен>")
# Проверяет, валиден ли токен
print(y.check_token())
print(await y.check_token())
# Получает общую информацию о диске
print(y.get_disk_info())
print(await y.get_disk_info())
# Выводит содержимое "/some/path"
print(list(y.listdir("/some/path")))
print([i async for i in await y.listdir("/some/path")])
# Загружает "file_to_upload.txt" в "/destination.txt"
y.upload("file_to_upload.txt", "/destination.txt")
await y.upload("file_to_upload.txt", "/destination.txt")
# То же самое
with open("file_to_upload.txt", "rb") as f:
y.upload(f, "/destination.txt")
await y.upload(f, "/destination.txt")
# Скачивает "/some-file-to-download.txt" в "downloaded.txt"
y.download("/some-file-to-download.txt", "downloaded.txt")
await y.download("/some-file-to-download.txt", "downloaded.txt")
# Безвозвратно удаляет "/file-to-remove"
y.remove("/file-to-remove", permanently=True)
await y.remove("/file-to-remove", permanently=True)
# Создаёт новую папку "/test-dir"
print(y.mkdir("/test-dir"))
print(await y.mkdir("/test-dir"))
# Всегда закрывайте все соединения или получите предупреждение
await y.close()
История изменений
*****************

.. _yadisk: https://github.com/ivknv/yadisk

.. _issue #2: https://github.com/ivknv/yadisk/issues/2
.. _issue #4: https://github.com/ivknv/yadisk/issues/4
.. _issue #7: https://github.com/ivknv/yadisk/issues/7

* **Release 1.3.0 (2019-07-06)**

* Реализована поддержка `async/await`
* Библиотека была переименована из `yadisk_` в `yadisk-async`

Следующие релизы относятся к оригинальной библиотеке `yadisk_`:

* **Release 1.2.14 (2019-03-26)**

* Исправлена ошибка :code:`TypeError` в функциях :code:`get_public_*` при
Expand Down
9 changes: 9 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
Changelog
=========

.. _yadisk: https://github.com/ivknv/yadisk

.. _issue #2: https://github.com/ivknv/yadisk/issues/2
.. _issue #4: https://github.com/ivknv/yadisk/issues/4
.. _issue #7: https://github.com/ivknv/yadisk/issues/7

* **Release 1.3.0 (2019-07-06)**

* Modified the original library (`yadisk`_) to support `async/await`
* The library was renamed to `yadisk-async`

The following releases are for `yadisk`_, the original library:

* **Release 1.2.14 (2019-03-26)**

* Fixed a `TypeError` in `get_public_*` functions when passing `path` parameter
Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def handle_item(fieldarg, content):
'sphinx.ext.intersphinx']

intersphinx_mapping = {"python": ("https://docs.python.org/3", None),
"requests": ("http://docs.python-requests.org/en/master", None)}
"aiohttp": ("https://aiohttp.readthedocs.io/en/stable/", None)}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -93,7 +93,7 @@ def handle_item(fieldarg, content):
master_doc = 'index'

# General information about the project.
project = 'YaDisk'
project = 'YaDisk-async'
copyright = '2019, Ivan Konovalov'
author = 'Ivan Konovalov'

Expand All @@ -102,9 +102,9 @@ def handle_item(fieldarg, content):
# built documents.
#
# The short X.Y version.
version = '1.2.14'
version = '1.3.0'
# The full version, including alpha/beta/rc tags.
release = '1.2.14'
release = '1.3.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
Loading

0 comments on commit cee4041

Please sign in to comment.