Skip to main content

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

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devto-0.1.3.tar.gz (39.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devto-0.1.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

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

Hashes for devto-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b03253d5287d9edb59bcefd6c3302e9b97c23b9cd78bdeafbe5e0bf940864a20
MD5 2a6d1749e3f3c96ff89a50a220e4a67b
BLAKE2b-256 d7fff5a018d646384a9eb7488371f13953866a2d8c3a1561e1bf98d40763ece9

See more details on using hashes here.

Provenance

The following attestation bundles were made for devto-0.1.3.tar.gz:

Publisher: cicd.yaml on AlejandroGomezFrieiro/devto.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for devto-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 75026291a12eaa7c791ff23af5efb13973735218afe933514fbb0fc24bf84cd8
MD5 ab0548b8d7851239964fb8257f76c45f
BLAKE2b-256 7261a43a9cd28c67edc5d891be4cf1d1e57fbcb154f02d597d2a04a589dee74e

See more details on using hashes here.

Provenance

The following attestation bundles were made for devto-0.1.3-py3-none-any.whl:

Publisher: cicd.yaml on AlejandroGomezFrieiro/devto.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page