create account

Coogger API update | Coogger-python - V0.2.1 | How to use coogger-python by hakancelik

View this thread on: hive.blogpeakd.comecency.com
· @hakancelik · (edited)
$49.03
Coogger API update | Coogger-python - V0.2.1 | How to use coogger-python
<img gnrl="br-6" src="https://cdn.steemitimages.com/DQme19QGXX1nLfjMYQbdYUVvaxgSsWyqnM85SD7q1p9EDkK/coogger-python.png"></img>

#### Note:
Currently, the **API service** is accessible only to those who have the **API_key**, ***Now thanks to this new features Safer, Faster and More flexible***

### Before starting
Update the package:

```python
pip install coogger-python -U
```

You can include each class in our project, as below.

```python
from coogger.content import ContentApi, ContentFilterApi
from coogger.user import SteemConnectUserApi, UserApi, UserFilterApi
from coogger.ditop import DictToObject
```

## Coogger-python V0.2.1
### Commit :
- [coogger-python V0.2.1](https://github.com/coogger/coogger-python/commit/ae1e0f9f0d0017225405e67ab27f27a8054dd3cf)

<cent
```
...

<hr>

Read this content         on [www.coogger.com](www.coogger.com/@hakancelik/coogger-api-update-coogger-python-v021-how-to-use-coogger-python)


- Dapp; [www.coogger.com](www.coogger.com)
- Category; [project](https://www.coogger.com/category/project/)
- Language; [english](https://www.coogger.com/language/english/)
- Topic; [coogger-python](https://www.coogger.com/coogger-python/@hakancelik/)
- User; [@hakancelik](www.coogger.com/@hakancelik)<br>

--------

Posted using [www.coogger.com](https://www.coogger.com)
Coogger is an ecosystem where is **knowledge sharing network** which can **build web dapps** and **groups**

#### Contact Us

- [on Spectrum](https://spectrum.chat/coogger)
- [on Discord](https://discord.gg/avmdZJa)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 125 others
properties (23)
authorhakancelik
permlinkcoogger-api-update-coogger-python-v021-how-to-use-coogger-python
categorycoogger
json_metadata"{"format": "markdown", "tags": ["coogger", "development", "coogger-python", "utopian-io", "python"], "app": "coogger/1.4.1", "ecosystem": {"name": "coogger", "version": "1.4.1", "dapp": "coogger", "topic": "coogger-python", "category": "project", "language": "english", "address": "https://github.com/coogger/coogger-python", "body": "<img gnrl=\"br-6\" src=\"https://cdn.steemitimages.com/DQme19QGXX1nLfjMYQbdYUVvaxgSsWyqnM85SD7q1p9EDkK/coogger-python.png\"></img>\r\n\r\n#### Note:\r\nCurrently, the **API service** is accessible only to those who have the **API_key**, ***Now thanks to this new features Safer, Faster and More flexible***\r\n\r\n### Before starting\r\nUpdate the package:\r\n\r\n```python\r\npip install coogger-python -U\r\n```\r\n\r\nYou can include each class in our project, as below.\r\n\r\n```python\r\nfrom coogger.content import ContentApi, ContentFilterApi\r\nfrom coogger.user import SteemConnectUserApi, UserApi, UserFilterApi\r\nfrom coogger.ditop import DictToObject\r\n```\r\n\r\n## Coogger-python V0.2.1\r\n### Commit :\r\n- [coogger-python V0.2.1](https://github.com/coogger/coogger-python/commit/ae1e0f9f0d0017225405e67ab27f27a8054dd3cf)\r\n\r\n<center>***The features added by this commit are described below.***</center>\r\n\r\n## SteemConnectUserApi, UserApi and ContentApi\r\n### Commit :\r\n[SteemConnectUserApi, UserApi and ContentApi was made with apiview class](https://github.com/coogger/coogger/commit/676f0d384d1f2c8f5cac27591c551e80a58d2997)\r\n\r\n#### SteemConnectUserApi\r\nThe **SteemConnectUserApi** class is used to access SteemConnect User information these information are ***user***, ***communty*** ***information***, ***refresh_token***, ***code*** and ***access_token*** **SteemConnectUserApi** class is used to view or update a specific SteemConnect user.\r\n\r\n```python\r\n>>> steem_connect_user = SteemConnectUserApi(username:str, api_key:str, node:str)\r\n>>> # node -> default : \"http://www.coogger.com/api/steemconnectuser/@{}/\"\r\n>>> user = steem_connect_user.get\r\n>>> user_update = steem_connect_user.update(access_token=\"new_access_token\")\r\n```\r\n\r\n#### UserApi\r\nThe **UserApi** class is used to view or update a specific user information, these information are ***user***, ***about***, ***cooggerup_confirmation***, ***cooggerup_percent***, ***vote_percent*** and ***beneficiaries***, **UserApi** class is used to view or update a specific user.\r\n\r\n```python\r\n>>> user_api = UserApi(username:str, api_key:str, node:str)\r\n>>> # node -> default : \"http://www.coogger.com/api/user/@{}/\"\r\n>>> user = user_api.get\r\n>>> user_update = user_api.update(about=\"hello\")\r\n```\r\n\r\n#### ContentApi\r\n**ContentApi** class is used to view or update a specific content information, these information are ***username, title, permlink, content, tag, category, language, definition, topic, status, time, dor, views, read, lastmod, modusername and cooggerup***.\r\n\r\n```python\r\n>>> content_api = ContentApi(username:str, permlink:str, api_key:str, node:str)\r\n>>> # node -> default -> \"https://www.coogger.com/api/content/{}/{}/\"\r\n>>> # api_key allows for the coogger api\r\n>>> content_api.update(title=\"title\", category=\"category\", status=\"status\")\r\n>>> content_api.get # to view the content\r\n```\r\n\r\n\r\n## UserFilter and ContentFilter was made with ModelViewSet class\r\n### Commit :\r\n[UserFilter and ContentFilter was made with ModelViewSet class](https://github.com/coogger/coogger/commit/67a78de7d680b59858c177d667dae4b0b56eff57)\r\n\r\n#### UserFilter\r\nThe **UserFilterApi** class allows user to be filtered by any property, these properties are ***about, cooggerup_confirmation, cooggerup_percent, vote_percent and beneficiaries***.\r\n\r\n```python\r\n>>> user_filter_api = UserFilterApi(api_key:str, node:str)\r\n>>> # node -> default = \"https://www.coogger.com/api/user/\"\r\n>>> # node -> you can set \"http://127.0.0.1:8000/api/user/\" when you work local\r\n>>> user_filter_api.filter(cooggerup_confirmation=True, beneficiaries=10)\r\n>>> users = user_filter_api.result\r\n>>> next_page = user_filter_api.next\r\n>>> previous_page = user_filter_api.previous\r\n>>> [user for user in users]\r\n```\r\n\r\n#### ContentFilter\r\nThe **ContentFilterApi** class allows content to be filtered by any property, these properties are ***permlink, category, language, topic, status # shared/ changed/approved /rejected, dor # duration of reading, views, read, mod and cooggerup***.\r\n\r\n```python\r\n>>> content_filter_api = ContentFilterApi(node:str)\r\n>>> # node -> default = \"https://www.coogger.com/api/content/\"\r\n>>> # node -> you can set \"http://127.0.0.1:8000/api/content/\" when you work local\r\n>>> content_filter_api.filter(category=\"tutorial\", status=\"approved\", language=\"turkish\")\r\n>>> contents = content_filter_api.result\r\n>>> next_page = content_filter_api.next\r\n>>> previous_page = content_filter_api.previous\r\n>>> [content for content in contents]\r\n```\r\n\r\n\r\n## ApiPermission\r\n### Commit :\r\n[ApiPermission](https://github.com/coogger/coogger/commit/5d4bddc3fb8b135d8cebae8b7e34a9bd48374272)\r\n\r\nThanks to this features the **API service** is accessible only to those who have the **API_key**\r\n\r\n\r\n### Example:\r\nWith this function, you can see **coogger.up** users who have joined in curation trail and have steem-power above **80%**.\r\n\r\n```python\r\nfrom coogger.user import UserFilterApi\r\nfrom steem.account import Account\r\n\r\nsteem_keys = [\"key\"]\r\nSTEEM = Steem(nodes=['https://api.steemit.com'], keys=steem_keys)\r\n\r\ndef get_users(api_key, STEEM):\r\n user_filter_api = UserFilterApi()\r\n user_filter_api.filter(cooggerup_confirmation=True)\r\n while True:\r\n for user in user_filter_api.results:\r\n voting_power = Account(user.username, \r\n\t\t\tsteemd_instance = STEEM).voting_power()\r\n if voting_power >= 80:\r\n yield user\r\n if user_filter_api.next is not None:\r\n user_filter = UserFilterApi(api_key=api_key, \r\n\t\t\t\t\tnode=user_filter_api.next\r\n\t\t\t\t\t).filter(cooggerup_confirmation = True)\r\n else:\r\n break\r\n\r\n```\r\n\r\nWith this function, you can see the user's access token\r\n\r\n```python\r\ndef get_access_token(username, api_key):\r\n\tuser = SteemConnectUserApi(username=username, api_key=api_key)\r\n\treturn user.get.access_token\r\n```\r\n\r\n### What next?\r\nI will develop API permissions and service, thus I will provide services according to the needs of those people."}}"
created2018-08-27 22:55:30
last_update2018-12-30 01:39:54
depth0
children5
last_payout2018-09-03 22:55:30
cashout_time1969-12-31 23:59:59
total_payout_value37.626 HBD
curator_payout_value11.406 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,554
author_reputation15,102,487,166,852
root_title"Coogger API update | Coogger-python - V0.2.1 | How to use coogger-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,545,617
net_rshares33,095,407,181,584
author_curate_reward""
vote details (189)
@coogger ·
cooggerup
<center>![](https://steemitimages.com/256x512/https://steemitimages.com/DQmUGgUGkAebw11doXJddr3dsWuL2bYWYZUtsMW5vEbSf1S/800.png)</center>

        
You have received an upvote from **cooggerup** and all the users that have joined the trail with you that has available upvote power.
        

        
 - [For more information about coogger](http://www.coogger.com/@coogger/coogger-project-which-can-work-with-communities/)
        
 - [Coogger Ecosystem settings and How can I join cooggerup curation trail.](http://www.coogger.com/@steemkitchen/detailed-instructions-to-use-the-profile-settings-for-wwwsteemkitchencom/)
        
 - Please follow curation trail with [steeauto account](https://steemauto.com/dash.php?trail=coogger&i=1) or join the cooggerup bot in the settings on coogger.com or other community web site like steemkitcen.com for more support from **Coogger Ecosystem.**
        
-----
        

        
Thank you for supporting **coogger** community that is part of the **Coogger Ecosystem.**
        
 <center>[Contact us on Discord](https://discord.gg/avmdZJa)
👍  ,
properties (23)
authorcoogger
permlinkre-coogger-api-update-coogger-python-v021-how-to-use-coogger-python-20180827t225633
categorycoogger
json_metadata"{"community": "coogger", "tags": ["coogger"]}"
created2018-08-27 22:56:33
last_update2018-08-27 22:56:33
depth1
children0
last_payout2018-09-03 22:56:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,080
author_reputation401,941,647,706
root_title"Coogger API update | Coogger-python - V0.2.1 | How to use coogger-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,545,692
net_rshares9,536,465,348
author_curate_reward""
vote details (2)
@helo ·
$5.56
* It was hard to find a line that was not touched.  ;-)
* Do my eyes deceive me or [this](https://github.com/coogger/coogger/blob/676f0d384d1f2c8f5cac27591c551e80a58d2997/coogger/api/serializers.py#L3) is in twice?
* No comments, except this ` # TODO: content_update buraya bak sayfa iki defa güncellenince içerik güncelleniyor` but I can't read it.
 
Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/2221134).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
👍  , , , , ,
properties (23)
authorhelo
permlinkre-hakancelik-coogger-api-update-coogger-python-v021-how-to-use-coogger-python-20180829t165746443z
categorycoogger
json_metadata{"tags":["coogger"],"links":["https://github.com/coogger/coogger/blob/676f0d384d1f2c8f5cac27591c551e80a58d2997/coogger/api/serializers.py#L3","https://join.utopian.io/guidelines","https://review.utopian.io/result/3/2221134","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-08-29 16:57:45
last_update2018-08-29 16:57:45
depth1
children2
last_payout2018-09-05 16:57:45
cashout_time1969-12-31 23:59:59
total_payout_value4.197 HBD
curator_payout_value1.358 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length841
author_reputation121,547,934,535,311
root_title"Coogger API update | Coogger-python - V0.2.1 | How to use coogger-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,718,494
net_rshares3,700,282,387,474
author_curate_reward""
vote details (6)
@hakancelik ·
Thanks :), I will try to improve the comments.
properties (22)
authorhakancelik
permlinkre-helo-re-hakancelik-coogger-api-update-coogger-python-v021-how-to-use-coogger-python-20180829t175409703z
categorycoogger
json_metadata{"tags":["coogger"],"app":"steemit/0.1"}
created2018-08-29 17:54:09
last_update2018-08-29 17:54:09
depth2
children0
last_payout2018-09-05 17:54:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length46
author_reputation15,102,487,166,852
root_title"Coogger API update | Coogger-python - V0.2.1 | How to use coogger-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,722,792
net_rshares0
@utopian-io ·
Thank you for your review, @helo!

So far this week you've reviewed 5 contributions. Keep up the good work!
properties (22)
authorutopian-io
permlinkre-re-hakancelik-coogger-api-update-coogger-python-v021-how-to-use-coogger-python-20180829t165746443z-20180830t072509z
categorycoogger
json_metadata"{"app": "beem/0.19.42"}"
created2018-08-30 07:25:09
last_update2018-08-30 07:25:09
depth2
children0
last_payout2018-09-06 07:25:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length107
author_reputation152,955,367,999,756
root_title"Coogger API update | Coogger-python - V0.2.1 | How to use coogger-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,771,918
net_rshares0
@utopian-io ·
Hey, @hakancelik!

**Thanks for contributing on Utopian**.
We’re already looking forward to your next contribution!

**Get higher incentives and support Utopian.io!**
 Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via [SteemPlus](https://chrome.google.com/webstore/detail/steemplus/mjbkjgcplmaneajhcbegoffkedeankaj?hl=en) or [Steeditor](https://steeditor.app)).

**Want to chat? Join us on Discord https://discord.gg/h52nFrV.**

<a href='https://steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
properties (22)
authorutopian-io
permlinkre-coogger-api-update-coogger-python-v021-how-to-use-coogger-python-20180829t182533z
categorycoogger
json_metadata"{"app": "beem/0.19.42"}"
created2018-08-29 18:25:36
last_update2018-08-29 18:25:36
depth1
children0
last_payout2018-09-05 18:25:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length592
author_reputation152,955,367,999,756
root_title"Coogger API update | Coogger-python - V0.2.1 | How to use coogger-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,725,261
net_rshares0