Modern Dev.To API client built with aiohttp and pydantic
Project description
devto.py
devto is a modern Python API client for the Forem API V1, written with aiohttp and pydantic.
At the moment, functionality only allows one to query articles and publish/update an existing article.
Installation
Currently there are no Pypi wheels, use
pip install git+https://github.com/AlejandroGomezFrieiro/devto_py.git
Usage
from devto.client import DevtoClient
from devto.models import DevtoArticle
import asyncio
# Get published articles
async def main():
async with DevtoClient() as client:
return await client.published_articles()
asyncio.run(main())
async def publish_article(article):
async with DevtoClient(api_key = "<API_KEY>") as client:
return await client.publish_article(article)
article = DevtoArticle(
title="title",
body_markdown="Article body"
)
asyncio.run(publish_article(article))
async def edit_article(article):
async with DevtoClient(api_key = "<API_KEY>") as client:
return await client.update_article(article)
asyncio.run(edit_article(article))
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file devto-0.1.3.tar.gz.
File metadata
- Download URL: devto-0.1.3.tar.gz
- Upload date:
- Size: 39.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b03253d5287d9edb59bcefd6c3302e9b97c23b9cd78bdeafbe5e0bf940864a20
|
|
| MD5 |
2a6d1749e3f3c96ff89a50a220e4a67b
|
|
| BLAKE2b-256 |
d7fff5a018d646384a9eb7488371f13953866a2d8c3a1561e1bf98d40763ece9
|
Provenance
The following attestation bundles were made for devto-0.1.3.tar.gz:
Publisher:
cicd.yaml on AlejandroGomezFrieiro/devto.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devto-0.1.3.tar.gz -
Subject digest:
b03253d5287d9edb59bcefd6c3302e9b97c23b9cd78bdeafbe5e0bf940864a20 - Sigstore transparency entry: 159842720
- Sigstore integration time:
-
Permalink:
AlejandroGomezFrieiro/devto.py@c89f66c622dce496bf4b7a0a20b41b105c2c8c5b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AlejandroGomezFrieiro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cicd.yaml@c89f66c622dce496bf4b7a0a20b41b105c2c8c5b -
Trigger Event:
push
-
Statement type:
File details
Details for the file devto-0.1.3-py3-none-any.whl.
File metadata
- Download URL: devto-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75026291a12eaa7c791ff23af5efb13973735218afe933514fbb0fc24bf84cd8
|
|
| MD5 |
ab0548b8d7851239964fb8257f76c45f
|
|
| BLAKE2b-256 |
7261a43a9cd28c67edc5d891be4cf1d1e57fbcb154f02d597d2a04a589dee74e
|
Provenance
The following attestation bundles were made for devto-0.1.3-py3-none-any.whl:
Publisher:
cicd.yaml on AlejandroGomezFrieiro/devto.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devto-0.1.3-py3-none-any.whl -
Subject digest:
75026291a12eaa7c791ff23af5efb13973735218afe933514fbb0fc24bf84cd8 - Sigstore transparency entry: 159842722
- Sigstore integration time:
-
Permalink:
AlejandroGomezFrieiro/devto.py@c89f66c622dce496bf4b7a0a20b41b105c2c8c5b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AlejandroGomezFrieiro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cicd.yaml@c89f66c622dce496bf4b7a0a20b41b105c2c8c5b -
Trigger Event:
push
-
Statement type: