Saravanan666/pypi-org huggingface dataset:
Package: twitter-api-py
✨✨ Twitter API Client by Typed Python ✨✨Installpipinstalltwitter_api_pyFeaturesFully type annotated.OAuth1 / OAuth2 support.Sync / Async Client support.Mock Client support.UsageThe simplest way to use the library is as follows:fromtwitter_apiimportTwitterApiClientresponse_body=(TwitterApiClient.from_oauth2_app_env().request("https://api.twitter.com/2/tweets").get({"ids":"1460323737035677698","expansions":["referenced_tweets.id"]}))As a characteristic feature of the library, it explicitly prompts the user to write the Endpoint URL, which makes it clear from the source code which Twitter API is being called.Test CodeA mock client is provided by the library to simplify the writing of test code.This client has the same interface asTwitterApiClient/TwitterApiAsyncClient, and also provides methods (inject_*_response_body) for injecting test data.fromtwitter_apiimportTwitterApiClient,TwitterApiMockClientdefyour_logic(twitter_client:TwitterApiClient):...deftest_your_logic():twitter_client=(TwitterApiMockClient.from_oauth2_app_env().inject_post_response_body("https://api.twitter.com/2/tweets",post_response_body).inject_get_response_body("https://api.twitter.com/2/tweets/:id",get_response_body).inject_delete_response_body("https://api.twitter.com/2/tweets",delete_response_body))assertyour_logic(twitter_client)isTrue
Package: twitter-application-only-auth
A simple implementation of the Twitter Application-only authenticationhttps://dev.twitter.com/docs/auth/application-only-auththat offers
applications the ability to issue authenticated requests on behalf of
the application itself (as opposed to on behalf of a specific user).Tested with Python 2.6, 2.7, 3.3 and 3.4Installpip install twitter-application-only-authUsageimportjsonfromapplication_only_authimportClient# The consumer secret is an example and will not work for real requests# To register an app visit https://dev.twitter.com/apps/newCONSUMER_KEY='xvz1evFS4wEEPTGEFPHBog'CONSUMER_SECRET='L8qq9PZyRg6ieKGEKhZolGC0vJWLw8iEJ88DRdyOg'client=Client(CONSUMER_KEY,CONSUMER_SECRET)# Pretty print of tweet payloadtweet=client.request('https://api.twitter.com/1.1/statuses/show.json?id=316683059296624640')printjson.dumps(tweet,sort_keys=True,indent=4,separators=(',',':'))# Show rate limit status for this applicationstatus=client.rate_limit_status()printstatus['resources']['search']Real-World use casesTweet Dump: dump and inspect your tweet
data!Authors and contributorsPablo SeminarioRafael Reimbergfor the initial
setup.pyChris Hawkinsfor Python 3.4
support
Package: twitter-archive-unshorten
twitter-archive-unshortenTwitter'sarchive downloadincludes shortenedt.coURLs instead of the original URLs that you tweeted. If Twitter ever goes away, the server att.cowon't be available to respond to requests.twitter-archive-unshortenis a small Python program that will examine all the JavaScript files in the archive download and rewrite thet.coshort URLs to their original full URL form. This means the context for your archived tweets will make a little more sense after Twitter is gone. Maybe you can look up those URLs in the Internet Archive if they are no longer available. This would be impossible if all you had was the short URL.Install$ pip3 install twitter-archive-unshortenRunUnzip your Twitter archive zip file.Open a terminal window and run:twitter-archive-unshorten /path/to/your/archive/directory/It might take a while, depending on how many tweets you have. Once it's
finished you should be able open your archive and interact with it without thet.coURLs.The mapping of short URLs to long URLs that was used is saved in your archive directory asdata/shorturls.json.TestIf you'd like to develop further you can run the existing tests:$ pip3 install pytest
$ pytest test.py
Package: twitter-automate
PACKAGE - TWITTER-AUTOMATEButCe packages permet d'automatiser les tâches de like, partage et commentaire sur Twitter.Pour importerfrom bot_twitter import automate_twitter as atFonctionstwitter_auth_api(self):This function allow to authentificate on Twitter APItwitter_auth_client(self):This function allow to authentificate on Twitter Clienttwitter_get_last_post(self, user_api: twitter_auth_api, pseudo_twitter: str):This function return a dictionary contain id of last tweet and date creationtwitter_get_posts(self, user_api: twitter_auth_api, pseudo_twitter: str, nb_tweet: int):This function return last tweets in function value of variable 'nb_tweet'twitter_like (self, user_client: twitter_auth_client, id_post: str):This function allow to like a tweettwitter_retweet(self, user_client: twitter_auth_client, id_post: str):This function allow to retweet a tweettwitter_comment(self, user_client: twitter_auth_client, id_post: str, text_comment: str):This function allow to comment a tweet
Package: twitter-banner-switcher
Python (3) script that sets your Twitter profile banner to a random
image from a specified folder or a list of paths.InstallationWithPyPI(recommended):$pip3installtwitter-banner-switcherWithgit clone:$gitclonehttps://github.com/Pythonity/twitter-banner-switcher$pip3install-rtwitter-banner-switcher/requirements.txt$cdtwitter-banner-switcher/binUsage$ twitter-banner-switcher -h
Usage: twitter-banner-switcher [OPTIONS]

  Set Twitter profile banner to a random image from a specified folder or a
  list of paths

