Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tweezers

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tweezers

A lightweight library for scraping Twitter data.

  • 0.0.2
  • PyPI
  • Socket score

Maintainers
1

Tweezers

Lightweight Python library for scraping data via the Twitter search API.

from tweezers import Tweezers
Create an instance of Tweezers with API credentials
# Loading Twitter auth credentials from a local JSON file. Get yours here:
# https://developer.twitter.com/en/apps/
import json
import os

fp = os.path.join(os.getcwd(), "credentials.json")
with open(fp) as f:
    credentials = json.load(f)

t = Tweezers(
    api_key=credentials["api_key"],
    api_secret_key=credentials["api_secret_key"],
    access_token=credentials["access_token"],
    access_token_secret=credentials["access_token_secret"]
)

Searching returns an instance of a class TweezerSearch, which contains various data attributes returned by the Twitter API:

s = t.search(search_term="bitcoin", total=1000, result_type="recent")
# All the tweet results are returned in a Pandas DataFrame:
s.results_df.head()

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc