prefect-twitter


Nameprefect-twitter JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://github.com/PrefectHQ/prefect-twitter
SummaryPrefect integrations for interacting with Twitter.
upload_time2023-11-29 19:58:18
maintainer
docs_urlNone
authorPrefect Technologies, Inc.
requires_python>=3.7
licenseApache License 2.0
keywords prefect
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # prefect-twitter

<p align="center">
    <!--- Insert a cover image here -->
    <!--- <br> -->
    <a href="https://pypi.python.org/pypi/prefect-twitter/" alt="PyPI version">
        <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-twitter?color=0052FF&labelColor=090422"></a>
    <a href="https://github.com/PrefectHQ/prefect-twitter/" alt="Stars">
        <img src="https://img.shields.io/github/stars/PrefectHQ/prefect-twitter?color=0052FF&labelColor=090422" /></a>
    <a href="https://pepy.tech/badge/prefect-twitter/" alt="Downloads">
        <img src="https://img.shields.io/pypi/dm/prefect-twitter?color=0052FF&labelColor=090422" /></a>
    <a href="https://github.com/PrefectHQ/prefect-twitter/pulse" alt="Activity">
        <img src="https://img.shields.io/github/commit-activity/m/PrefectHQ/prefect-twitter?color=0052FF&labelColor=090422" /></a>
    <br>
    <a href="https://prefect-community.slack.com" alt="Slack">
        <img src="https://img.shields.io/badge/slack-join_community-red.svg?color=0052FF&labelColor=090422&logo=slack" /></a>
    <a href="https://discourse.prefect.io/" alt="Discourse">
        <img src="https://img.shields.io/badge/discourse-browse_forum-red.svg?color=0052FF&labelColor=090422&logo=discourse" /></a>
</p>

