Saravanan666/pypi-org huggingface dataset:
Package: tweepy-parrot
Tweepy ParrotA library built on top ofTweepy, designed to auto generate tweets from data sourced from other users.A bot made with this library, will stream unique tweets and retweets of the users it follows and/or is followed by. It cleans and parses the words from the tweet into a growing Markov chain, which is later used to generate tweets.Setuppipinstalltweepy-parrotTo setup the bot, you mustsetup a Twitter developer account, and then either add the following to a.envfile in your project, or otherwise export them to the runtime environment.TWITTER_API_KEY={YOUR_API_KEY}
TWITTER_API_SECRET={YOUR_API_SECRET}
TWITTER_ACCESS_TOKEN={BOT_ACCESS_TOKEN}
TWITTER_ACCESS_SECRET={BOT_ACCESS_SECRET}Once done, you are ready to use the library.ExamplesA simple example that will store data in a JSON format, and echo Squawks to your terminal, rather than Tweet them out.fromtimeimportsleepfromtweepy_parrotimportJSONParrot,ParrotBotmy_parrot=JSONParrot('parrot.json')my_bot=ParrotBot(my_parrot)# Call start, to being listening to the data stream.# follows=True will stream data from accounts the bot follows# followers=True will stream data from accounts that follow the botmy_bot.start(follows=False,followers=True)whileTrue:sleep(3600)# One hourprint(my_bot.squawk(post=False))
Package: tweepypoll
tweepypollOverviewtweepypollis a Python package that allows users to extract and visualize poll data (poll questions, poll options, poll responses, etc.) from Twitter. Our goal is to maketweepypollhelpful and user-friendly; any Python beginner can effectively gain access to the data and make their own data-driven decisions. In particular, it could be a useful package for people doing social media journalism, or those studying social media interactions.NOTE: This package assumes that the user has signed up for Twitter API Developer account, acquired the bearer token and set the environmental variable "BEARER_TOKEN". To acquire the bearer token, please follow the instructionshere.Functionsget_polls_from_user:This function retrieves a list of tweet IDs (where the tweet contains a poll) from a Twitter user. These ids can be fed into theget_poll_by_idfunction.The function will only search through the most 100 recent tweets per requested user.get_poll_by_id:This function extracts poll information from Twitter given the tweet ID returned from theget_polls_from_userfunction.visualize_poll:This function takes in the output ofget_poll_by_idfunction and visualizes the poll information.Related PackagesThere are a few existing Python packages that have similar functionality for tweets from Twitter. For example,pytweetis a package that helps extract tweets, visualize user habit on tweet posting, and apply sentiment analysis to the data. However, there are no available packages that work specifically on polls from Twitter.Installation$pipinstalltweepypollDependenciespython = "^3.9"altair = "^4.2.0"pandas = "^1.3.5"tweepy = "^4.4.0"python-dotenv = "^0.19.2"Usagefromtweepypoll.tweepypollimportget_polls_from_userget_polls_from_user('username')whereusernameis a string username, such as 'ElonMusk'fromtweepypoll.tweepypollimportget_poll_by_idget_poll_by_id(tweet_id)tweet_idis numeric, such as 1481040318325739523fromtweepypoll.tweepypollimportvisualize_pollvisualize_poll(poll_obj,show_user=False,show_duration=False,show_date=False)poll_objis a list of dicts outputted by get_poll_by_id(),show_user, show_duration, show_dateare optional booleans to display username, poll duration and poll end date, respectivelyContributorsWenxin XiangRada RudyakLinh Giang NguyenContributingInterested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.Licensetweepypollwas created by Wenxin Xiang, Rada Rudyak, Linh Giang Nguyen. It is licensed under the terms of the MIT license.Creditstweepypollwas created withcookiecutterand thepy-pkgs-cookiecuttertemplate.
Package: tweepy-trc
Table of ContentsDescriptionPrerequisitesInstallationDescriptionThis is a wrapper for the config files used by Ruby gems ‘t’
and ‘twurl.’  The idea is to keep Twitter credentials stored
separately from programs that use them.PrerequisitesTweepyEither of the following Ruby gems:thttps://github.com/sferik/ttwurlhttps://github.com/twitter/twurlInstallationtweepy-trc is distributed onPyPIas a universal
wheel, is available on Linux/macOS and Windows, and supports
Python 3.6+.$pipinstalltweepy-trc
Package: tweeql2solr
tweeql2solr is a wrapper fortweeql. It allow you to store tweets in solr.It recommended to use Solr4 so you can use thestorefield to Geo localize tweets.If not, you need to use the-1option. See bellow.InstallationWith easy_install:$ easy_install tweeql2solrUsagetweeql2solr provide a simple command line script:$ tweeql2solr -h
Usage: tweeql2solr [options]