Options:
  -c, --config-file FILENAME  Path to YAML config file (default: ~/.twitter-
                              banner-switcher.yml).
  -h, --help                  Show this message and exit.ExamplesNot much to show here - you can provide path to config file:$twitter-banner-switcher-ctwitter-banner-switcher.yamlor save it at~/.twitter-banner-switcher.yamland just run the damn
thing:$twitter-banner-switcherExample config file$ cat twitter-banner-switcher.yamlconsumer_key:"Twitterconsumerkey"consumer_secret:"Twitterconsumersecret"access_token:"Twitteraccesstoken"access_token_secret:"Twitteraccesstokensecret"banner_images:-"/home/bender/Photos/AwesomeTwitterBanners/"-"/home/bender/Downloaded/planet_express.png"Note:banner_imagescan be a path or a list of paths (to directories
containing images or directly to image files). Recognized formats aregif,jpg,jpegandpng.ContributionsPackage source code is available atGitHub.Feel free to use, ask, fork, star, report bugs, fix them, suggest
enhancements and point out any mistakes.AuthorsDeveloped and maintained byPythonity.Written byPaweł Adamczak.
Package: twitter-blocklist
twitter_blocklistExport and import Twitter blocklists.Execute on Google ColaboratoryIt can also be used in the Google Colaboratory Notebook without installing anything
in the local machine, this also includes the documentation:Documentation and executionIt can also be executed from a Notebook, which also includes instructions
for setting it up and step-by-step explanation, see:<run_twitter_blocklist.ipynb>Quick referencetwitter_blocklistprovides a command-line tool to export a list of all
the accounts you block to a text file:$ twitter_blocklist --export my_blocks.csvor import a list from someone else, or downloaded fromhttps://blocktogether.org:$ twitter_blocklist list_to_import.csvor block all member of a Twitter list:$ twitter_blocklist --list <list_id>undo blocking with the --unblock flag:$ twitter_blocklist --unblock --list <list_id>
$ twitter_blocklist --unblock list_to_unblock.csvConsider that Twitter rate-limits their APIs, I have setup the client to automatically
sleep in case of a rate-limiting error, in case that happens, just leave the script
running and it will complete at some point. For example exporting the blocks needs
to make 1 request every 5000 blocked IDs, so you could hit the limit of 15 requests
every 15 minutes, in that case the script will sleep for 15 minutes and then resume.Install$ pip install twitter_blocklistInitial setupCreate a Twitter app following theinstructions from thepython-twitterprojectCreate a text file namedtwitter_keys.tomlwith this format:consumer_key='xxxxxxxxxxxxxxxxxxxxxxxxx'
consumer_secret='xxxxxxxxxxxxxxxxxxxxxxxxx'
access_token_key='xxxxxxxxxxxxxxxxxxxxxxxxx'
access_token_secret='xxxxxxxxxxxxxxxxxxxxxxxxx'Make sure you have the single quotes.From the same folder where you havetwitter_keys.toml, run the tool as shown above.
Package: twitter-boto-dummy
twitter_boto_dummyThis library used mainly to help you have and run your own twitter botIn order to install, open the command prompt and type:pip install twitter_boto_dummyIn order to use this library  you should have a verified twitter application and you have to save your credential  inside a json file as following:{
"consumer_key": " your one", 
"consumer_secret": "your one", 
"access_token": "your one", 
"access_token_secret": "your one",
"env_name": "your one"
}
Package: twitterbot_utils
============Twitterbot utils============.. image:: https://img.shields.io/travis/strizhechenko/twitterbot_utils/master.svg:target: https://travis-ci.org/strizhechenko/coveralls-pythonUseful functions for everyone who want to write one more xxx everyword bot.By the `Oleg Strizhechenko <oleg.strizhechenko@gmail.com>`_============Introduction============This library provides bunch of functions for tasks on creating twitter bots.==========Installing==========You can install twitterbot-utils using::$ pip install twitterbot-utils================Getting the code================The code is hosted at https://github.com/strizhechenko/twitterbot_utilsCheck out the latest development version anonymously with::$ git clone git://github.com/strizhechenko/twitterbot_utils.git$ cd twitterbot_utilsSetup a virtual environment and install dependencies:$ make envActivate the virtual environment created:$ source env/bin/activate=============Running Tests=============No test on current state avaible.=============Documentation=============Authorize your bot:source env/bin/activateexport consumer_key=xxxexport consumer_secret=xxypython -m twitterbot_utils.TwiAuthWhen, copy PIN and get your access token/secret to put in heroku config.=====usage (ru guide)=====https://github.com/strizhechenko/twitterbot_example.git=====TODO=====Usage, docs, tests.See also:====https://github.com/strizhechenko/twitterbot_farm
Package: twitter-cleaner
Twitter CleanerA small python script that allows you to delete your old tweets.InstallationUse pip:pipinstalltwitter_cleanerHow to useApply for a Twitter Developer Account.While you wait for Twitter to review and approve your Developer Account,download your Twitter archive. Twitter limits the access of the tweets by the API, so the only way to retrieve your old tweets is using the Twitter archive.When you receive your archive, you should look for a JS file with contains all your tweets (tweet.js).After the approval of your Twitter Developer Account,create an app.Don't forget: you should setRead and Writein theAccess Permissionssettings.Open thedetailspage of the app that you created. Go for theKeys and Tokenstab. You will need the consumer and access token keys to use Twitter Cleaner.Run:python-mtwitter_cleaner--consumer_key<consumer-key>\\--consumer_secret<consumer-secret>\\--access_token_key<access-token-key>\\--access_token_secret<access-token-secret>\\--older_than<dateinYYYY-MM-DDformat>\\--file<path/to/tweet.js>FiltersThere are two filters available: filter tweets older than a date AND filter tweets newer than a date. If you need more filtering options, like filter tweets with less (or more) than a specific amount of engagement, please ask.
Package: twitter-cleanup
Twitter Clean-up🇧🇷 Versão em português do BrasilTiny script to clean-up your Twitter account:Removing users that have not been tweeting for a whileSoft-blocking bots (blocks and immediately unblocks the account, so it stops following you)RequirementsPython 3.6+Set environment variables with yourTwitter API keysand withBotometer API key:TWITTER_CONSUMER_KEYTWITTER_CONSUMER_SECRETTWITTER_ACCESS_TOKEN_KEYTWITTER_ACCESS_TOKEN_SECRETBOTOMETER_MASHAPE_KEYInstallingInstall the package with:$pipinstalltwitter-cleanupUsageRun the CLI withtwitter-cleanup --helpand follow the on screen instructions.For example, unfollow everyone that hasn't tweeted in the last 30 days with:$twitter-cleanupinactive30Or soft-block every bot with:$ twitter-cleanup botsContributingPlease, write and run tests locally, and format your code withBlack:$pythonsetup.pytest$black.
Package: twittercollect
This small module provides the means to consistently collect and process data
from Twitter’s streaming API.The authors of this module have no association with Twitter Inc., and offer no
warranty or guarantee of continued interoperability with the services offered by
Twitter Inc..This module is licensed under a 3-clause BSD license:Copyright (c) 2009-2010, Robert Escriva, Rensselaer Polytechnic Institute
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of this project nor the names of its contributors
      may be used to endorse or promote products derived from this software
      without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.If you’re simply looking to collect data, the quick and easy instructions are:$ mkdir /path/to/twitter/data
