An asynchronous Python client for interacting with the X API.
Project description
Xify
Xify is a Python client for interacting with the X (formerly Twitter) API. This library provides an asynchronous interface to perform common tasks like creating tweets as well as providing authentication and custom error handling.
Features
- Send Tweets: Contains functionality to send tweets.
- OAuth 1.0a Authentication: Sign and authenticate requests to the X API.
- Async HTTP Requests: Uses
aiohttpfor efficient, non-blocking network operations. - Developer Experience: Includes ruff, mypy, pre-commit, and commitizen for high-quality code.
Installation
From PyPI (Recommended)
pip install xify
From Source
You can install Xify by cloning the repository directly or using pre-built wheel files.
Prerequisites: This project requires uv for dependency management.
Option 1: Clone and Build
-
Clone the repository:
git clone https://github.com/filming/xify.git cd xify
-
Install the project and its dependencies:
uv sync
Option 2: Install from Pre-built Wheels
Pre-built wheel files are attached to each GitHub release. You can download and install them directly:
- Go to the GitHub releases page
- Download the
.whlfile from the latest release - Install using pip:
pip install path/to/downloaded/xify-*.whl
Usage
Here's a basic example of how to use Xify to send out a tweet:
import asyncio
from xify import Xify
async def main():
consumer_key = "1111111111"
consumer_secret = "2222222222"
access_token = "3333333333"
access_token_secret = "4444444444"
async with Xify(
consumer_key=consumer_key,
consumer_secret=consumer_secret,
access_token=access_token,
access_token_secret=access_token_secret,
) as client:
response = await client.tweet({"msg": "hello!"})
if __name__ == "__main__":
asyncio.run(main())
Development
This project uses modern Python development tools:
- uv for dependency management
- ruff for linting and formatting
- mypy for type checking
- pre-commit for git hooks
- commitizen for conventional commits
Setting up for development:
-
Clone the repository:
git clone https://github.com/filming/xify.git cd xify
-
Install dependencies (including dev tools):
uv sync --extra dev
-
Set up pre-commit hooks:
uv run pre-commit install
-
Start developing!
Dependencies
All project dependencies are managed via pyproject.toml and use Python 3.10+.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions, bug reports, and feature requests are welcome! Please open an issue or submit a pull request on GitHub.
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 xify-2.1.0.tar.gz.
File metadata
- Download URL: xify-2.1.0.tar.gz
- Upload date:
- Size: 103.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ced1d8d335d3724deac34dd2ffddd02407aa618bcf54c8516f5e3fbad2c2f6a
|
|
| MD5 |
925d406e8c2d1fb365f95cc4ee0a4b94
|
|
| BLAKE2b-256 |
cf947fe196f0ae08739ce10027ca816a793bef85770d6fe612d3ef8b041a6ac4
|
Provenance
The following attestation bundles were made for xify-2.1.0.tar.gz:
Publisher:
release.yml on filming/xify
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xify-2.1.0.tar.gz -
Subject digest:
5ced1d8d335d3724deac34dd2ffddd02407aa618bcf54c8516f5e3fbad2c2f6a - Sigstore transparency entry: 522602900
- Sigstore integration time:
-
Permalink:
filming/xify@b07274145988ebb515e3142adafe12598d592f9d -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/filming
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b07274145988ebb515e3142adafe12598d592f9d -
Trigger Event:
push
-
Statement type:
File details
Details for the file xify-2.1.0-py3-none-any.whl.
File metadata
- Download URL: xify-2.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
033edf435c9fbc61209c52aacbb5203258fc36246bf858a385035be3f0186c7c
|
|
| MD5 |
d22a3202bfe93847da3665394b552caf
|
|
| BLAKE2b-256 |
f0212483e01cf6fb8d9a7e7a0d6ed180b44f99ba9952e0c3fb8bb27b979b1b41
|
Provenance
The following attestation bundles were made for xify-2.1.0-py3-none-any.whl:
Publisher:
release.yml on filming/xify
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xify-2.1.0-py3-none-any.whl -
Subject digest:
033edf435c9fbc61209c52aacbb5203258fc36246bf858a385035be3f0186c7c - Sigstore transparency entry: 522602905
- Sigstore integration time:
-
Permalink:
filming/xify@b07274145988ebb515e3142adafe12598d592f9d -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/filming
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b07274145988ebb515e3142adafe12598d592f9d -
Trigger Event:
push
-
Statement type: