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()

    # Authorize (only needed once)
    user = twitter_api.get_user_info()

    # 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-1.1.tar.gz (3.3 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-1.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for x_pyapi-1.1.tar.gz
Algorithm Hash digest
SHA256 0e6f52cd850420cea4d2317d2fd2ea997e031727f3caaa952873e372501bfb34
MD5 8b4d96fc676ae15ff23cc2a7195e5afe
BLAKE2b-256 2ce4ebd9c8553f0ed47d905b1f2f90f81f0d8a189c75eafb23a05ad7fe546629

See more details on using hashes here.

File details

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

File metadata

  • Download URL: X_pyAPI-1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea74b083de7233d623844d9c1e2258187df8dcafd560fb16743c92fa3db8a216
MD5 31a5bff0e53544051eb4b90daa845745
BLAKE2b-256 825a00a3423806b93d3157766d50cc1281cd6360e021dc163efe8932ad3523ef

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