Options:
  -h, --help            show this help message and exit
  -w WHERE, --where-clause=WHERE
                        where clause
  --username=USERNAME   twitter username
  --password=PASSWORD   twitter password
  -s BATCH_SIZE, --batch-size=BATCH_SIZE
                        batch size. Default: 1
  -u URL, --url=URL     solr url. Default: http://127.0.0.1:8983/solr/
  -1, --solr1           use this if you do not use solr 4.
  -v, --verbose         increase verbosity
Package: tweesky
TweeskyTweesky is a Python library for extractingHTML,OpenGraphandTwittermetadata from URLs, HTML pages and
Spotify links.CheckTweesky Web Site: example of what Tweesky can doReadIntro on MediumHow to use itInstall the module:PyPi Tweesky pageGrab attributes from a URLimport tweesky.main as tweesky
    
    website = 'https://www.nike.com/'
    card = tweesky.generate_card(url=website)
    
    print(card.title)
    print(card.image)Grab attributes from an HTML documentimport tweesky.main as tweesky

    with open('doc.html', 'r') as reader:
        doc = reader.readlines()
    card = tweesky.generate_card(html=doc)
    
    print(card.title)
    print(card.image)Output optionsThere are different options to format the card:Card object (default): access the Python object to obtain the metadataJSON output: the Card content is provided as JSONHTML file: an HTML file is provided including the metadata necessary for creating the Social Media previewHTML formatWhen usingmain.generate_card_as_html()method the output is an HTML document which can be sharedas-ison Social Media.The HTML document provides all necessary OpenGraph/Twitter tags as well as the Javascript code to redirect the users to
the original page: save the file on an accessible location and distribute the link through the Social Media channels.<html>
    <head>
        <meta name="twitter:card" content="summary" />
        <meta name="twitter:title" content="Python Tutorials – Real Python" />
        <meta name="twitter:description" content="Learn Python online" />
        <meta name="twitter:image" content="https://cdn.realpython.com/static/logo.png" />
        <meta name="twitter:site" content="@realpython" />
        
        <meta property="og:title" content="Python Tutorials – Real Python" />
        <meta property="og:description" content="Learn Python online" />
        <meta property="og:image" content="https://cdn.realpython.com/static/logo.png" />
        
        <meta http-equiv="refresh" content="0; url=https://realpython.com/" /> 
    </head>
    <body >
        &nbsp;
    </body>
</html>ImagesWhen finding the image for the Preview the library will search the following:Twitter Card metadataOpenGraph metadataJSON LD
Package: tweet
tweetcan tweet your current status from CLI easily.tweetcat tweetonly, therefore you will not be distracted.How to Installpipxis good for running python applications in isolated environments.pipx install tweetHow to Use# Post Tweet
tweet tweet `your-status`

