xpost


Namexpost JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/1darshanpatil/xpost
SummaryA CLI for managing Twitter APIs and Twitter posts.
upload_time2023-12-02 13:11:35
maintainer
docs_urlNone
authorDarshan P.
requires_python>=3.6
licenseMIT
keywords twitter cli api tweet social media
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![xpost-logo.png](https://github.com/1darshanpatil/foundMyOldPomodoroProject/assets/72539638/0620222e-0ea1-4a27-904b-5486a503a184)

# xpost - Python CLI for Twitter Operations

xpost is a command-line interface (CLI) Python package for interacting with Twitter. It allows users to tweet, add users, store API credentials securely, and delete tweets.

## Features

- **Tweeting**: Effortlessly post tweets from the command line.
- **Credential Storage**: Securely encrypt and store your Twitter API credentials using the robust `PBKDF2HMAC` algorithms, ensuring security.
- **Tweet Deletion**: Conveniently delete tweets with a simple command.

## Installation

Install xpost using pip:

```bash
pip install xpost
```

Verify the installation by checking the versio: 
```bash
xpost --version
```

## Usage

### Adding user Authentication Credentials
Securely store your Twitter API credentials:

```bash
$ x-config add_user
Enter a username to encrypt your APIs: usrDarwin
Set a password to secure your encrypted APIs:
Confirm your password:
Enter CLIENT_ID: client_id
Enter CLIENT_SECRET: client_secret
Enter API_KEY: api_key
Enter API_KEY_SECRET: apiKey
Enter BEARER_TOKEN: bTokn
Enter ACCESS_TOKEN: aTokn
Enter ACCESS_TOKEN_SECRET: aTokn_secret
Saving your encrypted data...
-Credentials encrypted and stored successfully.
Saving completed. Data stored at: ~/.tweet

User credentials successfully added.
```

### Viewing Stored Credentials
Check your encrypted credentials:
```bash
$ ls ~/.tweet
```
Or view decrypted credentials:
```python
>>> import xpost as x
>>> x.show_credentials()
Enter your username to decrypt your APIs: test_usr
Enter your password to decrypt your APIs:
{'CLIENT_ID': 'client_id', 'CLIENT_SECRET': 'client_secret', 'API_KEY': 'api_key', 'API_KEY_SECRET': 'apiKey', 'BEARER_TOKEN': 'bTokn', 'ACCESS_TOKEN': 'aTokn', 'ACCESS_TOKEN_SECRET': 'aTokn_secret'}
```


### Reset your APIs

Permanently delete all stored credentials:


To reset your APIs
```bash
$ x-config reset
Do you want to delete all data? [Y/n]: Y
WARNING: This will permanently delete all data, including production API keys. Confirm with 'Y' or cancel with 'N': Y
Processing deletion....

All user files in ~/.tweet have been successfully deleted.
Data deletion successfull.
```

## Command Usage Examples

Use the `x` command to perform tweeting operations. Below are examples of how to use the command:

### Posting a Tweet

To post a tweet directly message or from a text file:


```bash
$ x --post "Your message to be tweeted"
$ x --post  "path/to/text/file.txt"
```

Important: The username and password you provide are used for decrypting your encrypted API credentials.


```bash
$ x --post "Hello, X!"
Enter your username to decrypt your saved APIs: test_usr
Enter your password to decrypt your saved APIs:
INFO:root:Tweet successfully posted. Tweet ID: 1728786247492247770
Twitter post:
Hello, X!

INFO:root:Tweet info saved to the database.
Tweet URL: https://twitter.com/eulerDavinci/status/1728786247492247770
```


### Deleting a Tweet

Remove a tweet by its ID: 

```bash
$ x --delete <Tweet ID>
```

```bash
$ x --delete 1728786247492247770
Enter your username to decrypt your saved APIs: test_usr
Enter your password to decrypt your saved APIs:
INFO:root:Tweet deleted successfully from twitter.com
INFO:root:Tweet with ID 1728786247492247770 removed from database.
Tweet successfully deleted.
```



## License

xpost is released under the MIT License. See the [LICENSE](LICENSE) file for more details.

## Contributions
Contributions are welcome from anyone, even if you are new to open source. If you are new and looking for some way to contribute, a good place to start is documentation and docstring.

Please note that all participants in this project are expected to follow our Code of Conduct. By participating in this project you agree to abide by its terms. See [CODE OF CONDUCTS](CODE_OF_CONDUCT.md)


## Support
For support, please open an issue on the GitHub repository.

## Tests
To ensure the functionality of `xpost`, you can run the following test commands. These commands test various functionalities of the xpost package.

First, import the necessary functions from `xpost`:

```python
from xpost import *
```
### Testing Configuration Commands
Use these functions to test configuration-related operations:
 * Adding a User: Adds a new user and stores their credentials. `add_user()`
 * Resets all stored credentials. `reset_credentials()`
 * Display the stored credentials. `show_credentials()`

### Testing Tweet Operations
To test tweeting functionalities, use these functions: 
 * Posts a new tweet. `post_tweet()`
 * Deletes an existing tweet. `delete_tweet()`


## Feedback and Feature Requests
Your feedback is incredibly valuable to us! For any feedback or feature requests, please reach out via email. We appreciate your input in enhancing xpost.

Please note, `xpost` is intentionally designed with a focus on basic features. This is to minimize distractions often associated with social media platforms, allowing users to concentrate on meaningful content creation. Our goal is to facilitate a simplified and efficient tweeting experience, enabling users to reflect on their past posts in the future.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/1darshanpatil/xpost",
    "name": "xpost",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "twitter,cli,api,tweet,social media",
    "author": "Darshan P.",
    "author_email": "drshnp@outlook.com",
    "download_url": "https://files.pythonhosted.org/packages/1f/e3/59727aeb79af36e844a6fd5adcd6b176925601fb42c845966831046d89e0/xpost-0.1.1.tar.gz",
    "platform": null,
    "description": "![xpost-logo.png](https://github.com/1darshanpatil/foundMyOldPomodoroProject/assets/72539638/0620222e-0ea1-4a27-904b-5486a503a184)\r\n\r\n# xpost - Python CLI for Twitter Operations\r\n\r\nxpost is a command-line interface (CLI) Python package for interacting with Twitter. It allows users to tweet, add users, store API credentials securely, and delete tweets.\r\n\r\n## Features\r\n\r\n- **Tweeting**: Effortlessly post tweets from the command line.\r\n- **Credential Storage**: Securely encrypt and store your Twitter API credentials using the robust `PBKDF2HMAC` algorithms, ensuring security.\r\n- **Tweet Deletion**: Conveniently delete tweets with a simple command.\r\n\r\n## Installation\r\n\r\nInstall xpost using pip:\r\n\r\n```bash\r\npip install xpost\r\n```\r\n\r\nVerify the installation by checking the versio: \r\n```bash\r\nxpost --version\r\n```\r\n\r\n## Usage\r\n\r\n### Adding user Authentication Credentials\r\nSecurely store your Twitter API credentials:\r\n\r\n```bash\r\n$ x-config add_user\r\nEnter a username to encrypt your APIs: usrDarwin\r\nSet a password to secure your encrypted APIs:\r\nConfirm your password:\r\nEnter CLIENT_ID: client_id\r\nEnter CLIENT_SECRET: client_secret\r\nEnter API_KEY: api_key\r\nEnter API_KEY_SECRET: apiKey\r\nEnter BEARER_TOKEN: bTokn\r\nEnter ACCESS_TOKEN: aTokn\r\nEnter ACCESS_TOKEN_SECRET: aTokn_secret\r\nSaving your encrypted data...\r\n-Credentials encrypted and stored successfully.\r\nSaving completed. Data stored at: ~/.tweet\r\n\r\nUser credentials successfully added.\r\n```\r\n\r\n### Viewing Stored Credentials\r\nCheck your encrypted credentials:\r\n```bash\r\n$ ls ~/.tweet\r\n```\r\nOr view decrypted credentials:\r\n```python\r\n>>> import xpost as x\r\n>>> x.show_credentials()\r\nEnter your username to decrypt your APIs: test_usr\r\nEnter your password to decrypt your APIs:\r\n{'CLIENT_ID': 'client_id', 'CLIENT_SECRET': 'client_secret', 'API_KEY': 'api_key', 'API_KEY_SECRET': 'apiKey', 'BEARER_TOKEN': 'bTokn', 'ACCESS_TOKEN': 'aTokn', 'ACCESS_TOKEN_SECRET': 'aTokn_secret'}\r\n```\r\n\r\n\r\n### Reset your APIs\r\n\r\nPermanently delete all stored credentials:\r\n\r\n\r\nTo reset your APIs\r\n```bash\r\n$ x-config reset\r\nDo you want to delete all data? [Y/n]: Y\r\nWARNING: This will permanently delete all data, including production API keys. Confirm with 'Y' or cancel with 'N': Y\r\nProcessing deletion....\r\n\r\nAll user files in ~/.tweet have been successfully deleted.\r\nData deletion successfull.\r\n```\r\n\r\n## Command Usage Examples\r\n\r\nUse the `x` command to perform tweeting operations. Below are examples of how to use the command:\r\n\r\n### Posting a Tweet\r\n\r\nTo post a tweet directly message or from a text file:\r\n\r\n\r\n```bash\r\n$ x --post \"Your message to be tweeted\"\r\n$ x --post  \"path/to/text/file.txt\"\r\n```\r\n\r\nImportant: The username and password you provide are used for decrypting your encrypted API credentials.\r\n\r\n\r\n```bash\r\n$ x --post \"Hello, X!\"\r\nEnter your username to decrypt your saved APIs: test_usr\r\nEnter your password to decrypt your saved APIs:\r\nINFO:root:Tweet successfully posted. Tweet ID: 1728786247492247770\r\nTwitter post:\r\nHello, X!\r\n\r\nINFO:root:Tweet info saved to the database.\r\nTweet URL: https://twitter.com/eulerDavinci/status/1728786247492247770\r\n```\r\n\r\n\r\n### Deleting a Tweet\r\n\r\nRemove a tweet by its ID: \r\n\r\n```bash\r\n$ x --delete <Tweet ID>\r\n```\r\n\r\n```bash\r\n$ x --delete 1728786247492247770\r\nEnter your username to decrypt your saved APIs: test_usr\r\nEnter your password to decrypt your saved APIs:\r\nINFO:root:Tweet deleted successfully from twitter.com\r\nINFO:root:Tweet with ID 1728786247492247770 removed from database.\r\nTweet successfully deleted.\r\n```\r\n\r\n\r\n\r\n## License\r\n\r\nxpost is released under the MIT License. See the [LICENSE](LICENSE) file for more details.\r\n\r\n## Contributions\r\nContributions are welcome from anyone, even if you are new to open source. If you are new and looking for some way to contribute, a good place to start is documentation and docstring.\r\n\r\nPlease note that all participants in this project are expected to follow our Code of Conduct. By participating in this project you agree to abide by its terms. See [CODE OF CONDUCTS](CODE_OF_CONDUCT.md)\r\n\r\n\r\n## Support\r\nFor support, please open an issue on the GitHub repository.\r\n\r\n## Tests\r\nTo ensure the functionality of `xpost`, you can run the following test commands. These commands test various functionalities of the xpost package.\r\n\r\nFirst, import the necessary functions from `xpost`:\r\n\r\n```python\r\nfrom xpost import *\r\n```\r\n### Testing Configuration Commands\r\nUse these functions to test configuration-related operations:\r\n * Adding a User: Adds a new user and stores their credentials. `add_user()`\r\n * Resets all stored credentials. `reset_credentials()`\r\n * Display the stored credentials. `show_credentials()`\r\n\r\n### Testing Tweet Operations\r\nTo test tweeting functionalities, use these functions: \r\n * Posts a new tweet. `post_tweet()`\r\n * Deletes an existing tweet. `delete_tweet()`\r\n\r\n\r\n## Feedback and Feature Requests\r\nYour feedback is incredibly valuable to us! For any feedback or feature requests, please reach out via email. We appreciate your input in enhancing xpost.\r\n\r\nPlease note, `xpost` is intentionally designed with a focus on basic features. This is to minimize distractions often associated with social media platforms, allowing users to concentrate on meaningful content creation. Our goal is to facilitate a simplified and efficient tweeting experience, enabling users to reflect on their past posts in the future.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A CLI for managing Twitter APIs and Twitter posts.",
    "version": "0.1.1",
    "project_urls": {
        "Documentation": "https://github.com/1darshanpatil/xpost#readme",
        "Homepage": "https://github.com/1darshanpatil/xpost",
        "Source": "https://github.com/1darshanpatil/xpost",
        "Tracker": "https://github.com/1darshanpatil/xpost/issues"
    },
    "split_keywords": [
        "twitter",
        "cli",
        "api",
        "tweet",
        "social media"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c12d31bbffe1cb0eeb415d481b242201e77d2160a049453b266a917709da3097",
                "md5": "1e9a5cde2b35d2015b9dcdca24576b0c",
                "sha256": "fc19ddacc3d5a9b48f887789190636f94992008ba1e00297b8ac611921382658"
            },
            "downloads": -1,
            "filename": "xpost-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1e9a5cde2b35d2015b9dcdca24576b0c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 14322,
            "upload_time": "2023-12-02T13:11:33",
            "upload_time_iso_8601": "2023-12-02T13:11:33.137563Z",
            "url": "https://files.pythonhosted.org/packages/c1/2d/31bbffe1cb0eeb415d481b242201e77d2160a049453b266a917709da3097/xpost-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1fe359727aeb79af36e844a6fd5adcd6b176925601fb42c845966831046d89e0",
                "md5": "6bec960bc8d39088f56295e105e529cc",
                "sha256": "ee40e9f49f24a820b20d62632c27d6d35da09438a3726373aa0641f9f86f778a"
            },
            "downloads": -1,
            "filename": "xpost-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6bec960bc8d39088f56295e105e529cc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 14513,
            "upload_time": "2023-12-02T13:11:35",
            "upload_time_iso_8601": "2023-12-02T13:11:35.125622Z",
            "url": "https://files.pythonhosted.org/packages/1f/e3/59727aeb79af36e844a6fd5adcd6b176925601fb42c845966831046d89e0/xpost-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-02 13:11:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "1darshanpatil",
    "github_project": "xpost",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "xpost"
}
        
Elapsed time: 0.32935s