Skip to main content

A simple Python library for posting tweets on X.com using new X API v2.

Project description

X API Python Package

A simple Python library for posting tweets on X.com using X API v2.

Installation

You can install the package using pip:

pip install x-pyapi

Usage

from x_pyAPI import X_API

# Twitter API credentials
CONSUMER_KEY = 'your_consumer_key'
CONSUMER_SECRET = 'your_consumer_secret'

def main():
    # Initialize API
    twitter_api = X_API(CONSUMER_KEY, CONSUMER_SECRET)

    # Authorize (only needed once)
    twitter_api.authorize()

    # Post a tweet
    tweet_text = "Hello world!"
    twitter_api.post_tweet(tweet_text)

if __name__ == "__main__":
    main()

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

x_pyapi-0.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

X_pyAPI-0.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file x_pyapi-0.2.tar.gz.

File metadata

  • Download URL: x_pyapi-0.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for x_pyapi-0.2.tar.gz
Algorithm Hash digest
SHA256 bbb66a63be8dabdf47134db576fa96d4b5314c2f53325bcdeaae8d99733dbf7a
MD5 371455c006b10ebb9c61bbd9fb850a12
BLAKE2b-256 45f384362e7e5e7de96fce057e64a10b696624ff917898cffade48e53a9dd0da

See more details on using hashes here.

File details

Details for the file X_pyAPI-0.2-py3-none-any.whl.

File metadata

  • Download URL: X_pyAPI-0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for X_pyAPI-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dc6fc4966da49e265104e37e45cf17836217d25d4023a2a7359cfb1566f0546a
MD5 f2362b2006f7c84d2e8ef7ab7d3a56da
BLAKE2b-256 db0c019c56f4af4c1a7819b185488e6c106077b9d538b4006c211eb346eed55a

See more details on using hashes here.

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