not-my-ex


Namenot-my-ex JSON
Version 0.0.4 PyPI version JSON
download
home_page
SummaryTiny CLI to post simultaneously to Mastodon and Bluesky
upload_time2024-02-24 00:29:19
maintainer
docs_urlNone
authorEduardo Cuducos
requires_python>=3.9,<3.13
licenseGPL-3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Not my ex

Tiny CLI to post simultaneously to Mastodon and Bluesky.

<small>Obviously, based on [`cuducos/from-my-ex`](https://github.com/cuducos/from-my-ex).</small>

It supports:
* Post status updates to both networks with a simple CLI command
* Posting with images
* Including alt text for images
* Setting post language

It does not support:
* Tagging other users (they would have different IDs and servers in each platform)

## Getting started

### Requirements

* Python 3.9 or newer
* [Poetry](https://python-poetry.org)

#### Environment variables

##### To repost in [Bluesky](https://bsky.app)

| Name | Description | Example | Default value |
|---|---|---|---|
| `NOT_MY_EX_BSKY_AGENT` | Bluesky instance | `"https://bsky.social"` | `"https://bsky.social"` |
| `NOT_MY_EX_BSKY_EMAIL` | Email used in Bluesky | `"cuducos@mailinator.com"` | `None` |
| `NOT_MY_EX_BSKY_PASSWORD` | Password used in Bluesky | As created in [App Passwords](https://bsky.app/settings/app-passwords). | `None` |

Not setting `NOT_MY_EX_BSKY_EMAIL` **or** `NOT_MY_EX_BSKY_PASSWORD` disables Bluesky reposting.

##### To repost in [Mastodon](https://joinmastodon.org/)

| Name | Description | Example | Default value |
|---|---|---|---|
| `NOT_MY_EX_MASTODON_INSTANCE` | Mastodon instance | `"https://tech.lgbt"` | `"https://mastodon.social"` |
| `NOT_MY_EX_MASTODON_TOKEN` | Mastodon access token | Go to your _Settings_, _Development_ and then create an app to get the access token. Select the `write:statuses` and `write:media` scopes. | `None` |

Not setting `NOT_MY_EX_MASTODON_TOKEN` disables Mastodon reposting.

## Install

```console
$ pip install not-my-ex
```

## Usage


### CLI

```console
$ not-my-ex "Magic, madness, heaven, sin " --images /tmp/1989.gif
```

You can skip `--images` or pass multiple images  (e.g. `--images taylor.jpg --images swift.gif`).

### API

```python
from asyncio import gather

from httpx import AsyncClient

from not_my_ex.bluesky import Bluesky
from not_my_ex.mastodon import Mastodon
from not_my_ex.media import Media
from not_my_ex.post import Post


async def main():
    media_tasks = tuple(
        Media.from_img(path, alt=alt)
        for path, alt in (("taylor.jpg", "Taylor"), ("swift.jpg", "Swift"))
    )
    media = await gather(*media_tasks)

    post = Post(text="Magic, madness, heaven, sin ", media=media, lang="en")
    async with AsyncClient() as http:
        post_tasks = tuple(cls(http).post(post) for cls in (Bluesky, Mastodon))
        await gather(*post_tasks)
```

In `Post`, both `media` and `lang` are optional. In `Media`, `alt` is optional.

## Contributing

The tests include [Ruff](https://docs.astral.sh/ruff/) and [Mypy](https://www.mypy-lang.org/):

```console
$ poetry install
$ poetry run pytest
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "not-my-ex",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<3.13",
    "maintainer_email": "",
    "keywords": "",
    "author": "Eduardo Cuducos",
    "author_email": "4732915+cuducos@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/aa/e7/387c56d33e419893850577d4c1ccf137a5ba0a6b718a4b69617eab01e8a4/not_my_ex-0.0.4.tar.gz",
    "platform": null,
    "description": "# Not my ex\n\nTiny CLI to post simultaneously to Mastodon and Bluesky.\n\n<small>Obviously, based on [`cuducos/from-my-ex`](https://github.com/cuducos/from-my-ex).</small>\n\nIt supports:\n* Post status updates to both networks with a simple CLI command\n* Posting with images\n* Including alt text for images\n* Setting post language\n\nIt does not support:\n* Tagging other users (they would have different IDs and servers in each platform)\n\n## Getting started\n\n### Requirements\n\n* Python 3.9 or newer\n* [Poetry](https://python-poetry.org)\n\n#### Environment variables\n\n##### To repost in [Bluesky](https://bsky.app)\n\n| Name | Description | Example | Default value |\n|---|---|---|---|\n| `NOT_MY_EX_BSKY_AGENT` | Bluesky instance | `\"https://bsky.social\"` | `\"https://bsky.social\"` |\n| `NOT_MY_EX_BSKY_EMAIL` | Email used in Bluesky | `\"cuducos@mailinator.com\"` | `None` |\n| `NOT_MY_EX_BSKY_PASSWORD` | Password used in Bluesky | As created in [App Passwords](https://bsky.app/settings/app-passwords). | `None` |\n\nNot setting `NOT_MY_EX_BSKY_EMAIL` **or** `NOT_MY_EX_BSKY_PASSWORD` disables Bluesky reposting.\n\n##### To repost in [Mastodon](https://joinmastodon.org/)\n\n| Name | Description | Example | Default value |\n|---|---|---|---|\n| `NOT_MY_EX_MASTODON_INSTANCE` | Mastodon instance | `\"https://tech.lgbt\"` | `\"https://mastodon.social\"` |\n| `NOT_MY_EX_MASTODON_TOKEN` | Mastodon access token | Go to your _Settings_, _Development_ and then create an app to get the access token. Select the `write:statuses` and `write:media` scopes. | `None` |\n\nNot setting `NOT_MY_EX_MASTODON_TOKEN` disables Mastodon reposting.\n\n## Install\n\n```console\n$ pip install not-my-ex\n```\n\n## Usage\n\n\n### CLI\n\n```console\n$ not-my-ex \"Magic, madness, heaven, sin \" --images /tmp/1989.gif\n```\n\nYou can skip `--images` or pass multiple images  (e.g. `--images taylor.jpg --images swift.gif`).\n\n### API\n\n```python\nfrom asyncio import gather\n\nfrom httpx import AsyncClient\n\nfrom not_my_ex.bluesky import Bluesky\nfrom not_my_ex.mastodon import Mastodon\nfrom not_my_ex.media import Media\nfrom not_my_ex.post import Post\n\n\nasync def main():\n    media_tasks = tuple(\n        Media.from_img(path, alt=alt)\n        for path, alt in ((\"taylor.jpg\", \"Taylor\"), (\"swift.jpg\", \"Swift\"))\n    )\n    media = await gather(*media_tasks)\n\n    post = Post(text=\"Magic, madness, heaven, sin \", media=media, lang=\"en\")\n    async with AsyncClient() as http:\n        post_tasks = tuple(cls(http).post(post) for cls in (Bluesky, Mastodon))\n        await gather(*post_tasks)\n```\n\nIn `Post`, both `media` and `lang` are optional. In `Media`, `alt` is optional.\n\n## Contributing\n\nThe tests include [Ruff](https://docs.astral.sh/ruff/) and [Mypy](https://www.mypy-lang.org/):\n\n```console\n$ poetry install\n$ poetry run pytest\n```\n",
    "bugtrack_url": null,
    "license": "GPL-3",
    "summary": "Tiny CLI to post simultaneously to Mastodon and Bluesky",
    "version": "0.0.4",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "37459aa5d06be96f50f9cde4102f8a336ca8acf2eb4156721acb0b0135f571d3",
                "md5": "ffda6536a1ef67ad95e6fef9aeaafe4e",
                "sha256": "4c1ff3ff15e044f08a6004ef9fa42fb04973a657e46a9baf7bc5867f047bb335"
            },
            "downloads": -1,
            "filename": "not_my_ex-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ffda6536a1ef67ad95e6fef9aeaafe4e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<3.13",
            "size": 21563,
            "upload_time": "2024-02-24T00:29:17",
            "upload_time_iso_8601": "2024-02-24T00:29:17.755310Z",
            "url": "https://files.pythonhosted.org/packages/37/45/9aa5d06be96f50f9cde4102f8a336ca8acf2eb4156721acb0b0135f571d3/not_my_ex-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aae7387c56d33e419893850577d4c1ccf137a5ba0a6b718a4b69617eab01e8a4",
                "md5": "19c0394fbd3ca1b27d7e63e804509726",
                "sha256": "2b71c3813208aab672ff1c136ea89e45d0d56c1b52d2865c9170f7abc52a0802"
            },
            "downloads": -1,
            "filename": "not_my_ex-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "19c0394fbd3ca1b27d7e63e804509726",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<3.13",
            "size": 19600,
            "upload_time": "2024-02-24T00:29:19",
            "upload_time_iso_8601": "2024-02-24T00:29:19.518676Z",
            "url": "https://files.pythonhosted.org/packages/aa/e7/387c56d33e419893850577d4c1ccf137a5ba0a6b718a4b69617eab01e8a4/not_my_ex-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-24 00:29:19",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "not-my-ex"
}
        
Elapsed time: 0.17875s