Visit the full docs [here](https://PrefectHQ.github.io/prefect-twitter) to see additional examples and the API reference.

Prefect integrations for interacting with Twitter.


<!--- ### Add a real-world example of how to use this Collection here

Offer some motivation on why this helps.

After installing `prefect-twitter` and [saving the credentials](#saving-credentials-to-block), you can easily use it within your flows to help you achieve the aforementioned benefits!

```python
from prefect import flow, get_run_logger
```

--->

## Resources

For more tips on how to use tasks and flows in a Collection, check out [Using Collections](https://orion-docs.prefect.io/collections/usage/)!

### Installation

Install `prefect-twitter` with `pip`:

```bash
pip install prefect-twitter
```

Requires an installation of Python 3.7+.

We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.

These tasks are designed to work with Prefect 2. For more information about how to use Prefect, please refer to the [Prefect documentation](https://orion-docs.prefect.io/).

<!--- ### Saving credentials to block

Note, to use the `load` method on Blocks, you must already have a block document [saved through code](https://orion-docs.prefect.io/concepts/blocks/#saving-blocks) or [saved through the UI](https://orion-docs.prefect.io/ui/blocks/).

Below is a walkthrough on saving block documents through code.

1. Head over to <SERVICE_URL>.
2. Login to your <SERVICE> account.
3. Click "+ Create new secret key".
4. Copy the generated API key.
5. Create a short script, replacing the placeholders (or do so in the UI).

```python
from {{ cookiecutter.collection_slug }} import Block
Block(api_key="API_KEY_PLACEHOLDER").save("BLOCK_NAME_PLACEHOLDER")
```

Congrats! You can now easily load the saved block, which holds your credentials:

```python
from {{ cookiecutter.collection_slug }} import Block
Block.load("BLOCK_NAME_PLACEHOLDER")
```

!!! info "Registering blocks"

    Register blocks in this module to
    [view and edit them](https://orion-docs.prefect.io/ui/blocks/)
    on Prefect Cloud:

    ```bash
    prefect block register -m {{ cookiecutter.collection_slug }}
    ```

A list of available blocks in `{{ cookiecutter.collection_name }}` and their setup instructions can be found [here](https://{{ cookiecutter.github_organization }}.github.io/{{ cookiecutter.collection_name }}/blocks_catalog).

--->

### Write and run a flow

Tweets an update with just text.
```python
from prefect import flow
from prefect_twitter import TwitterCredentials
from prefect_twitter.tweets import update_status

@flow
def example_update_status_flow():
    twitter_credentials = TwitterCredentials(
        consumer_key="consumer_key",
        consumer_secret="consumer_secret",
        access_token="access_token",
        access_token_secret="access_token_secret"
    )
    status_id = update_status(twitter_credentials, status="A Prefect Tweet!")
    return status_id

example_update_status_flow()
```

### Feedback

If you encounter and bugs while using `prefect-twitter`, feel free to open an issue in the [prefect-twitter](https://github.com/PrefectHQ/prefect-twitter) repository.

If you have any questions or issues while using `prefect-twitter`, you can find help in either the [Prefect Discourse forum](https://discourse.prefect.io/) or the [Prefect Slack community](https://prefect.io/slack).

Feel free to star or watch [`prefect-twitter`](https://github.com/PrefectHQ/prefect-twitter) for updates too!

## Development

### Contributing

If you'd like to help contribute to fix an issue or add a feature to `prefect-twitter`, please [propose changes through a pull request from a fork of the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).


Here are the steps:
 
1. [Fork the repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo#forking-a-repository)
2. [Clone the forked repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo#cloning-your-forked-repository)
3. Install the repository and its dependencies:
```
pip install -e ".[dev]"
```
4. Make desired changes
5. Add tests
6. Insert an entry to [CHANGELOG.md](https://github.com/PrefectHQ/prefect-twitter/blob/main/CHANGELOG.md)
7. Install `pre-commit` to perform quality checks prior to commit:
```
 pre-commit install
 ```
8. `git commit`, `git push`, and create a pull request

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/PrefectHQ/prefect-twitter",
    "name": "prefect-twitter",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "prefect",
    "author": "Prefect Technologies, Inc.",
    "author_email": "help@prefect.io",
    "download_url": "https://files.pythonhosted.org/packages/f3/67/fed0a869ca1d32b3f18192b89a637f8dff857a8102da2ce5aef68dc0f345/prefect-twitter-0.2.2.tar.gz",
    "platform": null,
    "description": "# prefect-twitter\n\n<p align=\"center\">\n    <!--- Insert a cover image here -->\n    <!--- <br> -->\n    <a href=\"https://pypi.python.org/pypi/prefect-twitter/\" alt=\"PyPI version\">\n        <img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/prefect-twitter?color=0052FF&labelColor=090422\"></a>\n    <a href=\"https://github.com/PrefectHQ/prefect-twitter/\" alt=\"Stars\">\n        <img src=\"https://img.shields.io/github/stars/PrefectHQ/prefect-twitter?color=0052FF&labelColor=090422\" /></a>\n    <a href=\"https://pepy.tech/badge/prefect-twitter/\" alt=\"Downloads\">\n        <img src=\"https://img.shields.io/pypi/dm/prefect-twitter?color=0052FF&labelColor=090422\" /></a>\n    <a href=\"https://github.com/PrefectHQ/prefect-twitter/pulse\" alt=\"Activity\">\n        <img src=\"https://img.shields.io/github/commit-activity/m/PrefectHQ/prefect-twitter?color=0052FF&labelColor=090422\" /></a>\n    <br>\n    <a href=\"https://prefect-community.slack.com\" alt=\"Slack\">\n        <img src=\"https://img.shields.io/badge/slack-join_community-red.svg?color=0052FF&labelColor=090422&logo=slack\" /></a>\n    <a href=\"https://discourse.prefect.io/\" alt=\"Discourse\">\n        <img src=\"https://img.shields.io/badge/discourse-browse_forum-red.svg?color=0052FF&labelColor=090422&logo=discourse\" /></a>\n</p>\n\nVisit the full docs [here](https://PrefectHQ.github.io/prefect-twitter) to see additional examples and the API reference.\n\nPrefect integrations for interacting with Twitter.\n\n\n<!--- ### Add a real-world example of how to use this Collection here\n\nOffer some motivation on why this helps.\n\nAfter installing `prefect-twitter` and [saving the credentials](#saving-credentials-to-block), you can easily use it within your flows to help you achieve the aforementioned benefits!\n\n```python\nfrom prefect import flow, get_run_logger\n```\n\n--->\n\n## Resources\n\nFor more tips on how to use tasks and flows in a Collection, check out [Using Collections](https://orion-docs.prefect.io/collections/usage/)!\n\n### Installation\n\nInstall `prefect-twitter` with `pip`:\n\n```bash\npip install prefect-twitter\n```\n\nRequires an installation of Python 3.7+.\n\nWe recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.\n\nThese tasks are designed to work with Prefect 2. For more information about how to use Prefect, please refer to the [Prefect documentation](https://orion-docs.prefect.io/).\n\n<!--- ### Saving credentials to block\n\nNote, to use the `load` method on Blocks, you must already have a block document [saved through code](https://orion-docs.prefect.io/concepts/blocks/#saving-blocks) or [saved through the UI](https://orion-docs.prefect.io/ui/blocks/).\n\nBelow is a walkthrough on saving block documents through code.\n\n1. Head over to <SERVICE_URL>.\n2. Login to your <SERVICE> account.\n3. Click \"+ Create new secret key\".\n4. Copy the generated API key.\n5. Create a short script, replacing the placeholders (or do so in the UI).\n\n```python\nfrom {{ cookiecutter.collection_slug }} import Block\nBlock(api_key=\"API_KEY_PLACEHOLDER\").save(\"BLOCK_NAME_PLACEHOLDER\")\n```\n\nCongrats! You can now easily load the saved block, which holds your credentials:\n\n```python\nfrom {{ cookiecutter.collection_slug }} import Block\nBlock.load(\"BLOCK_NAME_PLACEHOLDER\")\n```\n\n!!! info \"Registering blocks\"\n\n    Register blocks in this module to\n    [view and edit them](https://orion-docs.prefect.io/ui/blocks/)\n    on Prefect Cloud:\n\n    ```bash\n    prefect block register -m {{ cookiecutter.collection_slug }}\n    ```\n\nA list of available blocks in `{{ cookiecutter.collection_name }}` and their setup instructions can be found [here](https://{{ cookiecutter.github_organization }}.github.io/{{ cookiecutter.collection_name }}/blocks_catalog).\n\n--->\n\n### Write and run a flow\n\nTweets an update with just text.\n```python\nfrom prefect import flow\nfrom prefect_twitter import TwitterCredentials\nfrom prefect_twitter.tweets import update_status\n\n@flow\ndef example_update_status_flow():\n    twitter_credentials = TwitterCredentials(\n        consumer_key=\"consumer_key\",\n        consumer_secret=\"consumer_secret\",\n        access_token=\"access_token\",\n        access_token_secret=\"access_token_secret\"\n    )\n    status_id = update_status(twitter_credentials, status=\"A Prefect Tweet!\")\n    return status_id\n\nexample_update_status_flow()\n```\n\n### Feedback\n\nIf you encounter and bugs while using `prefect-twitter`, feel free to open an issue in the [prefect-twitter](https://github.com/PrefectHQ/prefect-twitter) repository.\n\nIf you have any questions or issues while using `prefect-twitter`, you can find help in either the [Prefect Discourse forum](https://discourse.prefect.io/) or the [Prefect Slack community](https://prefect.io/slack).\n\nFeel free to star or watch [`prefect-twitter`](https://github.com/PrefectHQ/prefect-twitter) for updates too!\n\n## Development\n\n### Contributing\n\nIf you'd like to help contribute to fix an issue or add a feature to `prefect-twitter`, please [propose changes through a pull request from a fork of the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).\n\n\nHere are the steps:\n \n1. [Fork the repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo#forking-a-repository)\n2. [Clone the forked repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo#cloning-your-forked-repository)\n3. Install the repository and its dependencies:\n```\npip install -e \".[dev]\"\n```\n4. Make desired changes\n5. Add tests\n6. Insert an entry to [CHANGELOG.md](https://github.com/PrefectHQ/prefect-twitter/blob/main/CHANGELOG.md)\n7. Install `pre-commit` to perform quality checks prior to commit:\n```\n pre-commit install\n ```\n8. `git commit`, `git push`, and create a pull request\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Prefect integrations for interacting with Twitter.",
    "version": "0.2.2",
    "project_urls": {
        "Homepage": "https://github.com/PrefectHQ/prefect-twitter"
    },
    "split_keywords": [
        "prefect"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a2d9cbffd625c54a905f049387bd5bdd0dd8f4da1f12ed81b974f6aafbaf19d",
                "md5": "22485f08db2783ea366f46d54c94ba55",
                "sha256": "9ea5066344e081754f54464d18835b45aaaa71f0ef0e63d0b4d70c2f284241aa"
            },
            "downloads": -1,
            "filename": "prefect_twitter-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "22485f08db2783ea366f46d54c94ba55",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 12719,
            "upload_time": "2023-11-29T19:58:17",
            "upload_time_iso_8601": "2023-11-29T19:58:17.636890Z",
            "url": "https://files.pythonhosted.org/packages/6a/2d/9cbffd625c54a905f049387bd5bdd0dd8f4da1f12ed81b974f6aafbaf19d/prefect_twitter-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f367fed0a869ca1d32b3f18192b89a637f8dff857a8102da2ce5aef68dc0f345",
                "md5": "17dcc6dd5e5f26f50bb4e7e93877f9a6",
                "sha256": "8ce1fb5477857cc238988637145cf025f427ffd83c47f6b9444f0e2660854d76"
            },
            "downloads": -1,
            "filename": "prefect-twitter-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "17dcc6dd5e5f26f50bb4e7e93877f9a6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 32011,
            "upload_time": "2023-11-29T19:58:18",
            "upload_time_iso_8601": "2023-11-29T19:58:18.774953Z",
            "url": "https://files.pythonhosted.org/packages/f3/67/fed0a869ca1d32b3f18192b89a637f8dff857a8102da2ce5aef68dc0f345/prefect-twitter-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-29 19:58:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PrefectHQ",
    "github_project": "prefect-twitter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "prefect-twitter"
}
        
Elapsed time: 0.16321s