# Endless Mode
tweet endlessHow to set upYou have to set up~/.twitter-envfile to your home directory yourself.
You get tokens fromTwitter Developer.~/.twitter-envCONSUMER_TOKEN=.......
CONSUMER_SECRET=.......
ACCESS_TOKEN=.......
ACCESS_SECRET=.....
Package: tweet2latex
PyPi project:https://pypi.org/project/tweet2latex/This is proof of concept utility for retrieval of Tweets by their IDs and
their conversion to LaTeX. This utility requires Python andtwarcmodule.Run this from command line, e.g., like this:./tweet2latex.py 762602474293321728 |tee tweet.texThe invocation above will download tweet's information as JSON and it will
cache the JSON and downloaded images in current directory to avoid access
rate limitations of Twitter API should this tool be invoked several times in
succession.The contents of thetweet.texmight looks something like this:\begin{tweet}\tweetUserImage{https://pbs.twimg.com/profile\_images/887781725249585152/ihwPKKHi\_bigger.jpg}{ihwPKKHi-bigger.jpg}{701158958}\tweetUserName{701158958}{MedicNow}{MedicNow}\tweetUserEnd{}It could be worse. You could be the lifeguard at the\tweetHashtag{Rio}{\#Rio}swimming pool....\tweetHashtag{MondayMotivation}{\#MondayMotivation}\tweetPhoto{https://twitter.com/MedicNow/status/762602474293321728/photo/1}{https://pbs.twimg.com/media/CpVOzW7WEAAhMte.jpg}{CpVOzW7WEAAhMte.jpg}{https://t.co/AfoOoV9qQw}\tweetRetweets{7}\tweetFavorites{12}\tweetItself{762602474293321728}{Mon Aug 08 10:52:52 +0000 2016}{August 8, 2016}{12:52:52 PM GMT+2}\end{tweet}Then import the resultingtweet.texin your LaTeX document:\import{tweet}Formatting of the tweet is up to you. Seetweet-document.texfor example
usage. The following shows simple formatting for tweets:\newenvironment{tweet}{%\newcommand{\tweetUserImage}[3]{%\begingroup%\includegraphics[keepaspectratio,height=1em]{##2}%\quad\endgroup}%\newcommand{\tweetUserName}[3]{\href{https://twitter.com/intent/user?user_id=##1}{##2}\quad\href{https://twitter.com/intent/user?user_id=##1}{{\small\color{gray}@##3}}}%\newcommand{\tweetUserVerified}{\hskip0.16667em\relax{\small\color{cyan}\textcircled{\(\checkmark\)}}}%\newcommand{\tweetUserEnd}{\\}%\newcommand{\tweetHashtag}[2]{\href{https://twitter.com/hashtag/##1}{##2}}%\newcommand{\tweetUserMention}[2]{\href{https://twitter.com/intent/user?user_id=##1}{##2}}%\newcommand{\tweetUrl}[4]{\href{##2}{##3}}%\newcommand{\tweetInReplyToTweet}[3]{{\small\color{gray}in reply to\href{https://twitter.com/statuses/##1}{tweet}by\href{https://twitter.com/intent/user?user_id=##2}{@##3}}\\}%\newcommand{\tweetPhoto}[4]{\\\includegraphics[keepaspectratio]{##3}\\}%\newcommand{\tweetRetweets}[1]{\flushright{\small\(\color{gray}\circlearrowright\)\color{gray}\hskip0.16667em\relax##1}}%\newcommand{\tweetFavorites}[1]{{\small\(\color{gray}\heartsuit\)\color{gray}\hskip0.16667em\relax##1}}%\newcommand{\tweetItself}[4]{%\quad\href{https://twitter.com/statuses/##1}{{\small\color{gray}##3 ##4}}}%\newcommand{\tweetPlace}[3]{\flushright{\small\color{gray}\href{##3}{##1, ##2}}}%\newfontfamily\emojifont{Symbola}[Scale=MatchUppercase]%\begin{tcolorbox}[size=small,enhanced,breakable,autoparskip,halign=flush left]%\sffamily%}{\end{tcolorbox}}Thetweet2latex.pyutility also downloads user image and linked images and
puts them in the working directory so that resulting document can use them.
Package: tweet2story
Tweet2StoryCreate instagram stories from tweets using cli.RequirementsPillowTweepyClickTwintCommandsCreate a story using a urltweet2story -u <URL OF THE TWEET>Start a streamer (requires API keys to be exported)tweet2story -s <USERNAME>This requires creating a twitter app from developer console & exporting credentials.Set environment variablesTWITTER_CUSTOMER_KEY = Customer key of the created app
TWITTER_CUSTOMER_SECRET = Customer secret of the created app
TWITTER_ACCESS_TOKEN = Access token of the created app
TWITTER_ACCESS_TOKEN_SECRET = Access secret of the created appOptionsFlagDescription-uFlag for url mode uses TWINT to generate the tweet no API integration required-sFlag for streamer mode REQUIRES API KEYS-cSet background color of the tweet from these colors orange, red, green, yellow, violet, blue, pinkRoadmapAdd media support in tweetsAdd thread supportLicenseMIT
Package: tweet-archiver
Based on the code and example given by Alex Muller on hisblog.UsageInstall the egg.Run the tweet-archiver script now found in your Python’s bin
directory like so:./bin/tweet-archiver infile.txt outfile.jsonreplacing infile.txt with the path to the USERNAME-tweets.txt
file sent to you by Twitter and outfile.json with the path to
the JSON file in which you want to collate the tweet data.The script will ask for your username and password. This is not
stored anywhere and is only used for API access.
Package: tweet-archiveur
Tweet ArchiveurThis project aim at storing tweets in a database. But you could use it without database.Input : tweetos id in a CSV fileOutput : A databases of tweets and hastagsThe goal for us is to store tweets of all members of the French Parliament to get an idea of the trendings topics.But you could use the project for other purpose with other people.How to install the packageTODO : push it to Pipy when :Rename "nom" to name in usersreactivate unit tests (https://docs.github.com/en/actions/guides/creating-postgresql-service-containers)Made scrapper a ClassSwitch to SQL AlchemyFlake8Documentationpip install tweetarchiveurHow to use the package in your projectThere is two class :A Scrapper() to use the Twitter APIA Database() to store tweets and hastags in itfromtweet_archiveur.scrapperimportScrapperfromtweet_archiveur.databaseimportDatabase# Force some variable outside Dockerfromosimportenvironenviron["DATABASE_PORT"]='8479'environ["DATABASE_HOST"]='localhost'environ["DATABASE_USER"]='tweet_archiveur_user'environ["DATABASE_PASS"]='1234leximpact'environ["DATABASE_NAME"]='tweet_archiveur'scrapper=Scrapper()df_users=scrapper.get_users_accounts('../tests/sample-users.csv')users_id=df_users.twitter_id.tolist()database=Database()database.create_tables_if_not_exist()database.insert_twitter_users(df_users)scrapper.get_all_tweet_and_store_them(database,users_id[0:2])deldatabasedelscrapper2021-03-22 10:21:59,837 -  tweet-archiveur INFO     Scrapper ready
2021-03-22 10:21:59,841 -  tweet-archiveur INFO     Loading database module...
2021-03-22 10:21:59,842 -  tweet-archiveur DEBUG    DEBUG : connect(user=tweet_archiveur_user, password=XXXX, host=localhost, port=8479, database=tweet_archiveur, url=None)
2021-03-22 10:22:03,915 -  tweet-archiveur INFO     Done scrapping, we got 400 tweets from 2 tweetos.How we use itWe get the tweets of the 577 French Parliament member's every 8 hours and store them in a PostgreSQL database.We then explore them with Apache Superset.How we deploy itPrepare the environment :gitclonehttps://github.com/leximpact/tweet-archiveur.gitcdtweet-archiveur
cpdocker/docker.env.envEdit the.envto your needs.Run the application :docker-composeup-dTo view what's going on :dockerlogstweet-archiveur_tweet_archiveur_1-fThe scriptarchiveur.pyuse the package to get the parliament accounts fromhttps://github.com/regardscitoyens/twitter-parlementairesThe parameters is read in a.envfile.It is launched by theentrypoint.shscript every 8 hours.To stop it :docker-composedownThe data is kept in a docker volume, to clean them :docker-composedown-vWhat to do with it ?Most used hashtag (per period, per person)Most/Less active userTimeline ofNLP Topic detectionWord cloudAnnexesExit code :1 : Unknown error when storing tweets2 : Unknown error getting tweets3 : Failed more than 3 consecutive times4 : no envIf one thing fail no tweet will be saved.status code = 429 : 429 'Too many requests' error is returned when you exceed the maximum number of requests allowed
Package: tweetben
Text and Tweet Preprocessing packageThis package is created by Behdad (Ben) Ehsani. The package is designed for cleaning tweets on Twitter immediately and with one-shot coding. Additionally, some functions can be used for text preprocessing. An example is provided to demonstrate efficient usage.Installing the librarypip install preprocessing-text-benUnistalling the librarypip uninstall preprocessing-text-benExample of one-shot cleaning the code:import preprocessing-text-ben as pp

def get_clean(x):
    
    # Convert the string to lowercase
    x = str(x).lower()
    
    # Expand contractions like "don't" to "do not"
    x = pp.cont_to_exp(x)
    
    # Remove any email addresses from the string
    x = pp.remove_emails(x)
    
    # Remove any URLs from the string
    x = pp.remove_urls(x)
    
    # Remove any HTML tags from the string
    x = pp.remove_html_tags(x)
    
    # Remove any retweet tags (RT) from the string
    x = pp.remove_rt(x)
    
    # Remove any accented characters from the string
    x = pp.remove_accented_chars(x)
    
    # Remove any special characters from the string
    x = pp.remove_special_chars(x)
    
    # Return the cleaned string
    return x


#here is the cleaned text in one shot
df['your_cleaned_column'] = df['your_text_column'].apply(lambda x: get_clean(x))version: 0.0.1
Package: tweetbench
tweetbenchFeaturesTODORequirementsTODOInstallationYou can installtweetbenchviapipfromPyPI:$pipinstalltweetbenchUsagePlease see theCommand-line Referencefor details.ContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of theApache 2.0 license,tweetbenchis free and open source software.IssuesIf you encounter any problems,
pleasefile an issuealong with a detailed description.CreditsThis project was generated from@cjolowicz'sHypermodern Python Cookiecuttertemplate.
Package: tweetbot
Tweetbot is a python library for creating and managing twitter bots, it
was created to run the @booneweather twitter bot and is still in early
stages of development. See the todo section below for more information.For a working example check outhttp://twitter.com/booneweatheror clone
the repohttp://github.com/zachseifts/booneweather.## Have ideas on how this could be better or want to help out?Fork the project on github and push back your changes, I’ll include them
in the release.http://github.com/zachseifts/tweetbot## Todohttp://github.com/zachseifts/tweetbot/issuesHandling direct messagesHandling @replies from users
Package: tweetcal
Tweetcal converts a Twitter feed into .ics (calendar) format.InstallInstall withpip install tweetcalHow toTweetcal has two commands. The first converts a Twitter archive toics, the second saves recent tweets toics.Reading an archiveDownload yourTwitter
archiveand unzip it. Let’s say it’s in~/Downloads/archive/. Run this
command:$tweetcalread-archive~/Downloads/archivecalendar-file.icsThis will createcalendar-file.ics. Test it by opening in your
favorite calendaring program.Saving recent tweetsFor this section, you’ll needTwitter OAuth
credentials.Save those tokens to a yaml or json file. Use thesample format in the
repoas a guide. Let’s say you’ve saved the file to~/tweetcal.yamland
your username is ‘screen_name1’. Once that’s set up, run:$tweetcalstream--config~/tweetcal.yaml--userscreen_name1Tweetcal leaves a note in ics files it creates to tell it where in an
account’s stream to start downloading. Because of this, you should only
use a file created by Tweetcal with tweetcal-stream.
Package: tweet-capture
TweetCaptureEasily take screenshots of tweets/mentions and save them as image.Command-Line Usage> pip install tweet-capture
> tweetcapture https://twitter.com/jack/status/20
> tweetcapture -hCode Usage ExamplesCliCode ExamplesTesting> pip3 install opencv-python numpy
> cd tweetcapture/tests/
> python -m unittestDocker Usagedocker run --rm -v $(pwd):/app xacnio/tweetcapture -h
docker run --rm -v $(pwd):/app xacnio/tweetcapture https://twitter.com/jack/status/20On Windows: Replace$(pwd)with${PWD}(Powershell)On Windows: Replace$(pwd)with%cd%(Command Line)Modes#0Hide everything outside tweet content and author.1Show retweet/like counts.2Show retweet/like counts and timestamp.3Show everything.4Show timestamp.Night Modes#0Light mode1Dark mode2Black modeShow Mentions ExampleIf the tweet have a very many mentions, there may be problems because "show more" option not supported. The tool can show only first loaded mentions. You can limit mention count on screenshot by using -sc  argumenttweetcapture -sm 3 https://twitter.com/Twitter/status/1445078208190291973ImageShow Parent Tweets Exampletweetcapture -sp https://twitter.com/elonmusk/status/1587911540770222081Image
Package: tweet-counter
Tweet counterCalculate the size that Twitterwill consider a tweet to be.This is not as advanced asthe official twitter-text libraries, but attempts to at least take into account the following:Twitter will convert anything that looks like a URL (with avalid TLD) into a Twitter short link, and count it as taking up exactly 23 charactersTwitter counts emoji and any unicode character aboveU+2037as each taking up 2 charactersInstallationpip3installtweet-counterPython usagefromtweet_counterimportcount_tweetprint(count_tweet("Otters 👪 otters 𝗼𝘁𝘁𝗲𝗿𝘀 otters otters.com/otters"))# Output => 60Command-line usage$count-tweet"Otters 👪 otters 𝗼𝘁𝘁𝗲𝗿𝘀 otters otters.com/otters"60
Package: tweeter-basic
Tweeter BasicSend tweets (with optional images) and authenticate through the Twitter v2 API (OAuth 2.0) using Python.Quick StartSend a test tweet with the following steps:generate and set the following environment variables:TWITTER_CONSUMER_API_KEYTWITTER_CONSUMER_API_KEY_SECRETTWITTER_ACCESS_TOKENTWITTER_ACCESS_TOKEN_SECRETTWITTER_CLIENT_IDTWITTER_CLIENT_SECRETTWITTER_CALLBACK_URI <- must end in/callback(ie.http://localhost/callback)authorize the application (1 time only) to generate the seedtoken.jsonwith the following:build & run the token generation server by executingAuthenticate/authenticate.shnavigate with a browser to yourhttp://localhost/authsend a test tweet by executingtest/test.shPrerequisitesDocker engineTwitter project with:v1.1 API read & write accessv2 API access2dogive a more verbose explanation of the stepswrite separate PyPI instructionsfutureadd geolocation to tweets:try posting with the v1 API instead of v2:https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-updateusing this format:https://en.wikipedia.org/wiki/GeoJSONwait for an answer tohttps://stackoverflow.com/questions/75817366/how-to-post-a-tweet-with-geo-data-using-twitter-api-v2-0update forums when answer is found:https://twittercommunity.com/t/how-tweet-with-latitude-longitude-information/189749related projectshttps://twitter.com/detroitshipshttps://github.com/ezod/aistweettesting groundsresources usedhelpful tutorials:https://developer.twitter.com/en/docs/tutorials/creating-a-twitter-bot-with-python--oauth-2-0--and-v2-of-the-twihttps://dev.to/twitterdev/handling-refresh-tokens-in-the-oauth-20-authorization-code-flow-with-pkce-with-flask-481pTwitter POST /2/tweetsTwitter POST /1.1/media/uploads.jsonv2 uploading futuremedia-upload.py
Package: tweeterpy
TweeterPyOverviewTweeterPy is a python library to extract data from Twitter. TweeterPy API lets you scrape data from a user's profile like username, userid, bio, followers/followings list, profile media, tweets, etc.Note:Use it on Your Own Risk. Scraping with Residential proxies is advisable while extracting data at scale/in bulk. If possible, use multiple accounts to fetch data from Twitter.DON'T USE YOUR PERSONAL ACCOUNT FOR SCRAPING PURPOSES.InstallationInstall TweeterPy with pippipinstalltweeterpyUsage/Examplespythonquickstart.pyORfromtwitterimportTweeterPyTweeterPy()Example - Get User ID of a User.fromtweeterpyimportTweeterPytwitter=TweeterPy()print(twitter.get_user_id('elonmusk'))DocumentationCheck out step by step guide.DocumentationConfigurationExample - Config Usagefromtweeterpyimportconfigconfig.PROXY={"http":"127.0.0.1","https":"127.0.0.1"}config.TIMEOUT=10config.UPDATE_API=FalseCheck out configuration docs for the available settings.ConfigurationsFeaturesExtracts TweetsExtracts User's FollowersExtracts User's FollowingsExtracts User's Profile DetailsExtracts Twitter Profile Media and much more.Authors@iSarabjitDhimanFeedbackIf you have any feedback, please reach out to us athello@sarabjitdhiman.comor contact me on Social Media @iSarabjitDhimanSupportFor support, emailhello@sarabjitdhiman.com