Skip to main content

A Python client library for interacting with the dev.to API. Easily access key dev.to features including article retrieval, posting, and user information management.

Project description

DevToPy

DevToPy is a Python client library for interacting with the dev.to API. It provides easy access to key dev.to features including article retrieval, posting, user information management, and more.

Installation

You can install DevToPy using pip:

pip install devtopy

Quick Start

Here's a quick example of how to use DevToPy:

from devtopy import DevTo

# Initialize the client with your API key
client = DevTo(api_key="your_api_key_here")

# Get the latest articles
latest_articles = client.articles.get_latest_articles()

# Publish a new article
new_article = client.articles.publish(
    title="My New Article",
    body_markdown="This is the content of my article.",
    tags=["python", "api"],
    published=True
)

# Get your own articles
my_articles = client.articles.get_my_articles()

# Get comments for an article
article_comments = client.comments.get_article_comments(article_id="123")

# Toggle a reaction on an article
client.reactions.toggle(
    category=client.reactions.ReactionCategory.LIKE,
    reactable_id=123,
    reactable_type=client.reactions.ReactableType.ARTICLE
)

Features

DevToPy now supports the following operations:

  • Articles: Retrieve, publish, update, and manage articles
  • Comments: Get comments for articles and podcast episodes
  • Followed Tags: Manage followed tags
  • Organizations: Retrieve organization information and users
  • Podcast Episodes: Get podcast episode information
  • Profile Images: Retrieve user profile images
  • Reactions: Add and toggle reactions on articles, comments, and users
  • Tags: Retrieve tag information
  • Users: Get user information, invite users
  • Videos: Retrieve articles with videos

API Reference

For detailed information on all available methods, please refer to the API documentation.

Requirements

  • Python 3.8+
  • pydantic >= 2.8.2
  • requests >= 2.32.3

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

devtopy-0.1.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

devtopy-0.1.1-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file devtopy-0.1.1.tar.gz.

File metadata

  • Download URL: devtopy-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for devtopy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 31ee047c370d1998537306304e458507ca4aa65c4b2d50947f1be3825641815d
MD5 3a82b6620961cd9730287058653c6ec7
BLAKE2b-256 1d0d065ef1f2aea870874fa2b37547e7ac4d804be7224bd8adf80ed0e2af31f7

See more details on using hashes here.

File details

Details for the file devtopy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: devtopy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for devtopy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 503260c175ff406d533b4847f2cd5a4e608d61fc0c3f6fe2bf6019530f3c389d
MD5 855640be721c69423ece38a807c37406
BLAKE2b-256 16345de0dc0651e96fd0389bfed4c9e69c0b7b45859a68fba9ea524fd80a5fd1

See more details on using hashes here.

Supported by

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