$ cd /path/to/twitter/data
$ twittercollect --bzip2 \
>                --user USERNAME \
>                --password PASSWORD \
>                --stream-url STREAM_URLThe process does not daemonize.  It is recommended that it be run in a screen
session.  In a future release this will be changed so that it may be run as a
system daemon.The most-available stream URL ishttp://stream.twitter.com/1/statuses/sample.json.  If you have another
agreement with Twitter, substitute the provided URL here.  It is also possible
to provide the username, password, and URL using environment variables.The public API can be summed up with just two functions.
Package: twitter.common.pants
RELEASE HISTORY===============0.8.3 (8/05/2015)----------------Changes~~~~~~~~~~~* Update to ``pantsbuild.pants`` 0.0.40 api changes`RB #2559 <https://rbcommons.com/s/twitter/r/2559/>`_0.8.2 (3/20/2015)----------------API Changes~~~~~~~~~~~* Update to ``pantsbuild.pants`` 0.0.31 api changes`RB #1963 <https://rbcommons.com/s/twitter/r/1963/>`_0.8.1 (2/17/2015)-----------------Bugfixes~~~~~~~~* Allow non-jar resources on the classpath.`RB #1752 <https://rbcommons.com/s/twitter/r/1752/>`_0.8.0 (2/2/2015)----------------API Changes~~~~~~~~~~~* Update to ``pantsbuild.pants`` 0.0.28 api changes`RB #1698 <https://rbcommons.com/s/twitter/r/1698/>`_0.7.0 (12/18/2014)------------------API Changes~~~~~~~~~~~* Update to ``pantsbuild.pants`` 0.0.26 api changes`RB #1513 <https://rbcommons.com/s/twitter/r/1513/>`_0.6.0 (11/12/2014)------------------API Changes~~~~~~~~~~~* Depend on latest release ``twitter.common.*`` deps.`RB #1329 <https://rbcommons.com/s/twitter/r/1329/>`_* Update to ``pantsbuild.pants`` 0.0.24 api changes`RB #1071 <https://rbcommons.com/s/twitter/r/1071/>`_0.5.0 (8/11/2014)------------------API Changes~~~~~~~~~~~* Update to ``pantsbuild.pants`` 0.0.23 api changes`RB #864 <https://rbcommons.com/s/twitter/r/864/>`_0.4.0 (7/28/2014)------------------API Changes~~~~~~~~~~~* Update to ``pantsbuild.pants`` 0.0.21 api changes`RB #763 <https://rbcommons.com/s/twitter/r/763/>`_0.3.3 (7/21/2014)-----------------Bugfixes~~~~~~~~* Loosen up t.c.pants constraints.`RB #712 <https://rbcommons.com/s/twitter/r/712/>`_0.3.2 (7/18/2014)-----------------Bugfixes~~~~~~~~* Maintain line set type throughout branches that populate it in the args-apt task.`RB #702 <https://rbcommons.com/s/twitter/r/702/>`_0.3.1 (7/15/2014)-----------------* Initial published version of ``twitter.common.pants``.
Package: twitter-dedupe
twitter-dedupe==============![travis-ci status](https://api.travis-ci.org/cmheisel/twitter-dedupe.png?branch=master)Python library to retweet unique links from noisy Twitter accounts.My personal use case------------------------Say you follow a news outlet that tweets the same link multiple times in a day, or a week. Maybe they provide different images or headlines, but it's the same story, over and over again.I'd rather follow @{newsoutlet}-light and have a link show up there only once every 7 days or so.How to use-------------1. Set up a Twitter account, say @{newsoutlet}lite2. As @{newsoutlet}lite Follow @newsoutlet3. Get your Twitter Consumer Key, Consumer Key Secret, Access Key and Access Key Secret from http://dev.twitter.com4. Set up some environment variables```TWITTER_CONSUMER_KEYTWITTER_CONSUMER_SECRETTWITTER_ACCESS_TOKENTWITTER_ACCESS_TOKEN_SECRETREDISTOGO_URL=redis://{user}:{pass}@{domain}:{port}TWITTER_SCREEN_NAME={newsoutlet}liteWAIT_INTERVAL=300 # Time to wait between polls, in secondsLOG_LEVEL=WARN # Or INFO, OR DEBUG, etc.```5. python bin/logonly.py6. Now you have a deamon running that'll examine @{newsoutlet}lites home timeline, and log any tweets it would retweet as @{newsoutlet}lite7. If you're happy quit bin/logonly.py8. Now run python bin/retweet.py
Package: twitter-dl
Download twitter resourcesDownload tweet images and videos. Run threads which has a event loop to download resources asynchronously.pip3 install twitter-dlusage: twitter-dl [-h] [-c CONFIDENTIAL]
                                  [-s {large,medium,small,thumb,orig}]
                                  [--video] [--nophoto]
                                  [-l LIMIT] [--rts]
                                  [--thread-number THREAD_NUMBER]
                                  [--coro-number CORO_NUMBER]
                                  [--since SID]
                                  [--tweet] [--list] [--file]
                                  resource_id dest

Download all images and/or videos uploaded by a twitter user you specify

positional arguments:
  resource_id           An ID of a twitter user. Also accept user id files, list or
                        tweet id.
  dest                  Specify where to put images/videos

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIDENTIAL, --confidential CONFIDENTIAL
                        a json file containing (a key and a secret) or bearer_token
  -s {large,medium,small,thumb,orig}, --size {large,medium,small,thumb,orig}
                        specify the size of images
  --tweet               indicate resource_id is a numbered tweet id
  --list                indicate resource_id is a list (user:slug) 
  --file                indicate resource_id is a username file(each in a line)
  --video               include video
  --nophoto             exclude photo
  -l LIMIT, --limit LIMIT
                        the maximum number of tweets to check (most recent first)
  --rts                 save images contained in retweets
  --thread-number       THREAD_NUMBER
  --coro-number         CORO_NUMBER
  --since               SID
  --subdir              used with --file to save media to different dirs for each userExamples:
    twitter-dl --tweet 1191067520033337345 pv
    twitter-dl --rts -l 10 --video ladygaga pv
    twitter-dl --rts -l 10 --video --nophoto --list YouTube:hey-fam pv
    twitter-dl --rts -l 10 --video --file idfiles.txt pv
Package: twitterEye
twitterEye is a python library, designed for making twitter sentiment analysis easy and approachable to every one,
First you have to signup for twitter developers portal, use the provided secret keys in the builtin function with
the topic keyword you want to analyze and opt for results visualization.
The function can be called as follows with mentioned data types of arguments.
analyze_keyword(consumer_key: str, consumer_secret: str, access_token: str, access_token_secret: str, keyword: str, tweets_limit: int = 1000, visualize: bool = True)Change Log1.0.0 (18/10/2022)First release with only function named analyze_keyword, this function can fetch tweets from twitter, analyze and visualize them.Future releases will have advanced features like, urdu and roman urdu tweets analyzer support.
Package: twittergeo
Export geotagged tweets to GeoJSON.InstallOpen your terminal and run:pipinstalltwittergeo(Don’t have Pip?)UseTo use the tool, you’ll need a application registered with Twitter.
Instructions from Twitter:https://apps.twitter.com.When your application is set, you’ll get two keys, which need to be
added to a config file.Setting up a config fileYou’ll need abots.yaml(or.json) file with you keys, because
copying and pasting them is boring, and environment variabled don’t work
if you have several applications. Save a config file like so:apps:twittergeo:consumer_key:...consumer_secret:...Call the file bots.yaml and save it in your home directory.twittergeowill find it automatically. Or use a custom file:$twittergeo--search"some words"--configconfigfile.yaml-osome_words.geojsonSmaller filesUse the--liteoption to get smaller files. The only properties
saved will be the tweet’stextandidand the user’sscreen_nameanduserid.$twittergeo--search"some words"--lite>some_words.geojsonGet more tweetsBy default, Twitter returns only 15 tweets, which is pretty weak. Use
the--countparameter to request more. Note that Twittergeo will
returncounttweets, but that may include non-geotagged tweets, so
your files will likely be much shorter. The Twitter API doesn’t have a
way request only geotagged tweets.$twittergeo--search"some words"--count100>some_words.geojsonGeocode parameterWhen using the search option, you can request tweets close to a
particular point. The format to use islatitude,longitude,radius,
where radius is either in miles (mi) or kilometers (km).$twittergeo--search"some words"--geocode37.781157,-122.398720,1mi-osome_words_a.geojson$twittergeo--search"some words"--geocode37.781157,-74.2644,10km-osome_words_b.geojsonOptionsusage: twittergeo [-h] [-c path] [--app APP] [-u screen_name | -f search]
                  [--lite] [--count COUNT] [--geocode LAT,LON,RADIUS]
                  [--since ID] [--max ID] [-o OUTPUT]

Pull Twitter searches into GeoJSON

optional arguments:
  -h, --help            show this help message and exit
  -c path, --config path
                        jsom or yaml config file
  --app APP             Twitter app to read in config (default: twittergeo)
  -u screen_name, --user screen_name
                        User timeline to search
  -f search, --search search
                        Search string
  --lite                Output minimal information about tweets
  --count COUNT         Maximum number of tweets to return (default: 500)
  --geocode LAT,LON,RADIUS
                        optional geocode parameter when searching
  --since ID            Fetch tweets since this ID
  --max ID              Fetch tweets before this ID
  -o OUTPUT, --output OUTPUT
                        output file (default: stdout)