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.
- 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.
pip install xifyYou can install Xify by cloning the repository directly or using pre-built wheel files.
Prerequisites: This project requires uv for dependency management.
-
Clone the repository:
git clone https://github.com/filming/xify.git cd xify -
Install the project and its dependencies:
uv sync
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
Here's a basic example of how to use Xify to send out a tweet:
import asyncio
from xify import Xify
async def main():
x_consumer_key = "1111111111"
x_consumer_secret = "2222222222"
x_access_token = "3333333333"
x_access_token_secret = "4444444444"
async with Xify(
x_consumer_key=x_consumer_key,
x_consumer_secret=x_consumer_secret,
x_access_token=x_access_token,
x_access_token_secret=x_access_token_secret,
) as client:
response = await client.tweet({"msg": "hello!"})
if __name__ == "__main__":
asyncio.run(main())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
-
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!
All project dependencies are managed via pyproject.toml and use Python 3.10+.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions, bug reports, and feature requests are welcome! Please open an issue or submit a pull request on GitHub.