From e7342964d83be258a68e24b30592c91a26538e88 Mon Sep 17 00:00:00 2001 From: verixx Date: Fri, 23 Nov 2018 19:00:26 +1100 Subject: [PATCH 1/5] New readme --- README.md | 88 ++++++++++++++++++++++++++++++ README.rst | 47 ---------------- clashroyale/official_api/client.py | 2 +- clashroyale/royaleapi/client.py | 2 +- 4 files changed, 90 insertions(+), 49 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/README.md b/README.md new file mode 100644 index 0000000..484ea0f --- /dev/null +++ b/README.md @@ -0,0 +1,88 @@ + + +

Clash Royale

+ + +
+ Interact with Clash Royale APIs using python. +
+
+ + + Travis + + + + Travis + + + + Travis + + + + Travis + + + + Travis + + +
+
+
+ This library enables you to easily retrieve data from either the official Clash Royale api or royaleapi.com and easily interact with the data recieved. + +
+ +### Installation + + + +To install the library simply use [pipenv](http://pipenv.org/) (or pip, of course). + +``` +pipenv install clashroyale +``` + +### Retrieving Data + + +```py +code goes here +``` + +### Accessing Data +You can easily access data via dot notation as shown. +```py +code goes here +``` + +You can also do this blah blah +```py +more stuff +``` + +### Asynchronous Usage: + +To asynchronously make requests using aiohttp, simply use `APIClient.Async` to create the object. An example is as follows. Simply use the `await` keyword when calling api methods. + +```py +code goes here +``` + +Alternatively you can use an async with block to automatically close the session once finished. +```py +async def main(): + async with RoyaleAPI.Async('url') as client: + profile = await client.get_profile('2PP') +``` + +### [Documentation](https://clashroyale.readthedocs.io) +You can find the full API reference here (https://clashroyale.readthedocs.io) + +### License +This project is licensed under MIT + +### Contributing +Feel free to contribute to this project, a helping hand is always appreciated. Join our discord server [here](https://discord.gg/etJNHCQ). diff --git a/README.rst b/README.rst deleted file mode 100644 index 41ad065..0000000 --- a/README.rst +++ /dev/null @@ -1,47 +0,0 @@ -clashroyale -=========== - -.. image:: https://img.shields.io/pypi/v/clashroyale.svg - :target: https://pypi.org/project/clashroyale/ - :alt: PyPi - -.. image:: https://img.shields.io/pypi/pyversions/clashroyale.svg - :target: https://pypi.org/project/clashroyale/ - :alt: Supported Versions - -.. image:: https://travis-ci.com/cgrok/clashroyale.svg?branch=master - :target: https://travis-ci.com/cgrok/clashroyale - :alt: Travis CI Status - -.. image:: https://img.shields.io/github/license/cgrok/clashroyale.svg - :target: https://github.com/cgrok/clashroyale/blob/master/LICENSE - :alt: MIT License - - -This library is currently an (a)sync wrapper for -https://royaleapi.com and the official Clash Royale API with -great functionality. - -Installation -============ - -Development build - -.. code-block:: python - - pip install git+https://github.com/cgrok/clashroyale - -Stable build - -.. code-block:: python - - pip install clashroyale - -Documentation -============= - -Hosted on readthedocs.io (https://clashroyale.readthedocs.io) - -Docstrings are written using the `NumpyDoc`_ specification - -.. _NumpyDoc: https://github.com/cdgriffith/Box \ No newline at end of file diff --git a/clashroyale/official_api/client.py b/clashroyale/official_api/client.py index 2070c70..e43f535 100644 --- a/clashroyale/official_api/client.py +++ b/clashroyale/official_api/client.py @@ -113,7 +113,7 @@ async def __aenter__(self): return self async def __aexit__(self, exc_type, exc_value, traceback): - self.close() + await self.close() def __repr__(self): return ''.format(self.is_async) diff --git a/clashroyale/royaleapi/client.py b/clashroyale/royaleapi/client.py index 33b23dc..b33efc0 100644 --- a/clashroyale/royaleapi/client.py +++ b/clashroyale/royaleapi/client.py @@ -105,7 +105,7 @@ async def __aenter__(self): return self async def __aexit__(self, exc_type, exc_value, traceback): - self.close() + await self.close() def __repr__(self): return ''.format(self.is_async) From 4f10ef32ff934120671f7a16536b4cfd7c3fc811 Mon Sep 17 00:00:00 2001 From: kyb3r Date: Fri, 23 Nov 2018 19:01:36 +1100 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 484ea0f..783a095 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@
- This library enables you to easily retrieve data from either the official Clash Royale api or royaleapi.com and easily interact with the data recieved. + This library enables you to easily retrieve data from either the official Clash Royale api or royaleapi.com and dynamically interact with the data recieved in an object oriented style.
From ee03d1883500222ccf524d913fc29482ba83efc2 Mon Sep 17 00:00:00 2001 From: verixx Date: Fri, 23 Nov 2018 19:09:46 +1100 Subject: [PATCH 3/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 484ea0f..0122746 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@
- This library enables you to easily retrieve data from either the official Clash Royale api or royaleapi.com and easily interact with the data recieved. + This library enables you to easily retrieve data from either the official Clash Royale api or royaleapi.com and easily interact with the data recieved. Asynchronous usage is also supported.
From f67ebc733d1a8d0c9581de0eb98bd566493623c9 Mon Sep 17 00:00:00 2001 From: verixx Date: Fri, 23 Nov 2018 19:13:40 +1100 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98c564f..ec7a0da 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@
- This library enables you to easily retrieve data from either the official Clash Royale api or royaleapi.com and dynamically interact with the data recieved in an object oriented style. Asynchronous usage is also supported. + This library enables you to effortlessly retrieve data from either the official Clash Royale API or royaleapi.com and dynamically interact with the data recieved with an object oriented approach. Asynchronous usage is also supported.
### Installation From b51434f9b8b6049555960eb744de7bfe549c689b Mon Sep 17 00:00:00 2001 From: verixx Date: Fri, 23 Nov 2018 19:14:53 +1100 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ec7a0da..d40cf89 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@
- This library enables you to effortlessly retrieve data from either the official Clash Royale API or royaleapi.com and dynamically interact with the data recieved with an object oriented approach. Asynchronous usage is also supported. + This library enables you to effortlessly retrieve data from either the official Clash Royale API or royaleapi.com and dynamically interact with the data recieved with an object oriented design. Asynchronous usage is also supported.
### Installation